xref: /freebsd/stand/Makefile (revision d0b2dbfa)
1ca987d46SWarner Losh
2ca987d46SWarner Losh.include <src.opts.mk>
3ca987d46SWarner Losh
4f86dd996SWarner Losh# For amd64 we have to build 32 and 64 bit versions of things. For
5f86dd996SWarner Losh# others we don't. LIB32LIST is a list of libraries, which if
6f86dd996SWarner Losh# included, need to be built 32-bit as well.
7f86dd996SWarner Losh.if ${MACHINE_ARCH} == "amd64"
88b4c3a03SKyle EvansLIB32LIST=libsa
98b4c3a03SKyle Evans.if ${MK_FORTH} != "no"
108b4c3a03SKyle EvansLIB32LIST+=		ficl
118b4c3a03SKyle Evans.endif
128b4c3a03SKyle Evans.if ${MK_LOADER_LUA} != "no"
138b4c3a03SKyle EvansLIB32LIST+=		liblua
148b4c3a03SKyle Evans.endif
157cafeaa1SWarner Losh.endif
16ca987d46SWarner Losh
17f86dd996SWarner LoshS.yes+=			libsa
18f86dd996SWarner Losh
19ac5f382aSKyle EvansS.${MK_LOADER_OFW}+=	libofw
20ac5f382aSKyle EvansS.${MK_FDT}+=		fdt
21ac5f382aSKyle Evans
22f86dd996SWarner LoshS.${MK_FORTH}+=		ficl
23f86dd996SWarner LoshS.${MK_FORTH}+=		forth
24f86dd996SWarner LoshS.${MK_LOADER_LUA}+=	liblua
25f86dd996SWarner LoshS.${MK_LOADER_LUA}+=	lua
26f86dd996SWarner LoshS.yes+=			defaults
273630506bSToomas SoomeS.yes+=			fonts
283630506bSToomas SoomeS.yes+=			images
29f86dd996SWarner LoshS.yes+=			man
30f86dd996SWarner Losh
31ac5f382aSKyle Evans.if ${MK_FORTH} != "no"
32ac5f382aSKyle EvansINTERP_DEPENDS+=	forth
33ac5f382aSKyle Evans.endif
34ac5f382aSKyle Evans.if ${MK_LOADER_LUA} != "no"
35ac5f382aSKyle EvansINTERP_DEPENDS+=	lua
36ac5f382aSKyle Evans.endif
37ac5f382aSKyle Evans
38ca987d46SWarner Losh.include <bsd.arch.inc.mk>
39ca987d46SWarner Losh
40f86dd996SWarner LoshS.${MK_EFI}+=		efi
4143661996SWarner Losh.if ${MK_FDT} != "no"
4243661996SWarner LoshS.${MK_LOADER_KBOOT}+=	kboot
4343661996SWarner Losh.endif
44f86dd996SWarner LoshS.${MK_LOADER_UBOOT}+=	uboot
459e74797fSWarner Losh
46ac5f382aSKyle Evans.if defined(LIB32LIST)
47ac5f382aSKyle EvansLIB32DEPENDS=	${LIB32LIST:S/$/32/}
48ac5f382aSKyle Evans.endif
49ac5f382aSKyle Evans
50ca987d46SWarner Losh.if exists(${.CURDIR}/${MACHINE}/.)
51f86dd996SWarner LoshS.yes+=         ${MACHINE}
52ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+=	${INTERP_DEPENDS}
53ac5f382aSKyle Evans.if ${MK_FDT} != "no"
54ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+=	fdt
55ac5f382aSKyle Evans.endif
56ac5f382aSKyle Evans.if ${MK_LOADER_UBOOT} != "no"
57ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+=	uboot
58ac5f382aSKyle Evans.endif
59ac5f382aSKyle Evans.if ${MK_LOADER_OFW} != "no"
60ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+=	libofw
61ac5f382aSKyle Evans.endif
62ca987d46SWarner Losh.endif
63ca987d46SWarner Losh
64f86dd996SWarner Losh# Build the actual subdir list from S.yes, adding in the 32-bit
65f86dd996SWarner Losh# variant if necessary.
66f86dd996SWarner Losh.for _x in ${S.yes}
67f86dd996SWarner LoshSUBDIR+=${_x}
68f86dd996SWarner Losh.if defined(LIB32LIST) && ${LIB32LIST:M${_x}}
69f86dd996SWarner LoshSUBDIR+=${_x}32
70f86dd996SWarner Losh.endif
71ac5f382aSKyle Evans.if ${_x} != "libsa"
72ac5f382aSKyle EvansSUBDIR_DEPEND_${_x}+=	libsa
73ac5f382aSKyle EvansSUBDIR_DEPEND_${_x}32+=	libsa32
74ac5f382aSKyle Evans.endif
75f86dd996SWarner Losh.endfor
76f86dd996SWarner Losh
77ac5f382aSKyle Evans# Remaining dependencies
78ac5f382aSKyle EvansSUBDIR_DEPEND_forth+=	ficl
79ac5f382aSKyle EvansSUBDIR_DEPEND_lua+=	liblua
80ac5f382aSKyle Evans
817012461cSKyle EvansSUBDIR_DEPEND_efi+=	${INTERP_DEPENDS}
826497250fSWarner LoshSUBDIR_DEPEND_kboot+=	${INTERP_DEPENDS}
83e41367e3SKyle Evans.if ${MK_FDT} != "no"
84ac5f382aSKyle EvansSUBDIR_DEPEND_efi+=	fdt
856497250fSWarner LoshSUBDIR_DEPEND_kboot+=	fdt
86e41367e3SKyle Evans.endif
87ac5f382aSKyle Evans
889dc70af8SWarner LoshSUBDIR_DEPEND_uboot+=	${INTERP_DEPENDS}
899dc70af8SWarner Losh.if ${MK_FDT} != "no"
909dc70af8SWarner LoshSUBDIR_DEPEND_uboot+=	fdt
919dc70af8SWarner Losh.endif
929dc70af8SWarner Losh
93ac5f382aSKyle EvansSUBDIR_PARALLEL=	yes
94ac5f382aSKyle Evans
95ca987d46SWarner Losh.include <bsd.subdir.mk>
96206203f5SWarner Losh
97206203f5SWarner Losh# Simplified way to build-test the most important build combinations for the
98206203f5SWarner Losh# loader.
99206203f5SWarner Loshuniverse:
100206203f5SWarner Losh	sh ${SRCTOP}/tools/boot/universe.sh
101