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 . \( ${${.MAKE.DEPENDFILE:T} ${.MAKE.DEPENDFILE_PREFIX}:L:O:u:@m@-name $m -o@:tW:S,-o$,,} \) | \
38 sed 's,/Makefile.*,,;s,^./,,' | sort -u
40 .for _machine in ${ALL_MACHINE_LIST}
41 _targets_${_machine} != cd ${_here} && \
42 find . \( ${.MAKE.DEPENDFILE_PREFERENCE:T:M*${MACHINE}*:S,${MACHINE},${_machine},g:O:u:@m@-name $m -o@:tW:S,-o$,,} \) | \
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 ${DIRDEPS_TARGETS_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