aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@FreeBSD.org>2023-07-27 04:10:48 +0000
committerJessica Clarke <jrtc27@FreeBSD.org>2023-07-27 04:10:48 +0000
commit8fc3059b00c570fc7475ce84e5f8f8e13195df44 (patch)
treef9feca56d11fc4b116d29a9bc114b1e4e839825e
parent65f28f63a73d3371d9d724a2018be6d1ada0d3e0 (diff)
downloadsrc-8fc3059b00c570fc7475ce84e5f8f8e13195df44.tar.gz
src-8fc3059b00c570fc7475ce84e5f8f8e13195df44.zip
Makefile.inc1: Split _cleanworldtmp out from _worldtmp
This mirrors _cleanobj vs _obj, and will be used by etcupdate to ensure its build tree has host tools available when BUILD_WITH_STRICT_TMPPATH is enabled by default (whether in the source tree, like CheriBSD, or in a system config file). Note that due to line length the .MAKE .PHONY dependency line is split into two, one for the filtered WMAKE_TGTS and one for the filtered .ALLTARGETS. Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D41190
-rw-r--r--Makefile2
-rw-r--r--Makefile.inc116
2 files changed, 12 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 22d088c8f2da..f3bc3d1f96aa 100644
--- a/Makefile
+++ b/Makefile
@@ -172,7 +172,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \
list-old-dirs list-old-files list-old-libs \
obj objlink showconfig tags toolchain \
makeman sysent \
- _worldtmp _legacy _bootstrap-tools _cleanobj _obj \
+ _cleanworldtmp _worldtmp _legacy _bootstrap-tools _cleanobj _obj \
_build-tools _build-metadata _cross-tools _includes _libraries \
builddtb xdev xdev-build xdev-install \
xdev-links native-xtools native-xtools-install stageworld stagekernel \
diff --git a/Makefile.inc1 b/Makefile.inc1
index 964bdfc08699..aa65711fbc0b 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1028,12 +1028,12 @@ _cleanobj_fast_depend_hack: .PHONY
ALL_libcompats=${_ALL_libcompats:Q} \
sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP}
-_worldtmp: .PHONY
+_cleanworldtmp: .PHONY
+.if ${MK_CLEAN} == "yes"
@echo
@echo "--------------------------------------------------------------"
- @echo ">>> Rebuilding the temporary build tree"
+ @echo ">>> Cleaning up the temporary build tree"
@echo "--------------------------------------------------------------"
-.if ${MK_CLEAN} == "yes"
rm -rf ${WORLDTMP}
.else
# Note: for delete-old we need to set $PATH to also include the host $PATH
@@ -1059,6 +1059,11 @@ _worldtmp: .PHONY
@rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld
.endif # ${USING_SYSTEM_LINKER} == "yes"
.endif # ${MK_CLEAN} == "yes"
+_worldtmp: .PHONY
+ @echo
+ @echo "--------------------------------------------------------------"
+ @echo ">>> Rebuilding the temporary build tree"
+ @echo "--------------------------------------------------------------"
@mkdir -p ${WORLDTMP}
@touch ${WORLDTMP}/${.TARGET}
# We can't use mtree to create the worldtmp directories since it may not be
@@ -1174,7 +1179,7 @@ everything: .PHONY
WMAKE_TGTS=
.if !defined(WORLDFAST)
-WMAKE_TGTS+= _sanity_check _worldtmp _legacy
+WMAKE_TGTS+= _sanity_check _cleanworldtmp _worldtmp _legacy
.if empty(SUBDIR_OVERRIDE)
WMAKE_TGTS+= _bootstrap-tools
.endif
@@ -1690,7 +1695,8 @@ _cleankernobj_fast_depend_hack: .PHONY
.endfor
.endif
-${WMAKE_TGTS:N_worldtmp:${libcompats:@v@Nbuild${v}@:ts:}} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
+${WMAKE_TGTS:N_cleanworldtmp:N_worldtmp:${libcompats:@v@Nbuild${v}@:ts:}}: .MAKE .PHONY
+${.ALLTARGETS:M_*:N_cleanworldtmp:N_worldtmp}: .MAKE .PHONY
# record kernel(s) build time in seconds
.if make(buildkernel)