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