2 # Makefile.xtras - non-build targets
4 # Resist the urge to fill this with miscellaneous junk
6 # We are not building here (shouldn't be), so no meta mode.
16 MAKE_MACHINE_CMD= mk --machine <machine>
20 MAKE_MACHINE_CMD= env MACHINE=<machine> ${.MAKE:T}
24 @echo "ERROR: there is no supported default target."; \
25 echo "Try '${MAKE_CMD} help'"
28 .if make(show-valid-targets)
35 BUILD_TARGETS_${MACHINE:tu} != cd ${_here} && \
36 find . \( ${${.MAKE.DEPENDFILE:T} ${.MAKE.DEPENDFILE_PREFIX}:L:O:u:@m@-name $m -o@:tW:S,-o$,,} \) | \
37 sed 's,/Makefile.*,,;s,^./,,' | sort -u
39 .for _machine in ${ALL_MACHINE_LIST}
40 _targets_${_machine} != cd ${_here} && \
41 find . \( ${.MAKE.DEPENDFILE_PREFERENCE:T:M*${MACHINE}*:S,${MACHINE},${_machine},g:O:u:@m@-name $m -o@:tW:S,-o$,,} \) | \
42 sed 's,/Makefile.*,,;s,^./,,' | sort -u
43 BUILD_TARGETS_${_machine:tu} += ${_targets_${_machine}}
47 .for _machine in ${ALL_MACHINE_LIST:O}
48 .if !empty(BUILD_TARGETS_${_machine:tu})
49 @echo "Build targets for ${_machine} (leave out the ${DIRDEPS_TARGETS_DIRS:S,${_here:T},,:S,^/,,:S,$,/,}):"
50 @echo -e "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" | sed -e 's,^, ,'
54 @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" | sed -e 's,^, ,'
60 echo "You can see the targets which are valid for a given machine"; \
61 echo "by running '${MAKE_MACHINE_CMD} show-valid-targets'"; \
62 echo "For other information, read: ${HELP_DOCS:@d@${.newline}$d@}"; \
66 @echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}."
72 .for t in ${_TARGETS:Nlove}
74 $t: not-valid-target show-help