Makefile.xtras: fix show-valid-targets

Use ALL_MACHINE_LIST and leverage .MAKE.DEPENDFILE_PREFERENCE
This commit is contained in:
Simon J. Gerraty 2023-04-19 18:59:53 -07:00
parent 64a67b7266
commit 061e8e6ba6

View file

@ -34,21 +34,20 @@ OTHER_TARGETS = \
destroy-stage \
BUILD_TARGETS_${MACHINE:tu} != cd ${_here} && \
find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
find . \( ${${.MAKE.DEPENDFILE:T} ${.MAKE.DEPENDFILE_PREFIX}:L:O:u:@m@-name $m -o@:tW:S,-o$,,} \) | \
sed 's,/Makefile.*,,;s,^./,,' | sort -u
.for _machine in ${all_machine_list}
.for _machine in ${ALL_MACHINE_LIST}
_targets_${_machine} != cd ${_here} && \
find . \( -name Makefile.depend.${_machine} -o \
-name ${.MAKE.DEPENDFILE:T}.${_machine} \) | \
find . \( ${.MAKE.DEPENDFILE_PREFERENCE:T:M*${MACHINE}*:S,${MACHINE},${_machine},g:O:u:@m@-name $m -o@:tW:S,-o$,,} \) | \
sed 's,/Makefile.*,,;s,^./,,' | sort -u
BUILD_TARGETS_${_machine:tu} += ${_targets_${_machine}}
.endfor
show-valid-targets:
.for _machine in ${all_machine_list:O}
.for _machine in ${ALL_MACHINE_LIST:O}
.if !empty(BUILD_TARGETS_${_machine:tu})
@echo "Build targets for ${_machine} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
@echo "Build targets for ${_machine} (leave out the ${DIRDEPS_TARGETS_DIRS:S,${_here:T},,:S,^/,,:S,$,/,}):"
@echo -e "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" | sed -e 's,^, ,'
@echo
.endif