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
This commit is contained in:
Bryan Drewery 2017-10-31 19:02:14 +00:00
parent 7cd84b5641
commit 5a4121a800
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=325244

View File

@ -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}