summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.obj.mk
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 /share/mk/bsd.obj.mk
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.)
Diffstat (limited to 'share/mk/bsd.obj.mk')
-rw-r--r--share/mk/bsd.obj.mk42
1 files changed, 6 insertions, 36 deletions
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>__)
OpenPOWER on IntegriCloud