aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/Makefile2
-rw-r--r--lib/Makefile4
-rw-r--r--lib/clang/Makefile2
-rw-r--r--sbin/Makefile2
-rw-r--r--share/mk/bsd.subdir.mk19
-rw-r--r--usr.bin/Makefile2
-rw-r--r--usr.sbin/Makefile2
7 files changed, 33 insertions, 0 deletions
diff --git a/bin/Makefile b/bin/Makefile
index e4bc281db638..63d96fedbdfe 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -60,4 +60,6 @@ SUBDIR+= tests
SUBDIR:= ${SUBDIR:O}
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/lib/Makefile b/lib/Makefile
index 41eb9b59e062..5ef072332ecb 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -276,4 +276,8 @@ afterinstall:
${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include
.endif
+.if !make(install)
+SUBDIR_PARALLEL=
+.endif
+
.include <bsd.subdir.mk>
diff --git a/lib/clang/Makefile b/lib/clang/Makefile
index 8b6f38588f67..d335d80fbee2 100644
--- a/lib/clang/Makefile
+++ b/lib/clang/Makefile
@@ -147,4 +147,6 @@ SUBDIR+=liblldb \
SUBDIR+= include
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/sbin/Makefile b/sbin/Makefile
index fcf17099de96..154815514349 100644
--- a/sbin/Makefile
+++ b/sbin/Makefile
@@ -126,4 +126,6 @@ SUBDIR+= tests
SUBDIR:= ${SUBDIR:O}
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index 12dd4ded5897..0ceda56962ed 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -71,7 +71,26 @@ ${SUBDIR}: .PHONY .MAKE
.for __target in all all-man checkdpadd clean cleandepend cleandir \
cleanilinks depend distribute lint maninstall manlint obj objlink \
realinstall regress tags ${SUBDIR_TARGETS}
+.ifdef SUBDIR_PARALLEL
+.for __dir in ${SUBDIR}
+${__target}: ${__target}_subdir_${__dir}
+${__target}_subdir_${__dir}: .MAKE
+ @${_+_}set -e; \
+ if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \
+ ${ECHODIR} "===> ${DIRPRFX}${__dir}.${MACHINE_ARCH} (${__target:realinstall=install})"; \
+ edir=${__dir}.${MACHINE_ARCH}; \
+ cd ${.CURDIR}/$${edir}; \
+ else \
+ ${ECHODIR} "===> ${DIRPRFX}${__dir} (${__target:realinstall=install})"; \
+ edir=${__dir}; \
+ cd ${.CURDIR}/$${edir}; \
+ fi; \
+ ${MAKE} ${__target:realinstall=install} \
+ DIRPRFX=${DIRPRFX}$$edir/
+.endfor
+.else
${__target}: _SUBDIR
+.endif
.endfor
.for __target in files includes
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 007c9ab716d7..c6727cd50b74 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -379,4 +379,6 @@ SUBDIR+= svn
SUBDIR:= ${SUBDIR:O}
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index b709be552428..45e38c196dbd 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -320,4 +320,6 @@ SUBDIR+= wpa
SUBDIR:= ${SUBDIR:O}
+SUBDIR_PARALLEL=
+
.include <bsd.subdir.mk>