NetBSD/distrib/notes/Makefile.inc
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

109 lines
2.9 KiB
Makefile

# $NetBSD: Makefile.inc,v 1.33 2003/07/10 10:34:11 lukem Exp $
#
# Ross Harvey <ross@netbsd.org>
.include <bsd.own.mk> # So we get /etc/mk.conf vars.
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
# Whether or not to regenerate tables of contents
#
MKTOCS?=yes
M?= ${.CURDIR:T}
COMMON= ${.CURDIR}/../common
MAIN= ${COMMON}/main ${COMMON}/macros ${EXTRA}
TARG= INSTALL
TARGS= ${TARG}.ps ${TARG}.txt ${TARG}.html ${TARG}.more
TOCS= ${TARG}.PostScript.toc ${TARG}.ASCII.toc ${TARG}.HTML.toc \
${TARG}.more.toc
SRCS= ${MAIN} whatis ${COMMON}/contents hardware xfer prep \
${.CURDIR}/install ${COMMON}/postinstall upgrade \
${COMMON}/donations ${COMMON}/legal.common legal \
${.CURDIR}/../Makefile.inc ${MERGED_SRCS}
PRESET= ${GFLAGS} -dM=${M} -dV=${DISTRIBVER} -d.CURDIR=${.CURDIR} -r${M}=1
POST_PLAIN= -P-b -P-u -P-o
ARGS_PS= ${PRESET} -dformat=PostScript
ARGS_TXT= ${PRESET} -dformat=ASCII ${POST_PLAIN} -Tascii -mtty-char
ARGS_HTML= ${PRESET} -dformat=HTML ${POST_PLAIN} -Tlatin1 -ww
ARGS_MORE= ${PRESET} -dformat=more -P-h -Tascii -mtty-char
#
# For example...
#
# .if ri386 ...stuff...
# .Ss "Install notes for NetBSD/\*[MACHINE]"
#
all: ${TARGS}
.if ${MKTOCS} != "no"
TOC.ps= ${TOCS:M*.PostScript.*}
TOC.txt= ${TOCS:M*.ASCII.*}
TOC.html= ${TOCS:M*.HTML.*}
TOC.more= ${TOCS:M*.more.*}
.endif
${TARG}.ps: ${SRCS} ${TOC.ps}
${TOOL_GROFF} ${ARGS_PS} -mdoc ${MAIN} > $@
${TARG}.pdf: ${TARG}.ps
ps2pdf ${TARG}.ps $@
${TARG}.txt: ${SRCS} ${TOC.txt}
${TOOL_GROFF} ${ARGS_TXT} -mdoc ${MAIN} > $@
${TARG}.html: ${SRCS} ${TOC.html}
${TOOL_GROFF} ${ARGS_HTML} -mdoc2html ${MAIN} > $@
${TARG}.more: ${SRCS} ${TOC.more}
${TOOL_GROFF} ${ARGS_MORE} -mdoc ${MAIN} > $@
# Rules to build the table of contents (.toc) files.
# They are generated twice to take into account the
# space taken by the TOC itself.
#
TOCPROC= 2>&1 >/dev/null |\
sed -n '/^\.Ti/{s/ \([A-Za-z]\)/ "\1/; s/ *$$/"/; p; }'
${TARG}.PostScript.toc: ${SRCS}
${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
${TARG}.ASCII.toc: ${SRCS}
${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
${TARG}.HTML.toc: ${SRCS}
${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
${TARG}.more.toc: ${SRCS}
${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
mv -f $@.tmp $@
release: check_RELEASEDIR .WAIT ${TARGS}
${RELEASE_INSTALL} ${TARGS} ${RELEASEDIR}/${MACHINE}
cleannotes:
rm -f [Ee]rrs mklog core *.core ${TARGS} ${TOCS} \
${TOCS:S/.toc$/.toc.tmp/g}
clean cleandir distclean: cleannotes