summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/mk/bsd.subdir.mk27
1 files changed, 22 insertions, 5 deletions
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index 55a40e68f56..dab573962b8 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -1,4 +1,4 @@
-# $OpenBSD: bsd.subdir.mk,v 1.9 1997/06/02 23:58:34 mickey Exp $
+# $OpenBSD: bsd.subdir.mk,v 1.10 1998/03/01 09:18:06 niklas Exp $
# $NetBSD: bsd.subdir.mk,v 1.11 1996/04/04 02:05:06 jtc Exp $
# @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
@@ -6,6 +6,9 @@
.MAIN: all
.endif
+# Make sure this is defined
+SKIPDIR?=
+
_SUBDIRUSE: .USE
.if defined(SUBDIR)
@for entry in ${SUBDIR}; do \
@@ -23,10 +26,24 @@ _SUBDIRUSE: .USE
if [ -e ${.CURDIR}/$${_newdir_}/Makefile.bsd-wrapper ]; then \
_makefile_spec_="-f Makefile.bsd-wrapper"; \
fi; \
- echo "===> $${_nextdir_}"; \
- cd ${.CURDIR}/$${_newdir_}; \
- ${MAKE} ${.MAKEFLAGS} $${_makefile_spec_} _THISDIR_="$${_nextdir_}" \
- ${.TARGET:S/realinstall/install/:S/.depend/depend/}); \
+ subskipdir=''; \
+ for skipdir in ${SKIPDIR}; do \
+ subentry=$${skipdir#$${entry}}; \
+ if [ X$${subentry} != X$${skipdir} ]; then \
+ if [ X$${subentry} = X ]; then \
+ echo "($${_nextdir_} skipped)"; \
+ break; \
+ fi; \
+ subskipdir="$${subskipdir} $${subentry#/}"; \
+ fi; \
+ done; \
+ if [ X$${skipdir} = X -o X$${subentry} != X ]; then \
+ echo "===> $${_nextdir_}"; \
+ cd ${.CURDIR}/$${_newdir_}; \
+ ${MAKE} ${.MAKEFLAGS} SKIPDIR="$${subskipdir}" \
+ $${_makefile_spec_} _THISDIR_="$${_nextdir_}" \
+ ${.TARGET:S/realinstall/install/:S/.depend/depend/}; \
+ fi); \
done
${SUBDIR}::