aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2017-10-31 19:02:14 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2017-10-31 19:02:14 +0000
commit5a4121a80041eb194857d9ca77e77bc5298398c1 (patch)
treed9a93373e4dbd531598b6014df0187a104d9e0fc /Makefile.inc1
parent7cd84b56411ceebd98e5972320100c3e9b206956 (diff)
downloadsrc-5a4121a80041eb194857d9ca77e77bc5298398c1.tar.gz
src-5a4121a80041eb194857d9ca77e77bc5298398c1.zip
kernel-toolchain: Skip world _obj and _cleanobj phases.
There's no good reason to treewalk the entire tree removing old OBJDIRS and creating new ones when 'includes', 'libraries', and 'everything' are all skipped. The only shared directory in the existing toolchain target and world is build-tools. So handle cleaning in it directly if needed only for the directories it wants to build. The extra _obj/_cleanobj walks came in the initial kernel-toolchain addition in r128189. MFC after: 2 weeks Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=325244
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc111
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 53bff0771b20..17163a22fbbd 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -996,7 +996,7 @@ buildenv: .PHONY
TOOLCHAIN_TGTS= ${WMAKE_TGTS:Neverything:Nbuild${libcompat}}
toolchain: ${TOOLCHAIN_TGTS} .PHONY
-kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries} .PHONY
+kernel-toolchain: ${TOOLCHAIN_TGTS:N_obj:N_cleanobj:N_includes:N_libraries} .PHONY
#
# installcheck
@@ -1974,6 +1974,12 @@ _rescue=rescue/rescue
_tcsh=bin/csh
.endif
+# kernel-toolchain skips _cleanobj, so handle cleaning up previous
+# build-tools directories if needed.
+.if !defined(NO_CLEAN) && make(kernel-toolchain)
+_bt_clean= ${CLEANDIR}
+.endif
+
.for _tool in \
${_tcsh} \
bin/sh \
@@ -1989,8 +1995,9 @@ _tcsh=bin/csh
usr.bin/vi/catalog \
${_gcc_tools}
build-tools_${_tool}: .PHONY
- ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
+ ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \
cd ${.CURDIR}/${_tool}; \
+ if [ -n "${_bt_clean}" ]; then ${MAKE} DIRPRFX=${_tool}/ ${_bt_clean}; fi; \
if [ -z "${NO_OBJ}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \
${MAKE} DIRPRFX=${_tool}/ build-tools
build-tools: build-tools_${_tool}