xref: /freebsd/share/mk/local.sys.dirdeps.env.mk (revision c8e7f78a3d28ff6e6223ed136ada8e1e2f34965e)
1
2# For universe we want to potentially
3# build for multiple MACHINE_ARCH per MACHINE
4# so we need more than MACHINE in TARGET_SPEC
5TARGET_SPEC_VARS?= MACHINE MACHINE_ARCH
6
7# this is sufficient for most of the tree.
8.MAKE.DEPENDFILE_DEFAULT = ${.MAKE.DEPENDFILE_PREFIX}
9
10# but if we have a machine qualified file it should be used in preference
11.MAKE.DEPENDFILE_PREFERENCE = \
12	${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \
13	${.MAKE.DEPENDFILE_PREFIX}
14
15# some corner cases
16BOOT_MACHINE_DIR.amd64 = stand/i386
17
18.-include <site.sys.dirdeps.env.mk>
19
20ALL_MACHINE_LIST?= ${TARGET_MACHINE_LIST}
21
22.for m in ${ALL_MACHINE_LIST:O:u}
23BOOT_MACHINE_DIR.$m ?= stand/$m
24.endfor
25
26HOST_OBJTOP ?= ${OBJROOT}${HOST_TARGET}
27HOST_OBJTOP32 ?= ${OBJROOT}${HOST_TARGET32}
28
29.if ${.MAKE.LEVEL} == 0
30.if ${REQUESTED_MACHINE:U${MACHINE}} == "host"
31MACHINE= host
32.if ${TARGET_MACHINE:Uno} == ${HOST_TARGET}
33# not what we want
34TARGET_MACHINE= host
35.endif
36.elif ${REQUESTED_MACHINE:U${MACHINE}} == "host32"
37MACHINE= host32
38.endif
39.endif
40
41.if ${MACHINE:Nhost*} == ""
42MACHINE_ARCH= ${MACHINE_ARCH_${MACHINE}}
43.if ${MACHINE} == "host32"
44.MAKE.DEPENDFILE_PREFERENCE= \
45	${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX}.host32 \
46	${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX}.host \
47	${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX}
48.endif
49.endif
50
51
52.if ${.MAKE.LEVEL} == 0 || empty(PYTHON)
53PYTHON ?= /usr/local/bin/python
54.export PYTHON
55
56# _SKIP_BUILD is not 100% as it requires wrapping all 'all:' targets to avoid
57# building in MAKELEVEL0.  Just prohibit 'all' entirely in this case to avoid
58# problems.
59.if make(all)
60.error DIRDEPS_BUILD: Please run '${MAKE}' instead of '${MAKE} all'.
61.endif
62.endif
63
64.if ${.MAKE.OS} != "FreeBSD" || ${_HOST_OSREL:R} < ${OS_REVISION:R}
65# a pseudo option to indicate we need libegacy for host
66MK_host_egacy= yes
67.endif
68