xref: /freebsd/stand/Makefile (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1
2.include <src.opts.mk>
3
4# For amd64 we have to build 32 and 64 bit versions of things. For
5# others we don't. LIB32LIST is a list of libraries, which if
6# included, need to be built 32-bit as well.
7.if ${MACHINE_ARCH} == "amd64"
8LIB32LIST=libsa
9.if ${MK_FORTH} != "no"
10LIB32LIST+=		ficl
11.endif
12.if ${MK_LOADER_LUA} != "no"
13LIB32LIST+=		liblua
14.endif
15.endif
16
17S.yes+=			libsa
18
19S.${MK_LOADER_OFW}+=	libofw
20S.${MK_FDT}+=		fdt
21
22S.${MK_FORTH}+=		ficl
23S.${MK_FORTH}+=		forth
24S.${MK_LOADER_LUA}+=	liblua
25S.${MK_LOADER_LUA}+=	lua
26S.yes+=			defaults
27S.yes+=			fonts
28S.yes+=			images
29S.yes+=			man
30
31.if ${MK_FORTH} != "no"
32INTERP_DEPENDS+=	forth
33.endif
34.if ${MK_LOADER_LUA} != "no"
35INTERP_DEPENDS+=	lua
36.endif
37
38.include <bsd.arch.inc.mk>
39
40S.${MK_EFI}+=		efi
41.if ${MK_FDT} != "no"
42S.${MK_LOADER_KBOOT}+=	kboot
43.endif
44S.${MK_LOADER_UBOOT}+=	uboot
45
46.if defined(LIB32LIST)
47LIB32DEPENDS=	${LIB32LIST:S/$/32/}
48.endif
49
50.if exists(${.CURDIR}/${MACHINE}/.)
51S.yes+=         ${MACHINE}
52SUBDIR_DEPEND_${MACHINE}+=	${INTERP_DEPENDS}
53.if ${MK_FDT} != "no"
54SUBDIR_DEPEND_${MACHINE}+=	fdt
55.endif
56.if ${MK_LOADER_UBOOT} != "no"
57SUBDIR_DEPEND_${MACHINE}+=	uboot
58.endif
59.if ${MK_LOADER_OFW} != "no"
60SUBDIR_DEPEND_${MACHINE}+=	libofw
61.endif
62.endif
63
64# Build the actual subdir list from S.yes, adding in the 32-bit
65# variant if necessary.
66.for _x in ${S.yes}
67SUBDIR+=${_x}
68.if defined(LIB32LIST) && ${LIB32LIST:M${_x}}
69SUBDIR+=${_x}32
70.endif
71.if ${_x} != "libsa"
72SUBDIR_DEPEND_${_x}+=	libsa
73SUBDIR_DEPEND_${_x}32+=	libsa32
74.endif
75.endfor
76
77# Remaining dependencies
78SUBDIR_DEPEND_forth+=	ficl
79SUBDIR_DEPEND_lua+=	liblua
80
81SUBDIR_DEPEND_efi+=	${INTERP_DEPENDS}
82SUBDIR_DEPEND_kboot+=	${INTERP_DEPENDS}
83.if ${MK_FDT} != "no"
84SUBDIR_DEPEND_efi+=	fdt
85SUBDIR_DEPEND_kboot+=	fdt
86.endif
87
88SUBDIR_DEPEND_uboot+=	${INTERP_DEPENDS}
89.if ${MK_FDT} != "no"
90SUBDIR_DEPEND_uboot+=	fdt
91.endif
92
93SUBDIR_PARALLEL=	yes
94
95.include <bsd.subdir.mk>
96
97# Simplified way to build-test the most important build combinations for the
98# loader.
99universe:
100	sh ${SRCTOP}/tools/boot/universe.sh
101