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 429e74797fSWarner Losh 43ac5f382aSKyle Evans.if defined(LIB32LIST) 44ac5f382aSKyle EvansLIB32DEPENDS= ${LIB32LIST:S/$/32/} 45ac5f382aSKyle Evans.endif 46ac5f382aSKyle Evans 47ca987d46SWarner Losh.if exists(${.CURDIR}/${MACHINE}/.) 48f86dd996SWarner LoshS.yes+= ${MACHINE} 49ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+= ${INTERP_DEPENDS} 50ac5f382aSKyle Evans.if ${MK_FDT} != "no" 51ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+= fdt 52ac5f382aSKyle Evans.endif 53ac5f382aSKyle Evans.if ${MK_LOADER_UBOOT} != "no" 54ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+= uboot 55ac5f382aSKyle Evans.endif 56ac5f382aSKyle Evans.if ${MK_LOADER_OFW} != "no" 57ac5f382aSKyle EvansSUBDIR_DEPEND_${MACHINE}+= libofw 58ac5f382aSKyle Evans.endif 59ca987d46SWarner Losh.endif 60ca987d46SWarner Losh 61f86dd996SWarner Losh# Build the actual subdir list from S.yes, adding in the 32-bit 62f86dd996SWarner Losh# variant if necessary. 63f86dd996SWarner Losh.for _x in ${S.yes} 64f86dd996SWarner LoshSUBDIR+=${_x} 65f86dd996SWarner Losh.if defined(LIB32LIST) && ${LIB32LIST:M${_x}} 66f86dd996SWarner LoshSUBDIR+=${_x}32 67*f0d5b1bdSAhmad KhalifaINTERP_DEPENDS+=${_x}32 68f86dd996SWarner Losh.endif 69ac5f382aSKyle Evans.if ${_x} != "libsa" 70ac5f382aSKyle EvansSUBDIR_DEPEND_${_x}+= libsa 71ac5f382aSKyle EvansSUBDIR_DEPEND_${_x}32+= libsa32 72ac5f382aSKyle Evans.endif 73f86dd996SWarner Losh.endfor 74f86dd996SWarner Losh 75ac5f382aSKyle Evans# Remaining dependencies 76ac5f382aSKyle EvansSUBDIR_DEPEND_forth+= ficl 77ac5f382aSKyle EvansSUBDIR_DEPEND_lua+= liblua 78ac5f382aSKyle Evans 797012461cSKyle EvansSUBDIR_DEPEND_efi+= ${INTERP_DEPENDS} 806497250fSWarner LoshSUBDIR_DEPEND_kboot+= ${INTERP_DEPENDS} 81e41367e3SKyle Evans.if ${MK_FDT} != "no" 82ac5f382aSKyle EvansSUBDIR_DEPEND_efi+= fdt 836497250fSWarner LoshSUBDIR_DEPEND_kboot+= fdt 84e41367e3SKyle Evans.endif 85ac5f382aSKyle Evans 869dc70af8SWarner LoshSUBDIR_DEPEND_uboot+= ${INTERP_DEPENDS} 879dc70af8SWarner Losh.if ${MK_FDT} != "no" 889dc70af8SWarner LoshSUBDIR_DEPEND_uboot+= fdt 899dc70af8SWarner Losh.endif 909dc70af8SWarner Losh 91ac5f382aSKyle EvansSUBDIR_PARALLEL= yes 92ac5f382aSKyle Evans 93ca987d46SWarner Losh.include <bsd.subdir.mk> 94206203f5SWarner Losh 95206203f5SWarner Losh# Simplified way to build-test the most important build combinations for the 96206203f5SWarner Losh# loader. 97206203f5SWarner Loshuniverse: 98206203f5SWarner Losh sh ${SRCTOP}/tools/boot/universe.sh 99