1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1998-08-21 03:17:42 +00:00
|
|
|
|
2017-10-16 03:59:38 +00:00
|
|
|
.include "defs.mk"
|
2017-10-16 03:59:28 +00:00
|
|
|
|
2017-10-22 22:50:08 +00:00
|
|
|
.PATH: ${LDRSRC} ${BOOTSRC}/libsa
|
2017-10-16 03:59:28 +00:00
|
|
|
|
2017-10-22 22:50:08 +00:00
|
|
|
CFLAGS+=-I${LDRSRC}
|
2017-10-12 14:56:54 +00:00
|
|
|
|
2012-08-05 12:15:15 +00:00
|
|
|
SRCS+= boot.c commands.c console.c devopen.c interp.c
|
2003-05-01 03:56:30 +00:00
|
|
|
SRCS+= interp_backslash.c interp_parse.c ls.c misc.c
|
2017-10-12 15:16:27 +00:00
|
|
|
SRCS+= module.c
|
1998-09-14 18:27:06 +00:00
|
|
|
|
2010-08-23 01:43:47 +00:00
|
|
|
.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
2004-10-24 12:32:41 +00:00
|
|
|
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
|
|
|
|
SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
|
2015-04-14 13:55:01 +00:00
|
|
|
.elif ${MACHINE_CPUARCH} == "aarch64"
|
|
|
|
SRCS+= load_elf64.c reloc_elf64.c
|
2010-08-25 16:23:50 +00:00
|
|
|
.elif ${MACHINE_CPUARCH} == "arm"
|
2004-08-28 23:03:05 +00:00
|
|
|
SRCS+= load_elf32.c reloc_elf32.c
|
2010-08-23 01:43:47 +00:00
|
|
|
.elif ${MACHINE_CPUARCH} == "powerpc"
|
2010-07-12 00:49:22 +00:00
|
|
|
SRCS+= load_elf32.c reloc_elf32.c
|
|
|
|
SRCS+= load_elf64.c reloc_elf64.c
|
2011-03-16 03:53:18 +00:00
|
|
|
.elif ${MACHINE_CPUARCH} == "sparc64"
|
2004-08-28 23:03:05 +00:00
|
|
|
SRCS+= load_elf64.c reloc_elf64.c
|
2016-10-31 15:33:58 +00:00
|
|
|
.elif ${MACHINE_ARCH:Mmips64*} != ""
|
2014-02-23 22:11:26 +00:00
|
|
|
SRCS+= load_elf64.c reloc_elf64.c
|
2016-03-04 05:36:53 +00:00
|
|
|
.elif ${MACHINE} == "mips"
|
2016-02-29 07:27:49 +00:00
|
|
|
SRCS+= load_elf32.c reloc_elf32.c
|
2003-05-01 03:56:30 +00:00
|
|
|
.endif
|
|
|
|
|
2017-10-16 03:59:52 +00:00
|
|
|
.if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
|
2012-08-05 12:15:15 +00:00
|
|
|
SRCS+= disk.c part.c
|
|
|
|
.endif
|
2017-10-16 03:59:52 +00:00
|
|
|
|
|
|
|
.if ${LOADER_NET_SUPPORT:Uno} == "yes"
|
|
|
|
SRCS+= dev_net.c
|
2017-03-28 06:39:54 +00:00
|
|
|
.endif
|
2012-08-05 12:15:15 +00:00
|
|
|
|
2006-11-02 00:26:45 +00:00
|
|
|
.if defined(HAVE_BCACHE)
|
|
|
|
SRCS+= bcache.c
|
|
|
|
.endif
|
|
|
|
|
2009-12-13 01:20:32 +00:00
|
|
|
.if defined(MD_IMAGE_SIZE)
|
|
|
|
CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE}
|
|
|
|
SRCS+= md.c
|
2017-10-17 19:11:29 +00:00
|
|
|
.else
|
|
|
|
CLEANFILES+= md.o
|
2009-12-13 01:20:32 +00:00
|
|
|
.endif
|
|
|
|
|
1998-09-14 18:27:06 +00:00
|
|
|
# Machine-independant ISA PnP
|
2004-02-07 11:05:10 +00:00
|
|
|
.if defined(HAVE_ISABUS)
|
1998-09-14 18:27:06 +00:00
|
|
|
SRCS+= isapnp.c
|
|
|
|
.endif
|
2004-02-07 11:05:10 +00:00
|
|
|
.if defined(HAVE_PNP)
|
1998-09-14 18:27:06 +00:00
|
|
|
SRCS+= pnp.c
|
|
|
|
.endif
|
1998-11-04 00:29:01 +00:00
|
|
|
|
|
|
|
# Forth interpreter
|
2017-10-16 03:59:44 +00:00
|
|
|
.if ${MK_FORTH} != "no"
|
1998-11-04 00:29:01 +00:00
|
|
|
SRCS+= interp_forth.c
|
2017-10-22 22:50:08 +00:00
|
|
|
.include "${BOOTSRC}/ficl.mk"
|
1998-11-04 00:29:01 +00:00
|
|
|
.endif
|
2000-05-19 08:52:16 +00:00
|
|
|
|
2009-11-12 01:30:17 +00:00
|
|
|
.if defined(BOOT_PROMPT_123)
|
|
|
|
CFLAGS+= -DBOOT_PROMPT_123
|
|
|
|
.endif
|
|
|
|
|
2014-08-06 00:36:04 +00:00
|
|
|
.if defined(LOADER_INSTALL_SUPPORT)
|
|
|
|
SRCS+= install.c
|
|
|
|
.endif
|
2016-12-19 14:40:59 +00:00
|
|
|
|
2017-12-16 21:33:21 +00:00
|
|
|
# Filesystem support
|
|
|
|
.if ${LOADER_CD9660_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_CD9660_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_EXT2FS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_MSDOS_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_MSDOS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_NANDFS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_UFS_SUPPORT:Uyes} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_UFS_SUPPORT
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Compression
|
|
|
|
.if ${LOADER_GZIP_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_GZIP_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_BZIP2_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_BZIP2_SUPPORT
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Network related things
|
|
|
|
.if ${LOADER_NET_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_NET_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_NFS_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_NFS_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_TFTP_SUPPORT:Uno} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_TFTP_SUPPORT
|
|
|
|
.endif
|
|
|
|
|
2017-12-29 18:08:35 +00:00
|
|
|
# Partition support
|
2017-12-16 21:33:21 +00:00
|
|
|
.if ${LOADER_GPT_SUPPORT:Uyes} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_GPT_SUPPORT
|
|
|
|
.endif
|
|
|
|
.if ${LOADER_MBR_SUPPORT:Uyes} == "yes"
|
|
|
|
CFLAGS+= -DLOADER_MBR_SUPPORT
|
|
|
|
.endif
|
|
|
|
|
2017-11-10 23:54:31 +00:00
|
|
|
.if defined(HAVE_ZFS)
|
|
|
|
CFLAGS+= -DLOADER_ZFS_SUPPORT
|
|
|
|
CFLAGS+= -I${ZFSSRC}
|
|
|
|
CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
|
|
|
|
.if ${MACHINE} == "amd64"
|
|
|
|
# Have to override to use 32-bit version of zfs library...
|
|
|
|
# kinda lame to select that there XXX
|
|
|
|
LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a
|
|
|
|
.else
|
|
|
|
LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2017-12-18 04:51:45 +00:00
|
|
|
# NB: The makefiles depend on these being empty when we don't build forth.
|
|
|
|
.if ${MK_FORTH} != "no"
|
|
|
|
LIBFICL= ${BOOTOBJ}/ficl/libficl.a
|
|
|
|
.if ${MACHINE} == "i386"
|
|
|
|
LIBFICL32= ${LIBFICL}
|
|
|
|
.else
|
|
|
|
LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2016-12-19 14:40:59 +00:00
|
|
|
CLEANFILES+= vers.c
|
|
|
|
VERSION_FILE?= ${.CURDIR}/version
|
2016-12-19 14:45:59 +00:00
|
|
|
.if ${MK_REPRODUCIBLE_BUILD} != no
|
|
|
|
REPRO_FLAG= -r
|
|
|
|
.endif
|
2017-10-22 22:50:08 +00:00
|
|
|
vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE}
|
|
|
|
sh ${LDRSRC}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \
|
2016-12-19 14:45:59 +00:00
|
|
|
${NEWVERSWHAT}
|
2017-11-10 23:54:58 +00:00
|
|
|
|
|
|
|
.if !empty(HELP_FILES)
|
2017-12-18 04:51:34 +00:00
|
|
|
HELP_FILES+= ${LDRSRC}/help.common
|
|
|
|
|
2017-11-10 23:54:58 +00:00
|
|
|
CLEANFILES+= loader.help
|
|
|
|
FILES+= loader.help
|
|
|
|
|
|
|
|
loader.help: ${HELP_FILES}
|
|
|
|
cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET}
|
|
|
|
.endif
|