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
|
2010-10-26 02:34:47 +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"
|
2017-12-08 19:57:16 +00:00
|
|
|
.else
|
|
|
|
SRCS+= interp_simple.c
|
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-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
|
|
|
|
|
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)
|
|
|
|
CLEANFILES+= loader.help
|
|
|
|
FILES+= loader.help
|
|
|
|
|
|
|
|
loader.help: ${HELP_FILES}
|
|
|
|
cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET}
|
|
|
|
.endif
|