3 # Makefile.xtras - non-build targets
5 # Resist the urge to fill this with miscellaneous junk
7 # We are not building here (shouldn't be), so no meta mode.
17 MAKE_MACHINE_CMD= mk --machine <machine>
21 MAKE_MACHINE_CMD= env MACHINE=<machine> ${.MAKE:T}
25 @echo "ERROR: there is no supported default target."; \
26 echo "Try '${MAKE_CMD} help'"
29 .if make(show-valid-targets)
36 BUILD_TARGETS_${MACHINE:tu} != cd ${_here} && \
37 find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
38 sed 's,/Makefile.*,,;s,^./,,' | sort -u
40 .for _machine in ${all_machine_list}
41 _targets_${_machine} != cd ${_here} && \
42 find . \( -name Makefile.depend.${_machine} -o \
43 -name ${.MAKE.DEPENDFILE:T}.${_machine} \) | \
44 sed 's,/Makefile.*,,;s,^./,,' | sort -u
45 BUILD_TARGETS_${_machine:tu} += ${_targets_${_machine}}
49 .for _machine in ${all_machine_list:O}
50 .if !empty(BUILD_TARGETS_${_machine:tu})
51 @echo "Build targets for ${_machine} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
52 @echo -e "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" | sed -e 's,^, ,'
56 @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" | sed -e 's,^, ,'
62 echo "You can see the targets which are valid for a given machine"; \
63 echo "by running '${MAKE_MACHINE_CMD} show-valid-targets'"; \
64 echo "For other information, read: ${HELP_DOCS:@d@${.newline}$d@}"; \
68 @echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}."
74 .for t in ${_TARGETS:Nlove}
76 $t: not-valid-target show-help