summaryrefslogtreecommitdiffstats
path: root/targets/Makefile.xtras
blob: 57a04532812ce9b65e7de200837bc2373bd80910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# $FreeBSD$
#
# Makefile.xtras - non-build targets

# Resist the urge to fill this with miscellaneous junk

# We are not building here (shouldn't be), so no meta mode.
.MAKE.MODE = normal

_here := ${_PARSEDIR}

.MAIN: no-default

.if !empty(SB_NAME)
# mk wrapper
MAKE_CMD= mk
MAKE_MACHINE_CMD= mk --machine <machine>
.else
# not using 'mk'
MAKE_CMD= ${.MAKE:T}
MAKE_MACHINE_CMD= env MACHINE=<machine> ${.MAKE:T}
.endif

no-default:
	@echo "ERROR: there is no supported default target."; \
	echo "Try '${MAKE_CMD} help'"


.if make(show-valid-targets)
OTHER_TARGETS = \
	destroy \

BUILD_TARGETS != cd ${_here} && \
	find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
	sed 's,/Makefile.*,,;s,^./,,' | sort -u

show-valid-targets:
	@echo "Build targets for ${MACHINE} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
	@echo "${BUILD_TARGETS:ts\n}"
	@echo; echo "Other targets:"; echo "${OTHER_TARGETS:ts\n}"
.endif

help: show-help
show-help:
	@echo; \
	echo "You can see the targets which are valid for a given machine"; \
	echo "by running '${MAKE_MACHINE_CMD} show-valid-targets'"; \
	echo "For other information, read: ${HELP_DOCS:@d@${.newline}$d@}"; \
	echo

not-valid-target:
	@echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}."


.for t in ${_TARGETS:Nlove}
.if !target($t)
$t: not-valid-target show-help
.endif
.endfor
OpenPOWER on IntegriCloud