xref: /freebsd/targets/Makefile.xtras (revision 98e0ffaefb0f241cda3a72395d3be04192ae0d47)
1# $FreeBSD$
2#
3# Makefile.xtras - non-build targets
4
5# Resist the urge to fill this with miscellaneous junk
6
7# We are not building here (shouldn't be), so no meta mode.
8.MAKE.MODE = normal
9
10_here := ${_PARSEDIR}
11
12.MAIN: no-default
13
14no-default:
15	@echo "ERROR: there is no supported default target."; \
16	echo "Try 'mk help'"
17
18
19.if make(show-valid-targets)
20OTHER_TARGETS = \
21	destroy \
22
23BUILD_TARGETS != cd ${_here} && \
24	find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
25	sed 's,/Makefile.*,,;s,^./,,' | sort -u
26
27show-valid-targets:
28	@echo "Build targets for ${MACHINE}:"; echo "${BUILD_TARGETS:ts\n}"
29	@echo; echo "Other targets:"; echo "${OTHER_TARGETS:ts\n}"
30.endif
31
32help: show-help
33show-help:
34	@echo; \
35	echo "You can see the targets which are valid for a given machine"; \
36	echo "by running 'mk --machine <machine> show-valid-targets'"; \
37	echo "For other information, read: ${HELP_DOCS:@d@${.newline}$d@}"; \
38	echo
39
40not-valid-target:
41	@echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}."
42
43
44.for t in ${_TARGETS:Nlove}
45.if !target($t)
46$t: not-valid-target show-help
47.endif
48.endfor
49