xref: /freebsd/stand/Makefile (revision e9ac41698b2f322d55ccf9da50a3596edb2c1800)
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 ${MK_FDT} != "no"
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
69.endif
70.if ${_x} != "libsa"
71SUBDIR_DEPEND_${_x}+=	libsa
72SUBDIR_DEPEND_${_x}32+=	libsa32
73.endif
74.endfor
75
76# Remaining dependencies
77SUBDIR_DEPEND_forth+=	ficl
78SUBDIR_DEPEND_lua+=	liblua
79
80SUBDIR_DEPEND_efi+=	${INTERP_DEPENDS}
81SUBDIR_DEPEND_kboot+=	${INTERP_DEPENDS}
82.if ${MK_FDT} != "no"
83SUBDIR_DEPEND_efi+=	fdt
84SUBDIR_DEPEND_kboot+=	fdt
85.endif
86
87SUBDIR_DEPEND_uboot+=	${INTERP_DEPENDS}
88.if ${MK_FDT} != "no"
89SUBDIR_DEPEND_uboot+=	fdt
90.endif
91
92SUBDIR_PARALLEL=	yes
93
94.include <bsd.subdir.mk>
95
96# Simplified way to build-test the most important build combinations for the
97# loader.
98universe:
99	sh ${SRCTOP}/tools/boot/universe.sh
100