summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-06-15 13:45:37 +0000
committerian <ian@FreeBSD.org>2014-06-15 13:45:37 +0000
commitc9e2f27302b757a12d8a346c00fe9a5555175f8c (patch)
tree096be8c18e87ab33c816bec866bb75df9329af5d /share
parent52e22052afc289ba58dd2850c4a491fa2a131264 (diff)
downloadFreeBSD-src-c9e2f27302b757a12d8a346c00fe9a5555175f8c.zip
FreeBSD-src-c9e2f27302b757a12d8a346c00fe9a5555175f8c.tar.gz
Create a mechanism for providing fine-grained build order dependencies
during SUBDIR_PARALLEL builds. This augments the coarse .WAIT mechanism, which is still useful if you've got a situation such as "almost everything depends on A and B". Because the parallel subdir mechanism uses non-obvious mangling of target names, which should probably remain a private detail of the implementation, it's not easy to do things like "libfoo: libbar", so instead the new mechanism lets you set a variable that lists dependencies: SUBDIR_DEPEND_libfoo= libgroodah libpouet Note that while I'm using libraries as an example here, it really has nothing to do with the generated library files. This is really saying "build in directory libfoo after building in the libgroodah and libpouet directories." This updates lib/Makefile with dependency information based on the old almost-accurate comment block and by combing through lib/* makefiles looking for LDADD dependencies to other libraries within lib/*. Reviewed by: Jia-Shiun Li <jiashiun@gmail.com>
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.subdir.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk
index b0ce120..f76d5e1 100644
--- a/share/mk/bsd.subdir.mk
+++ b/share/mk/bsd.subdir.mk
@@ -80,7 +80,11 @@ __subdir_targets=
__subdir_targets+= .WAIT
.else
__subdir_targets+= ${__target}_subdir_${__dir}
-${__target}_subdir_${__dir}: .MAKE
+__deps=
+.for __dep in ${SUBDIR_DEPEND_${__dir}}
+__deps+= ${__target}_subdir_${__dep}
+.endfor
+${__target}_subdir_${__dir}: .MAKE ${__deps}
.if !defined(NO_SUBDIR)
@${_+_}set -e; \
if test -d ${.CURDIR}/${__dir}.${MACHINE_ARCH}; then \
OpenPOWER on IntegriCloud