]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - targets/Makefile.xtras
opencrypto: Respect alignment constraints in xor_and_encrypt()
[FreeBSD/FreeBSD.git] / targets / Makefile.xtras
1 #
2 # Makefile.xtras - non-build targets
3
4 # Resist the urge to fill this with miscellaneous junk
5
6 # We are not building here (shouldn't be), so no meta mode.
7 .MAKE.MODE = normal
8
9 _here := ${_PARSEDIR}
10
11 .MAIN: no-default
12
13 .if !empty(SB_NAME)
14 # mk wrapper
15 MAKE_CMD= mk
16 MAKE_MACHINE_CMD= mk --machine <machine>
17 .else
18 # not using 'mk'
19 MAKE_CMD= ${.MAKE:T}
20 MAKE_MACHINE_CMD= env MACHINE=<machine> ${.MAKE:T}
21 .endif
22
23 no-default:
24         @echo "ERROR: there is no supported default target."; \
25         echo "Try '${MAKE_CMD} help'"
26
27
28 .if make(show-valid-targets)
29 OTHER_TARGETS = \
30         destroy \
31         destroy-arch \
32         destroy-host \
33         destroy-stage \
34
35 BUILD_TARGETS_${MACHINE:tu} != cd ${_here} && \
36         find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
37         sed 's,/Makefile.*,,;s,^./,,' | sort -u
38
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}}
45 .endfor
46
47 show-valid-targets:
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,^,  ,'
52         @echo
53 .endif
54 .endfor
55         @echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" | sed -e 's,^,  ,'
56 .endif
57
58 help: show-help
59 show-help:
60         @echo; \
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@}"; \
64         echo
65
66 not-valid-target:
67         @echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}."
68
69 .if make(destroy*)
70 .include <bsd.obj.mk>
71 .endif
72
73 .for t in ${_TARGETS:Nlove}
74 .if !target($t)
75 $t: not-valid-target show-help
76 .endif
77 .endfor