summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-04-23 09:03:56 +0000
committerru <ru@FreeBSD.org>2002-04-23 09:03:56 +0000
commit1a085bedc04ce216032d93ffecd05d19b8bd8809 (patch)
treefa2a90269f4179b941a6484b35b48413f6a30c7f
parente42e586ab2472f8243ec162166258ea136f30ce7 (diff)
downloadFreeBSD-src-1a085bedc04ce216032d93ffecd05d19b8bd8809.zip
FreeBSD-src-1a085bedc04ce216032d93ffecd05d19b8bd8809.tar.gz
Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.
Ensure all standard targets honor SUBDIR. Now `make obj' descends into SUBDIRs even if NOOBJ is set (some descendants may still need an object directory, but we do not have such precedents). Now `make install' in non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install' in SUBDIRs, like we do in bsd.subdir.mk. Nothing depended on the wrong order anyway. Fixed `distribute' targets (except for the bsd.subdir.mk version) so that they do not depend on _SUBDIR; `distribute' calls `install' which already depends on _SUBDIR. De-standardize `maninstall', otherwise manpages would be installed twice. (To be revised later.)
-rw-r--r--Makefile2
-rw-r--r--share/man/man4/Makefile3
-rw-r--r--share/man/man8/Makefile4
-rw-r--r--share/mk/bsd.dep.mk8
-rw-r--r--share/mk/bsd.doc.mk12
-rw-r--r--share/mk/bsd.info.mk23
-rw-r--r--share/mk/bsd.lib.mk32
-rw-r--r--share/mk/bsd.man.mk2
-rw-r--r--share/mk/bsd.nls.mk10
-rw-r--r--share/mk/bsd.obj.mk42
-rw-r--r--share/mk/bsd.prog.mk29
-rw-r--r--share/mk/bsd.sgml.mk2
-rw-r--r--share/mk/bsd.subdir.mk20
-rw-r--r--sys/conf/kmod.mk17
14 files changed, 54 insertions, 152 deletions
diff --git a/Makefile b/Makefile
index 64df16c..53a5326 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@
TGTS= afterdistribute all all-man buildkernel buildworld checkdpadd clean \
cleandepend cleandir depend distribute distribworld everything \
hierarchy includes install installcheck installkernel kernel \
- reinstallkernel installmost installworld libraries lint maninstall \
+ reinstallkernel installmost installworld libraries lint \
mk most obj objlink regress rerelease tags update
PATH= /sbin:/bin:/usr/sbin:/usr/bin
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 1ceafb8..e01f6ea 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -231,9 +231,6 @@ MLINKS+=vpo.4 imm.4
# XXX NOT IMPORTED: man4.hp300 man4.sparc man4.tahoe man4.vax
.if exists(${.CURDIR}/man4.${MACHINE_ARCH})
SUBDIR= man4.${MACHINE_ARCH}
-.if make(maninstall)
-maninstall:: _SUBDIR
-.endif
.endif
.include <bsd.prog.mk>
diff --git a/share/man/man8/Makefile b/share/man/man8/Makefile
index 0851716..47437fb 100644
--- a/share/man/man8/Makefile
+++ b/share/man/man8/Makefile
@@ -21,8 +21,4 @@ MLINKS+=rc.8 ${MACHINE_ARCH}/rc.${MACHINE_ARCH}.8
SUBDIR= man8.${MACHINE_ARCH}
.endif
-.if make(maninstall)
-maninstall:: _SUBDIR
-.endif
-
.include <bsd.prog.mk>
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index 62fd681..ace46b0 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -79,7 +79,7 @@ ${_YC}: ${_YSRC}
.if !target(depend)
.if defined(SRCS)
-depend: beforedepend ${DEPENDFILE} afterdepend _SUBDIR
+depend: beforedepend ${DEPENDFILE} afterdepend
# Different types of sources are compiled with slightly different flags.
# Split up the sources, and filter out headers and non-applicable flags.
@@ -115,7 +115,7 @@ ${DEPENDFILE}: _EXTRADEPEND
.ORDER: ${DEPENDFILE} afterdepend
.else
-depend: beforedepend afterdepend _SUBDIR
+depend: beforedepend afterdepend
.endif
.if !target(beforedepend)
beforedepend:
@@ -133,7 +133,7 @@ tags:
.endif
.if !target(tags)
-tags: ${SRCS} _SUBDIR
+tags: ${SRCS}
@cd ${.CURDIR} && gtags ${GTAGSFLAGS} ${.OBJDIR}
.if defined(HTML)
@cd ${.CURDIR} && htags ${HTAGSFLAGS} -d ${.OBJDIR} ${.OBJDIR}
@@ -141,7 +141,7 @@ tags: ${SRCS} _SUBDIR
.endif
.if !target(cleandepend)
-cleandepend: _SUBDIR
+cleandepend:
.if defined(SRCS)
rm -f ${DEPENDFILE} ${.OBJDIR}/GPATH ${.OBJDIR}/GRTAGS \
${.OBJDIR}/GSYMS ${.OBJDIR}/GTAGS
diff --git a/share/mk/bsd.doc.mk b/share/mk/bsd.doc.mk
index baac64b..0922c51 100644
--- a/share/mk/bsd.doc.mk
+++ b/share/mk/bsd.doc.mk
@@ -155,16 +155,4 @@ ${DFILE}: ${SRCS} _stamp.extraobjs
.endif
.endif
-.if !target(all-man)
-all-man:
-.endif
-
-.if !target(maninstall)
-maninstall:
-.endif
-
-.if !target(regress)
-regress:
-.endif
-
.include <bsd.obj.mk>
diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk
index b800e89..d4f3790 100644
--- a/share/mk/bsd.info.mk
+++ b/share/mk/bsd.info.mk
@@ -72,9 +72,6 @@
# install:
# Install the info files.
#
-# maninstall:
-# Dummy target, do nothing.
-#
#
# bsd.obj.mk: cleandir and obj
@@ -137,10 +134,10 @@ CLEANFILES+= ${IFILENS}
.if !defined(NOINFOCOMPRESS)
CLEANFILES+= ${IFILENS:S/$/${ICOMPRESS_EXT}/}
IFILES= ${IFILENS:S/$/${ICOMPRESS_EXT}/:S/.html${ICOMPRESS_EXT}/.html/}
-all: ${IFILES} _SUBDIR
+all: ${IFILES}
.else
IFILES= ${IFILENS}
-all: ${IFILES} _SUBDIR
+all: ${IFILES}
.endif
.else
all:
@@ -165,7 +162,7 @@ ${x:S/$/-install/}: ${DESTDIR}${INFODIR}/${INFODIRFILE}
DISTRIBUTION?= bin
.if !target(distribute)
-distribute: _SUBDIR
+distribute:
.for dist in ${DISTRIBUTION}
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
.endfor
@@ -190,7 +187,7 @@ CLEANFILES+= ${INFO:S/$/.info.*.html/} ${INFO:S/$/.info/}
.endif
.if !defined(NOINFO) && defined(INFO)
-install: ${INSTALLINFODIRS} _SUBDIR
+install: ${INSTALLINFODIRS}
.if ${IFILES:N*.html}
${INSTALL} ${COPY} -o ${INFOOWN} -g ${INFOGRP} -m ${INFOMODE} \
${IFILES:N*.html} ${DESTDIR}${INFODIR}
@@ -208,16 +205,4 @@ install: __null_install
__null_install:
.endif
-.if !target(all-man)
-all-man: _SUBDIR
-.endif
-
-.if !target(maninstall)
-maninstall: _SUBDIR
-.endif
-
-.if !target(regress)
-regress:
-.endif
-
.include <bsd.obj.mk>
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 2b840a3..a84872a 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -181,10 +181,10 @@ LINTLIB=llib-l${LIB}.ln
_LIBS+=${LINTLIB}
.endif
+all: objwarn ${_LIBS}
+
.if !defined(NOMAN)
-all: objwarn ${_LIBS} all-man _SUBDIR
-.else
-all: objwarn ${_LIBS} _SUBDIR
+all: all-man
.endif
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
@@ -240,7 +240,7 @@ ${LINTLIB}: ${LINTOBJS}
.endif
.if !target(clean)
-clean: _SUBDIR
+clean:
rm -f a.out ${OBJS} ${STATICOBJS} ${OBJS:S/$/.tmp/} ${CLEANFILES}
rm -f lib${LIB}.a
rm -f ${POBJS} ${POBJS:S/$/.tmp/} lib${LIB}_p.a
@@ -298,6 +298,8 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}}
.endfor
realinstall: beforeinstall
+realinstall: _libinstall
+_libinstall:
.if !defined(INTERNALLIB)
${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}.a ${DESTDIR}${LIBDIR}
@@ -345,40 +347,28 @@ realinstall: beforeinstall
${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR}
.endif
-install: afterinstall _SUBDIR
-.if !defined(NOMAN)
-afterinstall: realinstall maninstall
-.else
+install: afterinstall
afterinstall: realinstall
+.if !defined(NOMAN)
+afterinstall: maninstall
.endif
.endif
-.if !target(regress)
-regress:
-.endif
-
DISTRIBUTION?= bin
.if !target(distribute)
-distribute: _SUBDIR
+distribute:
.for dist in ${DISTRIBUTION}
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
.endfor
.endif
.if !target(lint)
-lint: ${SRCS:M*.c} _SUBDIR
+lint: ${SRCS:M*.c}
${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC}
.endif
.if !defined(NOMAN)
.include <bsd.man.mk>
-.else
-.if !target(all-man)
-all-man:
-.endif
-.if !target(maninstall)
-maninstall:
-.endif
.endif
.include <bsd.dep.mk>
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index b63f611..9c02b77 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -74,7 +74,7 @@ MAN+= ${MAN${sect}}
.endfor
.endif
-all-man: _SUBDIR
+all-man:
.if defined(NOMANCOMPRESS)
diff --git a/share/mk/bsd.nls.mk b/share/mk/bsd.nls.mk
index 76da8e1..c7ed6da 100644
--- a/share/mk/bsd.nls.mk
+++ b/share/mk/bsd.nls.mk
@@ -114,17 +114,9 @@ realinstall: beforeinstall nlsinstall links-nls
realinstall: beforeinstall
.endif
-all: all-nls _SUBDIR
+all: all-nls
install: realinstall afterinstall
-.if !target(all-man)
-all-man: _SUBDIR
-.endif
-
-.if !target(maninstall)
-maninstall: _SUBDIR
-.endif
-
DISTRIBUTION?= bin
.if !target(distribute)
distribute:
diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk
index 9b39160..cbd033b 100644
--- a/share/mk/bsd.obj.mk
+++ b/share/mk/bsd.obj.mk
@@ -3,11 +3,6 @@
# The include file <bsd.obj.mk> handles creating the 'obj' directory
# and cleaning up object files, etc.
#
-# Under construction: it also contains the _SUBDIR target (which is used
-# by most `mk' files to recurse into subdirectories) and defaults for the
-# cleandepend, depend and tags targets. It may eventually be merged with
-# with bsd.subdir.mk.
-#
# +++ variables +++
#
# CLEANDIRS Additional directories to remove for the clean target.
@@ -81,11 +76,8 @@ objwarn:
.endif
.endif
-.if !target(obj)
-.if defined(NOOBJ)
+.if !target(obj) && !defined(NOOBJ)
obj:
-.else
-obj: _SUBDIR
@if ! test -d ${CANONICALOBJDIR}/; then \
mkdir -p ${CANONICALOBJDIR}; \
if ! test -d ${CANONICALOBJDIR}/; then \
@@ -95,10 +87,9 @@ obj: _SUBDIR
${ECHO} "${CANONICALOBJDIR} created for ${.CURDIR}"; \
fi
.endif
-.endif
.if !target(objlink)
-objlink: _SUBDIR
+objlink:
@if test -d ${CANONICALOBJDIR}/; then \
rm -f ${.CURDIR}/obj; \
ln -s ${CANONICALOBJDIR} ${.CURDIR}/obj; \
@@ -124,7 +115,7 @@ cleanobj:
@if [ -h ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi
.if !target(clean)
-clean: _SUBDIR
+clean:
.if defined(CLEANFILES) && !empty(CLEANFILES)
rm -f ${CLEANFILES}
.endif
@@ -134,7 +125,7 @@ clean: _SUBDIR
.endif
.if !target(checkdpadd)
-checkdpadd: _SUBDIR
+checkdpadd:
.if (defined(DPADD) || defined(LDADD))
checkdpadd:
.if ${OBJFORMAT} != aout
@@ -158,29 +149,8 @@ checkdpadd:
.endif
.endif
-cleandir: cleanobj _SUBDIR
+cleandir: cleanobj
-.for __target in cleandepend depend tags
-.if !target(${__target})
-${__target}: _SUBDIR
-.endif
-.endfor
-
-_SUBDIR: .USE
-.if defined(SUBDIR) && !empty(SUBDIR)
- @for entry in ${SUBDIR}; do \
- if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \
- ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH}"; \
- edir=$${entry}.${MACHINE_ARCH}; \
- cd ${.CURDIR}/$${edir}; \
- else \
- ${ECHODIR} "===> ${DIRPRFX}$$entry"; \
- edir=$${entry}; \
- cd ${.CURDIR}/$${edir}; \
- fi; \
- ${MAKE} ${.TARGET:realinstall=install} \
- DIRPRFX=${DIRPRFX}$$edir/; \
- done
-.endif
+.include <bsd.subdir.mk>
.endif !target(__<bsd.obj.mk>__)
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index 7fd1be0..7c7826c 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -77,7 +77,6 @@ all: objwarn ${PROG} ${SCRIPTS} ${FILES}
.if !defined(NOMAN)
all: all-man
.endif
-all: _SUBDIR
CLEANFILES+= ${PROG} ${OBJS}
@@ -105,6 +104,8 @@ _INSTALLFLAGS:= ${_INSTALLFLAGS${ie}}
.endfor
realinstall: beforeinstall
+realinstall: _proginstall
+_proginstall:
.if defined(PROG)
.if defined(PROGNAME)
${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
@@ -118,6 +119,8 @@ realinstall: beforeinstall
(cd ${DESTDIR}${ORIGBINDIR}; ln -fs dm ${PROG}; \
chown -h ${BINOWN}:${ORIGBINGRP} ${PROG})
.endif
+
+realinstall:
.if defined(LINKS) && !empty(LINKS)
@set ${LINKS}; \
while test $$# -ge 2; do \
@@ -195,24 +198,23 @@ _FILESINS_${file:T}: ${file}
.endfor
.endif
-install: afterinstall _SUBDIR
-.if !defined(NOMAN)
-afterinstall: realinstall maninstall
-.else
+install: afterinstall
afterinstall: realinstall
+.if !defined(NOMAN)
+afterinstall: maninstall
.endif
.endif
DISTRIBUTION?= bin
.if !target(distribute)
-distribute: _SUBDIR
+distribute:
.for dist in ${DISTRIBUTION}
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
.endfor
.endif
.if !target(lint)
-lint: ${SRCS} _SUBDIR
+lint: ${SRCS}
.if defined(PROG)
${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} | more 2>&1
.endif
@@ -223,7 +225,7 @@ tags:
.endif
.if !target(tags)
-tags: ${SRCS} _SUBDIR
+tags: ${SRCS}
.if defined(PROG)
@cd ${.CURDIR} && gtags ${GTAGSFLAGS} ${.OBJDIR}
.if defined(HTML)
@@ -234,17 +236,6 @@ tags: ${SRCS} _SUBDIR
.if !defined(NOMAN)
.include <bsd.man.mk>
-.else
-.if !target(all-man)
-all-man:
-.endif
-.if !target(maninstall)
-maninstall:
-.endif
-.endif
-
-.if !target(regress)
-regress:
.endif
.if ${OBJFORMAT} != aout || make(checkdpadd) || defined(NEED_LIBNAMES)
diff --git a/share/mk/bsd.sgml.mk b/share/mk/bsd.sgml.mk
index 1b7a884..a37f044 100644
--- a/share/mk/bsd.sgml.mk
+++ b/share/mk/bsd.sgml.mk
@@ -199,7 +199,7 @@ CLEANFILES+= ${DOC}.${_XFORMAT}
.endfor
-.for __target in beforeinstall afterinstall all-man maninstall _SUBDIR
+.for __target in beforeinstall afterinstall all-man
.if !target(${__target})
${__target}:
.endif
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index 9f2b890..cea0779 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -25,15 +25,16 @@
# put the stuff into the right "distribution".
#
# afterdistribute, afterinstall, all, all-man, beforeinstall, checkdpadd,
-# clean, cleandepend, cleandir, depend, install, lint, maninstall,
+# clean, cleandepend, cleandir, depend, install, lint,
# obj, objlink, realinstall, regress, tags
#
.include <bsd.init.mk>
-_SUBDIRUSE: .USE
+_SUBDIR: .USE
+.if defined(SUBDIR) && !empty(SUBDIR)
@for entry in ${SUBDIR}; do \
- (if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \
+ if test -d ${.CURDIR}/$${entry}.${MACHINE_ARCH}; then \
${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE_ARCH}"; \
edir=$${entry}.${MACHINE_ARCH}; \
cd ${.CURDIR}/$${edir}; \
@@ -43,8 +44,9 @@ _SUBDIRUSE: .USE
cd ${.CURDIR}/$${edir}; \
fi; \
${MAKE} ${.TARGET:realinstall=install} \
- DIRPRFX=${DIRPRFX}$$edir/); \
+ DIRPRFX=${DIRPRFX}$$edir/; \
done
+.endif
${SUBDIR}::
@if test -d ${.TARGET}.${MACHINE_ARCH}; then \
@@ -56,11 +58,9 @@ ${SUBDIR}::
.for __target in all all-man checkdpadd clean cleandepend cleandir depend lint \
- maninstall obj objlink regress tags \
+ obj objlink realinstall regress tags \
install.debug reinstall.debug
-.if !target(${__target})
-${__target}: _SUBDIRUSE
-.endif
+${__target}: _SUBDIR
.endfor
.if !target(install)
@@ -72,7 +72,7 @@ afterinstall:
.endif
install: afterinstall
afterinstall: realinstall
-realinstall: beforeinstall _SUBDIRUSE
+realinstall: beforeinstall
.endif
DISTRIBUTION?= bin
@@ -80,7 +80,7 @@ DISTRIBUTION?= bin
afterdistribute:
.endif
.if !target(distribute)
-distribute: _SUBDIRUSE
+distribute: _SUBDIR
.for dist in ${DISTRIBUTION}
cd ${.CURDIR} ; ${MAKE} afterdistribute DESTDIR=${DISTDIR}/${dist}
.endfor
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index b8ac275..4a97f96 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -167,16 +167,9 @@ ${KMOD}.kld: ${OBJS}
.endif
-.if !target(all-man)
-all-man: _SUBDIR
-.endif
-.if !target(maninstall)
-maninstall: _SUBDIR
-.endif
-
_ILINKS=@ machine
-all: objwarn ${PROG} _SUBDIR
+all: objwarn ${PROG}
beforedepend: ${_ILINKS}
@rm -f .depend
@@ -225,11 +218,11 @@ _INSTALLFLAGS:= ${INSTALLFLAGS}
_INSTALLFLAGS:= ${_INSTALLFLAGS${ie}}
.endfor
-install.debug: _SUBDIR
+install.debug:
${INSTALL} ${COPY} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
${_INSTALLFLAGS} ${FULLPROG} ${DESTDIR}${KMODDIR}/
-realinstall: _SUBDIR
+realinstall:
${INSTALL} ${COPY} -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \
${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/
.if defined(LINKS) && !empty(LINKS)
@@ -258,14 +251,14 @@ realinstall: _SUBDIR
-kldxref ${DESTDIR}${KMODDIR}
.endif
-install: afterinstall _SUBDIR
+install: afterinstall
afterinstall: realinstall
realinstall: beforeinstall
.endif
DISTRIBUTION?= bin
.if !target(distribute)
-distribute: _SUBDIR
+distribute:
.for dist in ${DISTRIBUTION}
cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
.endfor
OpenPOWER on IntegriCloud