xref: /freebsd/share/mk/local.meta.sys.env.mk (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
1# $FreeBSD$
2
3# local configuration specific to meta mode
4# before we process TARGET_SPEC
5# we assume that MK_DIRDEPS_BUILD=yes
6
7# from src/Makefile (for universe)
8TARGET_ARCHES_arm?=     arm armv6 armv7
9TARGET_ARCHES_arm64?=   aarch64
10TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpc64le powerpcspe
11TARGET_ARCHES_riscv?=   riscv64
12
13# some corner cases
14BOOT_MACHINE_DIR.amd64 = boot/i386
15MACHINE_ARCH.host = ${_HOST_ARCH}
16
17# the list of machines we support
18ALL_MACHINE_LIST?= amd64 arm arm64 i386 powerpc riscv
19
20.-include <site.meta.sys.env.mk>
21
22.for m in ${ALL_MACHINE_LIST:O:u}
23MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m}
24MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]}
25BOOT_MACHINE_DIR.$m ?= boot/$m
26.endfor
27
28.if empty(MACHINE_ARCH)
29.if !empty(TARGET_ARCH)
30MACHINE_ARCH= ${TARGET_ARCH}
31.else
32MACHINE_ARCH= ${MACHINE_ARCH.${MACHINE}}
33.endif
34.endif
35MACHINE_ARCH?= ${MACHINE_ARCH.${MACHINE}}
36MACHINE_ARCH:= ${MACHINE_ARCH}
37
38HOST_OBJTOP ?= ${OBJROOT}${HOST_TARGET}
39
40.if ${REQUESTED_MACHINE:U${MACHINE}} == "host"
41MACHINE= host
42.if ${TARGET_MACHINE:Uno} == ${HOST_TARGET}
43# not what we want
44TARGET_MACHINE= host
45.endif
46.endif
47.if ${MACHINE} == "host"
48OBJTOP := ${HOST_OBJTOP}
49MACHINE_ARCH= ${MACHINE_ARCH.${MACHINE}}
50.endif
51
52.if ${.MAKE.LEVEL} == 0 || empty(PYTHON)
53PYTHON ?= /usr/local/bin/python
54.export PYTHON
55# _SKIP_BUILD is not 100% as it requires wrapping all 'all:' targets to avoid
56# building in MAKELEVEL0.  Just prohibit 'all' entirely in this case to avoid
57# problems.
58.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL} == 0
59.MAIN: dirdeps
60.if make(all)
61.error DIRDEPS_BUILD: Please run '${MAKE}' instead of '${MAKE} all'.
62.endif
63.endif
64.endif
65
66.if !defined(NO_META_MISSING)
67META_MODE+=    missing-meta=yes
68.endif
69# silent will hide command output if a .meta file is created.
70.if !defined(NO_SILENT)
71META_MODE+=    silent=yes
72.endif
73.if empty(META_MODE:Mnofilemon)
74META_MODE+=	missing-filemon=yes
75.endif
76
77.if make(showconfig)
78# this does not need/want filemon
79UPDATE_DEPENDFILE= NO
80.endif
81
82.if ${MK_DIRDEPS_BUILD} == "yes"
83.if ${.MAKE.OS} != "FreeBSD" || ${_HOST_OSREL:R} < ${OS_REVISION:R}
84# a pseudo option to indicate we need libegacy for host
85MK_host_egacy= yes
86.endif
87.endif
88