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 . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
37 sed 's,/Makefile.*,,;s,^./,,' | sort -u
39 .for _machine in ${all_machine_list}
40 _targets_${_machine} != cd ${_here} && \
41 find . \( -name Makefile.depend.${_machine} -o \
42 -name ${.MAKE.DEPENDFILE:T}.${_machine} \) | \
43 sed 's,/Makefile.*,,;s,^./,,' | sort -u
44 BUILD_TARGETS_${_machine:tu} += ${_targets_${_machine}}
48 .for _machine in ${all_machine_list:O}
49 .if !empty(BUILD_TARGETS_${_machine:tu})
50 @echo "Build targets for ${_machine} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
51 @echo -e "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" | sed -e 's,^, ,'
55 @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" | sed -e 's,^, ,'
61 echo "You can see the targets which are valid for a given machine"; \
62 echo "by running '${MAKE_MACHINE_CMD} show-valid-targets'"; \
63 echo "For other information, read: ${HELP_DOCS:@d@${.newline}$d@}"; \
67 @echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}."
73 .for t in ${_TARGETS:Nlove}
75 $t: not-valid-target show-help