path: root/share
diff options
authorBryan Drewery <bdrewery@FreeBSD.org>2016-03-11 23:45:23 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2016-03-11 23:45:23 +0000
commitbd08afe1c93546441a7b2a7a366579959f098940 (patch)
treeb3328c18a0f2aef214ebceec922f25713f28a9a0 /share
parentbffd819972c47ff4d61887e61851148597aeba33 (diff)
DIRDEPS_BUILD: Add a sure way to prohibit building 'all' during dirdeps phase.
This obsoletes the _SKIP_BUILD check but keeps it for now until it proves to be enough. In the dirdeps build the first 'make all' or 'make' ran would invoke 'make dirdeps' which builds dependencies and then builds the current directory in a sub-make (when BUILD_AT_LEVEL0 is no, which for us it is). This behavior causes things attached to 'all:' to build in the dirdeps phase AND the sub-make phase which creates all kinds of problems for staging, meta file tracking, and races. Sponsored by: EMC / Isilon Storage Division
Notes: svn path=/head/; revision=296699
Diffstat (limited to 'share')
1 files changed, 10 insertions, 0 deletions
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index c853f7c5f781..14bfb64d9c35 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -132,6 +132,16 @@ PYTHON ?= /usr/local/bin/python
.export PYTHON
# this works best if share/mk is ready for it.
+# _SKIP_BUILD is not 100% as it requires wrapping all 'all:' targets to avoid
+# building in MAKELEVEL0. Just prohibit 'all' entirely in this case to avoid
+# problems.
+.if ${MK_DIRDEPS_BUILD} == "yes" && \
+ ${.MAKE.LEVEL} == 0 && ${BUILD_AT_LEVEL0:Uyes:tl} == "no"
+.MAIN: dirdeps
+.if make(all)
+.error DIRDEPS_BUILD: Please run '${MAKE}' instead of '${MAKE} all'.
# we want to end up with a singe stage tree for all machines
.if ${MK_STAGING} == "yes"