NetBSD/distrib/common/Makefile.tarfloppy
lukem 001c68bd94 Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
2003-07-10 10:33:58 +00:00

89 lines
2.7 KiB
Makefile

# $NetBSD: Makefile.tarfloppy,v 1.10 2003/07/10 10:34:05 lukem Exp $
#
# 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:
# NETBSDSRCDIR Top level of src tree (set by <bsd.own.mk>)
# FLOPPYBASE Basename of floppies. Floppy number ${n} will
# be generated as ${FLOPPYBASE}${n}${FLOPPYSUFFIX}
# 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".
# 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
# ${FLOPPYBASE}${FLOPPYSUFFIX} instead of
# ${FLOPPYBASE}1${FLOPPYSUFFIX}
# FLOPPYMETAFILE USTAR metafile(s) (optional)
# FLOPPYPAD If defined, pad the last floppy to ${FLOPPYSIZE}
# FLOPPYSUFFIX Suffix of created floppies.
# FLOPPY_RELEASEDIR Where to install release floppies.
#
.if !defined(_MAKEFILE_TARFLOPPY_)
_MAKEFILE_TARFLOPPY_=1
.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}
@echo "Copying ${.ALLSRC} to ${.TARGET}"
@rm -f ${.TARGET}
@cp ${.ALLSRC} ${.TARGET}
.endif # FLOPPY_NETBSD # }
.if defined(FLOPPYMETAFILE) # {
CLEANFILES+= ${FLOPPYMETAFILE}
${FLOPPYMETAFILE}:
@echo "Creating ${FLOPPYMETAFILE}"
@rm -f ${FLOPPYMETAFILE}
@touch ${FLOPPYMETAFILE}
.endif # FLOPPYMETAFILE # }
${FLOPPYBASE}1${FLOPPYSUFFIX}: ${FLOPPYFILES} ${DISTRIBDIR}/common/buildfloppies.sh
@echo "Creating ${FLOPPYBASE}1${FLOPPYSUFFIX} from: ${FLOPPYFILES}"
PAX=${TOOL_PAX:Q} ${HOST_SH} ${DISTRIBDIR}/common/buildfloppies.sh \
${FLOPPYINSTBOOT:D-i ${FLOPPYINSTBOOT}} ${FLOPPYPAD:D-p} \
${FLOPPYMAX:D-m ${FLOPPYMAX}} ${FLOPPYSUFFIX:D-s ${FLOPPYSUFFIX}} \
${FLOPPYBASE} ${FLOPPYSIZE} ${FLOPPYFILES}
CLEANFILES+= ${FLOPPYBASE}?${FLOPPYSUFFIX}
realall: ${FLOPPYBASE}1${FLOPPYSUFFIX}
.if defined(FLOPPY_RELEASEDIR)
release:: check_RELEASEDIR .WAIT ${FLOPPYBASE}1${FLOPPYSUFFIX}
if [ -e ${FLOPPYBASE}2${FLOPPYSUFFIX} ]; then \
${RELEASE_INSTALL} ${FLOPPYBASE}?${FLOPPYSUFFIX} \
${RELEASEDIR}/${MACHINE}/${FLOPPY_RELEASEDIR}; \
else \
${RELEASE_INSTALL} ${FLOPPYBASE}1${FLOPPYSUFFIX} \
${RELEASEDIR}/${MACHINE}/${FLOPPY_RELEASEDIR}/${FLOPPYBASE}${FLOPPYSUFFIX}; \
fi
.endif
.endif # _MAKEFILE_TARFLOPPY_