xref: /freebsd/stand/Makefile (revision 3750ccefb8629a08890bfbae894dd6bc6a7483b4)
1.include <src.opts.mk>
2
3# For amd64 we have to build 32 and 64 bit versions of things. For
4# others we don't. LIB32LIST is a list of libraries, which if
5# included, need to be built 32-bit as well.
6.if ${MACHINE_ARCH} == "amd64"
7LIB32LIST=libsa
8.if ${MK_FORTH} != "no"
9LIB32LIST+=		ficl
10.endif
11.if ${MK_LOADER_LUA} != "no"
12LIB32LIST+=		liblua
13.endif
14.endif
15
16S.yes+=			libsa
17
18S.${MK_LOADER_OFW}+=	libofw
19S.${MK_FDT}+=		fdt
20
21S.${MK_FORTH}+=		ficl
22S.${MK_FORTH}+=		forth
23S.${MK_LOADER_LUA}+=	liblua
24S.${MK_LOADER_LUA}+=	lua
25S.yes+=			defaults
26S.yes+=			fonts
27S.yes+=			images
28S.yes+=			man
29
30.if ${MK_FORTH} != "no"
31INTERP_DEPENDS+=	forth
32.endif
33.if ${MK_LOADER_LUA} != "no"
34INTERP_DEPENDS+=	lua
35.endif
36
37.include <bsd.arch.inc.mk>
38
39S.${MK_EFI}+=		efi
40.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "powerpc64"
41S.${MK_LOADER_KBOOT}+=	kboot
42.endif
43S.${MK_LOADER_UBOOT}+=	uboot
44
45.if defined(LIB32LIST)
46LIB32DEPENDS=	${LIB32LIST:S/$/32/}
47.endif
48
49.if exists(${.CURDIR}/${MACHINE}/.)
50S.yes+=         ${MACHINE}
51SUBDIR_DEPEND_${MACHINE}+=	${INTERP_DEPENDS}
52.if ${MK_FDT} != "no"
53SUBDIR_DEPEND_${MACHINE}+=	fdt
54.endif
55.if ${MK_LOADER_UBOOT} != "no"
56SUBDIR_DEPEND_${MACHINE}+=	uboot
57.endif
58.if ${MK_LOADER_OFW} != "no"
59SUBDIR_DEPEND_${MACHINE}+=	libofw
60.endif
61.endif
62
63# Build the actual subdir list from S.yes, adding in the 32-bit
64# variant if necessary.
65.for _x in ${S.yes}
66SUBDIR+=${_x}
67.if defined(LIB32LIST) && ${LIB32LIST:M${_x}}
68SUBDIR+=${_x}32
69INTERP_DEPENDS+=${_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