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