path: root/Makefile
diff options
authorBryan Drewery <bdrewery@FreeBSD.org>2017-11-11 01:10:46 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2017-11-11 01:10:46 +0000
commit58d86ed34287f54a5d080cfe9697eb5d7c69f3c7 (patch)
treecde4ce3f5046d11c540d06cfe295735ee395b0be /Makefile
parentf82493cc3a73b3f4ba4b6b10f2ed5470344ce6da (diff)
AUTO_OBJ: Disable in non-build targets.
There's no reason to create object directories for targets like 'installworld' or 'distributeworld', and the others in this list. Specifying MK_AUTO_OBJ as a make argument allows circumventing this if needed for some reason. This fixes mergemaster creating a full object tree due to doing a 'make installconfig' tree walk. Reported by: Mark Millard Sponsored by: Dell EMC Isilon
Notes: svn path=/head/; revision=325697
Diffstat (limited to 'Makefile')
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0f86f4a4e54a..bf6d4c221584 100644
--- a/Makefile
+++ b/Makefile
@@ -167,6 +167,18 @@ META_TGT_WHITELIST+= \
tinderbox toolchain \
toolchains universe world worlds xdev xdev-build
+# Likewise for AUTO_OBJ. Many targets do not need object directories created
+# for each visited directory. Only when things are being built are they
+# needed. Having AUTO_OBJ disabled in a build target is fine as it should
+# fallback to running 'make obj' as needed. If a target is not in this list
+# then it is ran with MK_AUTO_OBJ=no in environment.
+# 'showconfig' is in the list to avoid forcing MK_AUTO_OBJ=no for it.
+ _* all all-man build* depend everything *toolchain* includes \
+ libraries obj objlink showconfig tags xdev xdev-build native-xtools \
+ stage* create-packages* real-packages sign-packages package-pkg \
+ tinderbox universe* kernel kernels world worlds bmake
.ORDER: buildworld installworld
.ORDER: buildworld distrib-dirs
.ORDER: buildworld distribution
@@ -256,6 +268,21 @@ _MAKE+= MK_META_MODE=no
.endif # !exists(/dev/filemon) && !defined(NO_FILEMON)
.endif # !defined(_CAN_USE_META_MODE)
+# Only allow AUTO_OBJ for the whitelisted targets. See AUTO_OBJ_TGT_WHITELIST
+# above. MK_AUTO_OBJ not checked here for "yes" as it may not yet be enabled
+# since it is opportunistic.
+.for _tgt in ${AUTO_OBJ_TGT_WHITELIST}
+.if make(${_tgt})
+.if !defined(_CAN_USE_AUTO_OBJ)
# Guess target architecture from target type, and vice versa, based on
# historic FreeBSD practice of tending to have TARGET == TARGET_ARCH
# expanding to TARGET == TARGET_CPUARCH in recent times, with known