summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.subdir.mk
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1998-03-29 01:10:09 +0000
committereivind <eivind@FreeBSD.org>1998-03-29 01:10:09 +0000
commitc72d59a60b3ab7cf9e935eabb15af9091a03b318 (patch)
tree006951dfc2b4db2d1eead4b1b3bd57b5474602d4 /share/mk/bsd.subdir.mk
parent58b3c892fbf3901a03d2c79cf288248da7cebebf (diff)
downloadFreeBSD-src-c72d59a60b3ab7cf9e935eabb15af9091a03b318.zip
FreeBSD-src-c72d59a60b3ab7cf9e935eabb15af9091a03b318.tar.gz
Support for fine-grained external control of subdir building.
Diffstat (limited to 'share/mk/bsd.subdir.mk')
-rw-r--r--share/mk/bsd.subdir.mk50
1 files changed, 38 insertions, 12 deletions
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index 8ca237f..4a95b5d 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -1,5 +1,5 @@
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
-# $Id: bsd.subdir.mk,v 1.21 1998/03/23 14:58:29 eivind Exp $
+# $Id: bsd.subdir.mk,v 1.22 1998/03/26 16:02:44 eivind Exp $
#
# The include file <bsd.subdir.mk> contains the default targets
# for building subdirectories. It has the same seven targets
@@ -20,6 +20,13 @@
# Each of the targets will execute the same target in the
# subdirectories.
#
+# SUBDIR_CHANGE A directory-tree that contains overrides for
+# corresponding build subdirs.
+# Each override is a file containing one subdirname per line:
+# 'subdirlist' is a pure override
+# 'subdirdrop' drops directories from the build
+# 'subdiradd' adds directories to the build
+#
# +++ targets +++
#
# distribute:
@@ -34,18 +41,37 @@
.MAIN: all
+.if defined(SUBDIR_CHANGE) && !empty(SUBDIR_CHANGE) && \
+ exists(${SUBDIR_CHANGE}/${DIRPRFX}/subdirlist)
+SUBDIR!=cat ${SUBDIR_CHANGE}/${DIRPRFX}/subdirlist
+.endif
+
+.if defined(SUBDIR_CHANGE) && !empty(SUBDIR_CHANGE) && \
+ exists(${SUBDIR_CHANGE}/${DIRPRFX}/subdirlist)
+_SUBDIR_EXTRA!=cat ${SUBDIR_CHANGE}/${DIRPRFX}/subdiradd
+.endif
+
_SUBDIRUSE: .USE
- @for entry in ${SUBDIR}; do \
- (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
- ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE}"; \
- edir=$${entry}.${MACHINE}; \
- cd ${.CURDIR}/$${edir}; \
- else \
- ${ECHODIR} "===> ${DIRPRFX}$$entry"; \
- edir=$${entry}; \
- cd ${.CURDIR}/$${edir}; \
- fi; \
- ${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \
+ @for entry in ${SUBDIR} ${_SUBDIR_EXTRA}; do \
+ (if ! (test -f ${SUBDIR_CHANGE}/${DIRPRFX}/subdirdrop && \
+ grep -w $${entry} \
+ ${SUBDIR_CHANGE}/${DIRPRFX}/subdirdrop \
+ > /dev/null); then \
+ if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
+ ${ECHODIR} \
+ "===> ${DIRPRFX}$${entry}.${MACHINE}"; \
+ edir=$${entry}.${MACHINE}; \
+ cd ${.CURDIR}/$${edir}; \
+ else \
+ ${ECHODIR} "===> ${DIRPRFX}$$entry"; \
+ edir=$${entry}; \
+ cd ${.CURDIR}/$${edir}; \
+ fi; \
+ ${MAKE} ${.TARGET:realinstall=install} \
+ SUBDIR_CHANGE=${SUBDIR_CHANGE} \
+ DIRPRFX=${DIRPRFX}$$edir/; \
+ fi; \
+ ); \
done
${SUBDIR}::
OpenPOWER on IntegriCloud