Cosmetically tweak how .PHONY is used by (generally) providing it as a source,

instead of using it as a target with all the rules as its sources.
This commit is contained in:
lukem 2004-01-29 01:48:45 +00:00
parent b763e0987d
commit 84a4748659
15 changed files with 56 additions and 57 deletions

View File

@ -1,7 +1,6 @@
# $NetBSD: bsd.dep.mk,v 1.65 2004/01/27 03:31:48 lukem Exp $
# $NetBSD: bsd.dep.mk,v 1.66 2004/01/29 01:48:45 lukem Exp $
##### Basic targets
.PHONY: cleandepend
cleandir: cleandepend
realdepend: beforedepend .depend afterdepend
.ORDER: beforedepend .depend afterdepend
@ -67,7 +66,7 @@ ${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
.endif # defined(SRCS) # }
##### Clean rules
cleandepend:
cleandepend: .PHONY
.if defined(SRCS)
rm -f .depend ${__DPSRCS.d} ${.CURDIR}/tags ${CLEANDEPEND}
.endif

View File

@ -1,10 +1,9 @@
# $NetBSD: bsd.doc.mk,v 1.62 2003/10/21 10:01:21 lukem Exp $
# $NetBSD: bsd.doc.mk,v 1.63 2004/01/29 01:48:45 lukem Exp $
# @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93
.include <bsd.init.mk>
##### Basic targets
.PHONY: cleandoc docinstall print spell
clean: cleandoc
realinstall: docinstall
@ -21,6 +20,8 @@ realall: paper.ps
##### Install rules
docinstall:: # ensure existence
.PHONY: docinstall
.if ${MKDOC} != "no"
__docinstall: .USE
@ -53,16 +54,16 @@ docinstall:: ${_F}
.endif # ${MKDOC} != "no"
##### Clean rules
cleandoc:
cleandoc: .PHONY
rm -f paper.* [eE]rrs mklog ${CLEANFILES}
##### Custom rules
.if !target(print)
print: paper.ps
print: .PHONY paper.ps
lpr -P${PRINTER} ${.ALLSRC}
.endif
spell: ${SRCS}
spell: .PHONY ${SRCS}
spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
##### Pull in related .mk logic

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.files.mk,v 1.28 2003/10/21 10:01:21 lukem Exp $
# $NetBSD: bsd.files.mk,v 1.29 2004/01/29 01:48:45 lukem Exp $
.if !defined(_BSD_FILES_MK_)
_BSD_FILES_MK_=1
@ -7,7 +7,6 @@ _BSD_FILES_MK_=1
.if !target(__fileinstall)
##### Basic targets
.PHONY: filesinstall
realinstall: filesinstall
##### Default values
@ -18,6 +17,7 @@ FILESMODE?= ${NONBINMODE}
##### Install rules
filesinstall:: # ensure existence
.PHONY: filesinstall
__fileinstall: .USE
${_MKTARGET_INSTALL}
@ -71,9 +71,8 @@ ${_TL}: ${_SL}
realall: ${BUILDSYMLINKS.t}
.PHONY: cleanbuildsymlinks
cleandir: cleanbuildsymlinks
cleanbuildsymlinks:
cleanbuildsymlinks: .PHONY
rm -f ${BUILDSYMLINKS.t}
.endif # }

View File

@ -1,10 +1,9 @@
# $NetBSD: bsd.hostlib.mk,v 1.12 2004/01/02 16:12:36 lukem Exp $
# $NetBSD: bsd.hostlib.mk,v 1.13 2004/01/29 01:48:45 lukem Exp $
.include <bsd.init.mk>
.include <bsd.sys.mk>
##### Basic targets
.PHONY: cleanlib
clean: cleanlib
##### Default values
@ -45,7 +44,7 @@ lib${HOSTLIB}.a: ${OBJS} ${DPADD}
realall: lib${HOSTLIB}.a
cleanlib:
cleanlib: .PHONY
rm -f a.out [Ee]rrs mklog core *.core \
lib${HOSTLIB}.a ${OBJS} ${CLEANFILES}

View File

@ -1,11 +1,10 @@
# $NetBSD: bsd.hostprog.mk,v 1.40 2004/01/27 03:31:48 lukem Exp $
# $NetBSD: bsd.hostprog.mk,v 1.41 2004/01/29 01:48:45 lukem Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.include <bsd.init.mk>
.include <bsd.sys.mk>
##### Basic targets
.PHONY: cleanprog
clean: cleanprog
##### Default values
@ -90,7 +89,7 @@ MAN= ${HOSTPROG}.1
realall: ${HOSTPROG}
cleanprog:
cleanprog: .PHONY
rm -f a.out [Ee]rrs mklog core *.core \
${HOSTPROG} ${OBJS} ${LOBJS} ${CLEANFILES}

View File

@ -1,9 +1,8 @@
# $NetBSD: bsd.inc.mk,v 1.29 2004/01/27 02:52:19 lukem Exp $
# $NetBSD: bsd.inc.mk,v 1.30 2004/01/29 01:48:45 lukem Exp $
.include <bsd.init.mk>
##### Basic targets
.PHONY: incinstall
includes: ${INCS} incinstall inclinkinstall
##### Default values
@ -11,6 +10,7 @@ INCSYMLINKS?=
##### Install rules
incinstall:: # ensure existence
.PHONY: incinstall
# -c is forced on here, in order to preserve modtimes for "make depend"
__incinstall: .USE

View File

@ -1,9 +1,8 @@
# $NetBSD: bsd.info.mk,v 1.36 2003/10/21 10:01:21 lukem Exp $
# $NetBSD: bsd.info.mk,v 1.37 2004/01/29 01:48:45 lukem Exp $
.include <bsd.init.mk>
##### Basic targets
.PHONY: infoinstall cleaninfo
cleandir: cleaninfo
realinstall: infoinstall
@ -30,6 +29,8 @@ realall: ${INFOFILES}
##### Install rules
infoinstall:: # ensure existence
.PHONY: infoinstall
.if ${MKINFO} != "no"
INFODIRFILE=${DESTDIR}${INFODIR}/dir
@ -79,7 +80,7 @@ infoinstall:: ${_F}
##### Clean rules
CLEANFILES+= ${INFOFILES}
cleaninfo:
cleaninfo: .PHONY
.if !empty(CLEANFILES)
rm -f ${CLEANFILES}
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.kinc.mk,v 1.34 2004/01/27 02:52:19 lukem Exp $
# $NetBSD: bsd.kinc.mk,v 1.35 2004/01/29 01:48:45 lukem Exp $
# Variables:
#
@ -20,17 +20,16 @@
.include <bsd.init.mk>
##### Basic targets
.PHONY: incinstall
.PHONY: ${DESTDIR}${INCSDIR}
.PRECIOUS: ${DESTDIR}${INCSDIR}
includes: ${DESTDIR}${INCSDIR} .WAIT ${INCS} incinstall
##### Install rules
incinstall:: # ensure existence
.PHONY: incinstall
# make sure the directory is OK, and install includes.
${DESTDIR}${INCSDIR}:
${DESTDIR}${INCSDIR}: .EXEC
@if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
${_MKSHMSG_CREATE} ${.TARGET}; \
/bin/rm -rf ${.TARGET}; \

View File

@ -1,9 +1,8 @@
# $NetBSD: bsd.kmod.mk,v 1.73 2004/01/27 03:31:48 lukem Exp $
# $NetBSD: bsd.kmod.mk,v 1.74 2004/01/29 01:48:45 lukem Exp $
.include <bsd.init.mk>
##### Basic targets
.PHONY: cleankmod kmodinstall load unload
clean: cleankmod
realinstall: kmodinstall
@ -127,13 +126,14 @@ ${_PROG}: .MADE # no build at install
${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
kmodinstall:: ${_PROG}
.PHONY: kmodinstall
.PRECIOUS: ${_PROG} # keep if install fails
.undef _PROG
.endif # !target(kmodinstall)
##### Clean rules
cleankmod:
cleankmod: .PHONY
rm -f a.out [Ee]rrs mklog core *.core \
${PROG} ${OBJS} ${LOBJS} ${CLEANFILES}
@ -147,11 +147,13 @@ lint: ${LOBJS}
load: ${PROG}
/sbin/modload ${KMOD_LOADFLAGS} -o ${KMOD} ${PROG}
.endif
.PHONY: load
.if !target(unload)
unload:
/sbin/modunload -n ${KMOD}
.endif
.PHONY: unload
##### Pull in related .mk logic
.include <bsd.man.mk>

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.lib.mk,v 1.245 2004/01/27 03:31:48 lukem Exp $
# $NetBSD: bsd.lib.mk,v 1.246 2004/01/29 01:48:45 lukem Exp $
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
.include <bsd.init.mk>
@ -8,7 +8,7 @@
.include <bsd.sys.mk>
##### Basic targets
.PHONY: checkver cleanlib libinstall
.PHONY: checkver libinstall
realinstall: checkver libinstall
clean: cleanlib
@ -474,7 +474,7 @@ llib-l${LIB}.ln: ${LOBJS}
.endif
.endif
cleanlib:
cleanlib: .PHONY
rm -f a.out [Ee]rrs mklog core *.core ${CLEANFILES}
rm -f lib${LIB}.a ${OBJS}
rm -f lib${LIB}_p.a ${POBJS}

View File

@ -1,9 +1,8 @@
# $NetBSD: bsd.links.mk,v 1.25 2003/11/07 00:05:24 lukem Exp $
# $NetBSD: bsd.links.mk,v 1.26 2004/01/29 01:48:45 lukem Exp $
.include <bsd.init.mk>
##### Basic targets
.PHONY: linksinstall
install: linksinstall
##### Default values
@ -11,6 +10,7 @@ LINKS?=
SYMLINKS?=
##### Install rules
.PHONY: linksinstall
linksinstall:: realinstall
.if !empty(SYMLINKS)
@(set ${SYMLINKS}; \

View File

@ -1,11 +1,10 @@
# $NetBSD: bsd.man.mk,v 1.90 2003/11/07 00:05:24 lukem Exp $
# $NetBSD: bsd.man.mk,v 1.91 2004/01/29 01:48:45 lukem Exp $
# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
.include <bsd.init.mk>
##### Basic targets
.PHONY: catinstall maninstall catpages manpages catlinks manlinks \
cleanman html installhtml cleanhtml
.PHONY: catinstall maninstall catpages manpages
realinstall: ${MANINSTALL}
##### Default values
@ -86,7 +85,7 @@ manpages:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
manlinks: manpages # symlink install
manlinks: .PHONY manpages # symlink install
.if !empty(MLINKS)
@set ${MLINKS}; \
while test $$# -ge 2; do \
@ -147,7 +146,7 @@ catpages:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
catlinks: catpages # symlink install
catlinks: .PHONY catpages # symlink install
.if !empty(MLINKS)
@set ${MLINKS}; \
while test $$# -ge 2; do \
@ -169,11 +168,11 @@ catlinks: catpages # symlink install
##### Build and install rules (HTML pages)
.if ${MKHTML} != "no" # {
installhtml: htmlpages
installhtml: .PHONY htmlpages
htmlpages:: # ensure target exists
HTMLPAGES= ${MAN:C/\.([1-9])$/.html\1/}
html: ${HTMLPAGES}
html: .PHONY ${HTMLPAGES}
.NOPATH: ${HTMLPAGES}
.SUFFIXES: ${_MNUMBERS:@N@.html$N@}
@ -202,7 +201,8 @@ htmlpages:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
cleanhtml:
cleandir: cleanhtml
cleanhtml: .PHONY
rm -f ${HTMLPAGES}
.endif # }
@ -210,7 +210,7 @@ cleanhtml:
.undef _F
cleandir: cleanman
cleanman:
cleanman: .PHONY
.if !empty(MAN) && (${MKMAN} != "no")
.if (${MKCATPAGES} != "no")
rm -f ${CATPAGES}

View File

@ -1,9 +1,8 @@
# $NetBSD: bsd.nls.mk,v 1.44 2003/10/21 10:01:21 lukem Exp $
# $NetBSD: bsd.nls.mk,v 1.45 2004/01/29 01:48:45 lukem Exp $
.include <bsd.init.mk>
##### Basic targets
.PHONY: cleannls nlsinstall
cleandir: cleannls
realinstall: nlsinstall
@ -31,6 +30,8 @@ realall: ${NLSALL}
##### Install rules
nlsinstall:: # ensure existence
.PHONY: nlsinstall
.if ${MKNLS} != "no"
__nlsinstall: .USE
@ -61,7 +62,7 @@ nlsinstall:: ${_F}
.endif # ${MKNLS} != "no"
##### Clean rules
cleannls:
cleannls: .PHONY
.if ${MKNLS} != "no" && !empty(NLS)
rm -f ${NLSALL}
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.prog.mk,v 1.196 2004/01/27 03:31:48 lukem Exp $
# $NetBSD: bsd.prog.mk,v 1.197 2004/01/29 01:48:45 lukem Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.ifndef HOSTPROG
@ -12,7 +12,6 @@ PROG= ${PROG_CXX}
.endif
##### Basic targets
.PHONY: cleanextra cleanobjs cleanprog proginstall scriptsinstall
realinstall: proginstall scriptsinstall
clean: cleanprog
@ -193,15 +192,15 @@ MAN= ${PROG}.1
realall: ${PROG} ${SCRIPTS}
cleanprog: cleanobjs cleanextra
cleanprog: .PHONY cleanobjs cleanextra
rm -f a.out [Ee]rrs mklog core *.core .gdbinit ${PROG}
cleanobjs:
cleanobjs: .PHONY
.if defined(OBJS) && !empty(OBJS)
rm -f ${OBJS} ${LOBJS}
.endif
cleanextra:
cleanextra: .PHONY
.if defined(CLEANFILES) && !empty(CLEANFILES)
rm -f ${CLEANFILES}
.endif
@ -233,6 +232,7 @@ ${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
.if !target(proginstall)
proginstall::
.endif
.PHONY: proginstall
.if defined(SCRIPTS) && !target(scriptsinstall)
SCRIPTSDIR?=${BINDIR}
@ -269,6 +269,7 @@ ${DESTDIR}${SCRIPTSDIR_${S}:U${SCRIPTSDIR}}/${SCRIPTSNAME_${S}:U${SCRIPTSNAME:U$
.if !target(scriptsinstall)
scriptsinstall::
.endif
.PHONY: scriptsinstall
lint: ${LOBJS}
.if defined(LOBJS) && !empty(LOBJS)

View File

@ -1,4 +1,4 @@
# $NetBSD: bsd.subdir.mk,v 1.46 2001/11/02 05:21:51 tv Exp $
# $NetBSD: bsd.subdir.mk,v 1.47 2004/01/29 01:48:45 lukem Exp $
# @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
.include <bsd.init.mk>
@ -40,14 +40,12 @@ __TARGDIR := ${dir}
.if ${__TARGDIR} == ".WAIT"
SUBDIR_${targ} += .WAIT
.elif !commands(${targ}-${dir})
.PHONY: ${targ}-${dir}
${targ}-${dir}: .MAKE __recurse
${targ}-${dir}: .PHONY .MAKE __recurse
SUBDIR_${targ} += ${targ}-${dir}
.endif
.endfor
.if defined(__REALSUBDIR)
.PHONY: subdir-${targ}
subdir-${targ}: ${SUBDIR_${targ}}
subdir-${targ}: .PHONY ${SUBDIR_${targ}}
${targ}: subdir-${targ}
.endif
.endfor