2003-07-10 14:33:58 +04:00
|
|
|
# $NetBSD: Makefile.tarfloppy,v 1.10 2003/07/10 10:34:05 lukem Exp $
|
2002-04-16 13:00:20 +04:00
|
|
|
#
|
|
|
|
# Makefile snippet to create a set of ustar floppies.
|
|
|
|
# Each floppy has an 8KB header, followed by part or all of the ustar archive.
|
|
|
|
#
|
|
|
|
# Required variables:
|
2002-04-26 19:50:21 +04:00
|
|
|
# NETBSDSRCDIR Top level of src tree (set by <bsd.own.mk>)
|
2002-04-16 13:00:20 +04:00
|
|
|
# FLOPPYBASE Basename of floppies. Floppy number ${n} will
|
2002-05-04 05:34:36 +04:00
|
|
|
# be generated as ${FLOPPYBASE}${n}${FLOPPYSUFFIX}
|
2002-04-16 13:00:20 +04:00
|
|
|
# FLOPPYSIZE Size of floppy in 512 byte blocks.
|
|
|
|
# FLOPPYFILES Files to write to floppy.
|
|
|
|
# Usually set to "boot ${FLOPPYMETAFILE} netbsd"
|
|
|
|
#
|
|
|
|
# Optional variables:
|
|
|
|
# FLOPPY_BOOT Bootstrap to use as "boot".
|
|
|
|
# FLOPPY_BOOT_STRIP If yes, strip "boot" before use.
|
|
|
|
# FLOPPY_NETBSD Kernel to to use as "netbsd".
|
2002-05-02 22:02:14 +04:00
|
|
|
# FLOPPYINSTBOOT Installboot program to use.
|
|
|
|
# USTAR image file is in @IMAGE@.
|
|
|
|
# FLOPPYMAX Maximum number of floppies to build.
|
|
|
|
# If 1, the final image is installed as
|
2002-05-04 05:34:36 +04:00
|
|
|
# ${FLOPPYBASE}${FLOPPYSUFFIX} instead of
|
|
|
|
# ${FLOPPYBASE}1${FLOPPYSUFFIX}
|
2002-05-02 22:02:14 +04:00
|
|
|
# FLOPPYMETAFILE USTAR metafile(s) (optional)
|
|
|
|
# FLOPPYPAD If defined, pad the last floppy to ${FLOPPYSIZE}
|
2002-05-04 05:34:36 +04:00
|
|
|
# FLOPPYSUFFIX Suffix of created floppies.
|
2002-05-02 22:02:14 +04:00
|
|
|
# FLOPPY_RELEASEDIR Where to install release floppies.
|
2002-04-16 13:00:20 +04:00
|
|
|
#
|
|
|
|
|
2003-03-11 10:18:38 +03:00
|
|
|
.if !defined(_MAKEFILE_TARFLOPPY_)
|
|
|
|
_MAKEFILE_TARFLOPPY_=1
|
|
|
|
|
|
|
|
|
2002-04-16 13:00:20 +04:00
|
|
|
.if defined(FLOPPY_BOOT) # {
|
|
|
|
CLEANFILES+= boot
|
|
|
|
boot: ${FLOPPY_BOOT}
|
|
|
|
@echo "Copying ${.ALLSRC} to boot"
|
|
|
|
@rm -f boot
|
|
|
|
@cp ${.ALLSRC} boot
|
|
|
|
.if defined(FLOPPY_BOOT_STRIP)
|
|
|
|
@${STRIP} boot
|
|
|
|
.endif
|
|
|
|
.endif # FLOPPY_BOOT # }
|
|
|
|
|
|
|
|
|
|
|
|
.if defined(FLOPPY_NETBSD) # {
|
|
|
|
CLEANFILES+= netbsd
|
|
|
|
netbsd: ${FLOPPY_NETBSD}
|
2002-05-04 05:34:36 +04:00
|
|
|
@echo "Copying ${.ALLSRC} to ${.TARGET}"
|
|
|
|
@rm -f ${.TARGET}
|
|
|
|
@cp ${.ALLSRC} ${.TARGET}
|
2002-04-16 13:00:20 +04:00
|
|
|
.endif # FLOPPY_NETBSD # }
|
|
|
|
|
|
|
|
|
|
|
|
.if defined(FLOPPYMETAFILE) # {
|
|
|
|
CLEANFILES+= ${FLOPPYMETAFILE}
|
|
|
|
${FLOPPYMETAFILE}:
|
|
|
|
@echo "Creating ${FLOPPYMETAFILE}"
|
|
|
|
@rm -f ${FLOPPYMETAFILE}
|
|
|
|
@touch ${FLOPPYMETAFILE}
|
|
|
|
.endif # FLOPPYMETAFILE # }
|
|
|
|
|
|
|
|
|
2002-05-04 05:34:36 +04:00
|
|
|
${FLOPPYBASE}1${FLOPPYSUFFIX}: ${FLOPPYFILES} ${DISTRIBDIR}/common/buildfloppies.sh
|
|
|
|
@echo "Creating ${FLOPPYBASE}1${FLOPPYSUFFIX} from: ${FLOPPYFILES}"
|
2003-07-10 14:33:58 +04:00
|
|
|
PAX=${TOOL_PAX:Q} ${HOST_SH} ${DISTRIBDIR}/common/buildfloppies.sh \
|
2002-04-16 13:00:20 +04:00
|
|
|
${FLOPPYINSTBOOT:D-i ${FLOPPYINSTBOOT}} ${FLOPPYPAD:D-p} \
|
2002-05-04 05:34:36 +04:00
|
|
|
${FLOPPYMAX:D-m ${FLOPPYMAX}} ${FLOPPYSUFFIX:D-s ${FLOPPYSUFFIX}} \
|
2002-04-16 13:00:20 +04:00
|
|
|
${FLOPPYBASE} ${FLOPPYSIZE} ${FLOPPYFILES}
|
|
|
|
|
2002-05-04 05:34:36 +04:00
|
|
|
CLEANFILES+= ${FLOPPYBASE}?${FLOPPYSUFFIX}
|
2002-04-16 13:00:20 +04:00
|
|
|
|
|
|
|
|
2002-05-04 05:34:36 +04:00
|
|
|
realall: ${FLOPPYBASE}1${FLOPPYSUFFIX}
|
2002-04-16 13:00:20 +04:00
|
|
|
|
2002-05-02 22:02:14 +04:00
|
|
|
.if defined(FLOPPY_RELEASEDIR)
|
2002-05-07 07:34:16 +04:00
|
|
|
release:: check_RELEASEDIR .WAIT ${FLOPPYBASE}1${FLOPPYSUFFIX}
|
2002-05-04 05:34:36 +04:00
|
|
|
if [ -e ${FLOPPYBASE}2${FLOPPYSUFFIX} ]; then \
|
|
|
|
${RELEASE_INSTALL} ${FLOPPYBASE}?${FLOPPYSUFFIX} \
|
2003-01-03 18:34:30 +03:00
|
|
|
${RELEASEDIR}/${MACHINE}/${FLOPPY_RELEASEDIR}; \
|
2002-04-16 13:00:20 +04:00
|
|
|
else \
|
2002-05-04 05:34:36 +04:00
|
|
|
${RELEASE_INSTALL} ${FLOPPYBASE}1${FLOPPYSUFFIX} \
|
2003-01-03 18:34:30 +03:00
|
|
|
${RELEASEDIR}/${MACHINE}/${FLOPPY_RELEASEDIR}/${FLOPPYBASE}${FLOPPYSUFFIX}; \
|
2002-04-16 13:00:20 +04:00
|
|
|
fi
|
|
|
|
.endif
|
2003-03-11 10:18:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
.endif # _MAKEFILE_TARFLOPPY_
|