summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-06-14 16:20:14 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-06-14 16:20:14 +0000
commitc04f460780b0777276e47f7434d8394cea681c80 (patch)
tree9c3d345303b942ce4d846a28d11f806c693c46ff /Makefile
parent8c2481d2a9a14414aed0dd43a837221ecc5bf9c6 (diff)
downloadFreeBSD-src-c04f460780b0777276e47f7434d8394cea681c80.zip
FreeBSD-src-c04f460780b0777276e47f7434d8394cea681c80.tar.gz
WITH_META_MODE: Whitelist targets that are meta-mode-safe.
META_TGT_WHITELIST is added to define which build targets are safe for meta mode. See comments for more details. This fixes 'make delete-old-libs' to properly show the interactive prompt. Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 24 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 2d8bce6..5e2f951 100644
--- a/Makefile
+++ b/Makefile
@@ -133,12 +133,27 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \
create-world-packages create-kernel-packages create-packages \
packages installconfig real-packages sign-packages package-pkg
+# XXX: r156740: This can't work since bsd.subdir.mk is not included ever.
+# It will only work for SUBDIR_TARGETS in make.conf.
TGTS+= ${SUBDIR_TARGETS}
BITGTS= files includes
BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
TGTS+= ${BITGTS}
+# Only some targets are allowed to use meta mode. Others get it
+# disabled. In some cases, such as 'install', meta mode can be dangerous
+# as a cookie may be used to prevent redundant installations (such as
+# for WORLDTMP staging). For DESTDIR=/ we always want to install though.
+# For other cases, such as delete-old-libs, meta mode may break
+# the interactive tty prompt. The safest route is to just whitelist
+# the ones that benefit from it.
+META_TGT_WHITELIST+= \
+ _* build32 buildfiles buildincludes buildkernel buildsoft \
+ buildworld everything kernel-toolchains kernels libraries \
+ native-xtools tinderbox toolchain toolchains universe worlds \
+ xdev xdev-build
+
.ORDER: buildworld installworld
.ORDER: buildworld distributeworld
.ORDER: buildworld buildkernel
@@ -194,14 +209,17 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk
_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH}
-# Must disable META_MODE when installing to avoid missing anything. The
-# main problem is that buildworld will create cookies for install targets
-# since they are being installed into WORLDTMP. This avoids unneeded and
-# redundant restaging but is dangerous for user install targets.
-.if make(distrib*) || make(*install*)
+# Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST
+# above.
+.for _tgt in ${META_TGT_WHITELIST}
+.if make(${_tgt})
+_CAN_USE_META_MODE?= yes
+.endif
+.endfor
+.if !defined(_CAN_USE_META_MODE)
_MAKE+= MK_META_MODE=no
.unexport META_MODE
-.endif
+.endif # !defined(_CAN_USE_META_MODE)
# Guess machine architecture from machine type, and vice versa.
.if !defined(TARGET_ARCH) && defined(TARGET)
OpenPOWER on IntegriCloud