5 .PATH: ${LDRSRC} ${BOOTSRC}/libsa
9 SRCS+= boot.c commands.c console.c devopen.c interp.c
10 SRCS+= interp_backslash.c interp_parse.c ls.c misc.c
13 .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
14 SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
15 SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
16 .elif ${MACHINE} == "pc98"
17 SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
18 .elif ${MACHINE_CPUARCH} == "aarch64"
19 SRCS+= load_elf64.c reloc_elf64.c
20 .elif ${MACHINE_CPUARCH} == "arm"
21 SRCS+= load_elf32.c reloc_elf32.c
22 .elif ${MACHINE_CPUARCH} == "powerpc"
23 SRCS+= load_elf32.c reloc_elf32.c
24 SRCS+= load_elf64.c reloc_elf64.c
26 .elif ${MACHINE_CPUARCH} == "sparc64"
27 SRCS+= load_elf64.c reloc_elf64.c
29 .elif ${MACHINE_ARCH:Mmips64*} != ""
30 SRCS+= load_elf64.c reloc_elf64.c
32 .elif ${MACHINE} == "mips"
33 SRCS+= load_elf32.c reloc_elf32.c
37 .if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
41 .if ${LOADER_NET_SUPPORT:Uno} == "yes"
45 .if defined(HAVE_BCACHE)
49 .if defined(MD_IMAGE_SIZE)
50 CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE}
56 # Machine-independant ISA PnP
57 .if defined(HAVE_ISABUS)
65 .if ${MK_FORTH} != "no"
67 .include "${BOOTSRC}/ficl.mk"
69 SRCS+= interp_simple.c
72 .if defined(BOOT_PROMPT_123)
73 CFLAGS+= -DBOOT_PROMPT_123
76 .if defined(LOADER_INSTALL_SUPPORT)
81 .if ${LOADER_CD9660_SUPPORT:Uno} == "yes"
82 CFLAGS+= -DLOADER_CD9660_SUPPORT
84 .if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes"
85 CFLAGS+= -DLOADER_EXT2FS_SUPPORT
87 .if ${LOADER_MSDOS_SUPPORT:Uno} == "yes"
88 CFLAGS+= -DLOADER_MSDOS_SUPPORT
90 .if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes"
91 CFLAGS+= -DLOADER_NANDFS_SUPPORT
93 .if ${LOADER_UFS_SUPPORT:Uyes} == "yes"
94 CFLAGS+= -DLOADER_UFS_SUPPORT
98 .if ${LOADER_GZIP_SUPPORT:Uno} == "yes"
99 CFLAGS+= -DLOADER_GZIP_SUPPORT
101 .if ${LOADER_BZIP2_SUPPORT:Uno} == "yes"
102 CFLAGS+= -DLOADER_BZIP2_SUPPORT
105 # Network related things
106 .if ${LOADER_NET_SUPPORT:Uno} == "yes"
107 CFLAGS+= -DLOADER_NET_SUPPORT
109 .if ${LOADER_NFS_SUPPORT:Uno} == "yes"
110 CFLAGS+= -DLOADER_NFS_SUPPORT
112 .if ${LOADER_TFTP_SUPPORT:Uno} == "yes"
113 CFLAGS+= -DLOADER_TFTP_SUPPORT
117 .if ${LOADER_GPT_SUPPORT:Uyes} == "yes"
118 CFLAGS+= -DLOADER_GPT_SUPPORT
120 .if ${LOADER_MBR_SUPPORT:Uyes} == "yes"
121 CFLAGS+= -DLOADER_MBR_SUPPORT
124 .if defined(HAVE_ZFS)
125 CFLAGS+= -DLOADER_ZFS_SUPPORT
127 CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
129 .if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1
130 # Have to override to use 32-bit version of zfs library...
131 # kinda lame to select that there XXX
132 LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a
134 LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
138 LIBFICL= ${BOOTOBJ}/ficl/libficl.a
139 .if ${MACHINE} == "i386"
140 LIBFICL32= ${LIBFICL}
142 LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a
144 .if ${MK_FORTH} != no
145 LDR_INTERP= ${LIBFICL}
146 LDR_INTERP32= ${LIBFICL32}
150 VERSION_FILE?= ${.CURDIR}/version
151 .if ${MK_REPRODUCIBLE_BUILD} != no
154 vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE}
155 sh ${LDRSRC}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \
158 .if !empty(HELP_FILES)
159 HELP_FILES+= ${LDRSRC}/help.common
161 CLEANFILES+= loader.help
164 loader.help: ${HELP_FILES}
165 cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET}