5 .if !defined(__BOOT_DEFS_MK__)
6 __BOOT_DEFS_MK__=${MFILE}
8 BOOTSRC= ${SRCTOP}/stand
10 EFIINC= ${EFISRC}/include
11 EFIINCMD= ${EFIINC}/${MACHINE}
12 FDTSRC= ${BOOTSRC}/fdt
13 FICLSRC= ${BOOTSRC}/ficl
14 LDRSRC= ${BOOTSRC}/common
15 SASRC= ${BOOTSRC}/libsa
17 UBOOTSRC= ${BOOTSRC}/uboot
18 ZFSSRC= ${BOOTSRC}/zfs
20 BOOTOBJ= ${OBJTOP}/stand
22 # BINDIR is where we install
25 # NB: The makefiles depend on these being empty when we don't build forth.
26 .if ${MK_FORTH} != "no"
27 LIBFICL= ${BOOTOBJ}/ficl/libficl.a
28 .if ${MACHINE} == "i386"
31 LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a
34 LIBSA= ${BOOTOBJ}/libsa/libsa.a
35 .if ${MACHINE} == "i386"
38 LIBSA32= ${BOOTOBJ}/libsa32/libsa32.a
44 .if ${LOADER_CD9660_SUPPORT:Uno} == "yes"
45 CFLAGS+= -DLOADER_CD9660_SUPPORT
47 .if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes"
48 CFLAGS+= -DLOADER_EXT2FS_SUPPORT
50 .if ${LOADER_MSDOS_SUPPORT:Uno} == "yes"
51 CFLAGS+= -DLOADER_MSDOS_SUPPORT
53 .if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes"
54 CFLAGS+= -DLOADER_NANDFS_SUPPORT
56 .if ${LOADER_UFS_SUPPORT:Uyes} == "yes"
57 CFLAGS+= -DLOADER_UFS_SUPPORT
61 .if ${LOADER_GZIP_SUPPORT:Uno} == "yes"
62 CFLAGS+= -DLOADER_GZIP_SUPPORT
64 .if ${LOADER_BZIP2_SUPPORT:Uno} == "yes"
65 CFLAGS+= -DLOADER_BZIP2_SUPPORT
68 # Network related things
69 .if ${LOADER_NET_SUPPORT:Uno} == "yes"
70 CFLAGS+= -DLOADER_NET_SUPPORT
72 .if ${LOADER_NFS_SUPPORT:Uno} == "yes"
73 CFLAGS+= -DLOADER_NFS_SUPPORT
75 .if ${LOADER_TFTP_SUPPORT:Uno} == "yes"
76 CFLAGS+= -DLOADER_TFTP_SUPPORT
79 # Disk and partition support
80 .if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
81 CFLAGS+= -DLOADER_DISK_SUPPORT
82 .if ${LOADER_GPT_SUPPORT:Uyes} == "yes"
83 CFLAGS+= -DLOADER_GPT_SUPPORT
85 .if ${LOADER_MBR_SUPPORT:Uyes} == "yes"
86 CFLAGS+= -DLOADER_MBR_SUPPORT
89 # GELI Support, with backward compat hooks
90 .if defined(HAVE_GELI)
91 .if defined(LOADER_NO_GELI_SUPPORT)
93 .warning "Please move from LOADER_NO_GELI_SUPPORT to WITHOUT_LOADER_GELI"
95 .if defined(LOADER_GELI_SUPPORT)
97 .warning "Please move from LOADER_GELI_SUPPORT to WITH_LOADER_GELI"
99 .if ${MK_LOADER_GELI} == "yes"
100 CFLAGS+= -DLOADER_GELI_SUPPORT
101 CFLAGS+= -I${BOOTSRC}/geli
102 LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a
109 # All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc
111 .if ${MACHINE_ARCH} == "powerpc64"
112 CFLAGS+= -m32 -mcpu=powerpc
115 # For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is
116 # build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here
117 # and activate it when DO32 is explicitly defined to be 1.
118 .if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1
119 CFLAGS+= -m32 -mcpu=i386
120 # LD_FLAGS is passed directly to ${LD}, not via ${CC}:
121 LD_FLAGS+= -m elf_i386_fbsd
125 # Make sure we use the machine link we're about to create
129 .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64"
130 _ILINKS+=${MACHINE_CPUARCH}
132 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
135 CLEANFILES+=${_ILINKS}
139 beforedepend: ${_ILINKS}
140 beforebuild: ${_ILINKS}
142 # Ensure that the links exist without depending on it when it exists which
143 # causes all the modules to be rebuilt when the directory pointed to changes.
144 .for _link in ${_ILINKS}
145 .if !exists(${.OBJDIR}/${_link})
153 @case ${.TARGET} in \
155 if [ ${DO32:U0} -eq 0 ]; then \
156 path=${SYSDIR}/${MACHINE}/include ; \
158 path=${SYSDIR}/${MACHINE:C/amd64/i386/}/include ; \
161 path=${SYSDIR}/${.TARGET:T}/include ;; \
163 path=`(cd $$path && /bin/pwd)` ; \
164 ${ECHO} ${.TARGET:T} "->" $$path ; \
165 ln -fhs $$path ${.TARGET:T}
167 # For loader implementations, we generate a loader.help file. This can be suppressed by
168 # setting HELP_FILES to nothing.
169 HELP_FILES= ${LDRSRC}/help.common
171 .endif # __BOOT_DEFS_MK__