aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/loader.mk
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-10-16 03:59:28 +0000
committerWarner Losh <imp@FreeBSD.org>2017-10-16 03:59:28 +0000
commit7f20726e4badbe62a3b6d45a2e61bd68ac1d4cd3 (patch)
tree67800699cd92e1f23279262668cca3c3469607db /sys/boot/loader.mk
parent7e705f54f8270b7ec5a3ef638bed161cbf0bd532 (diff)
downloadsrc-7f20726e4badbe62a3b6d45a2e61bd68ac1d4cd3.tar.gz
src-7f20726e4badbe62a3b6d45a2e61bd68ac1d4cd3.zip
Move common/Makefile.inc to sys/boot/loader.mk.
Makefile.inc has a specific meaning in the tree, and common/Makefile.inc doesn't quite fit into that. Rename it to loader.mk and it will be a place to collect common things to all /boot/loader programs there. Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=324649
Diffstat (limited to 'sys/boot/loader.mk')
-rw-r--r--sys/boot/loader.mk88
1 files changed, 88 insertions, 0 deletions
diff --git a/sys/boot/loader.mk b/sys/boot/loader.mk
new file mode 100644
index 000000000000..bf241a127526
--- /dev/null
+++ b/sys/boot/loader.mk
@@ -0,0 +1,88 @@
+# $FreeBSD$
+
+BOOTDIR=${SRCTOP}/sys/boot
+LDR_MI=${BOOTDIR}/common
+
+.PATH: ${LDR_MI} ${BOOTDIR}/libsa
+
+CFLAGS+=-I${LDR_MI}
+
+SRCS+= boot.c commands.c console.c devopen.c interp.c
+SRCS+= interp_backslash.c interp_parse.c ls.c misc.c
+SRCS+= module.c
+
+.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
+SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
+.elif ${MACHINE_CPUARCH} == "aarch64"
+SRCS+= load_elf64.c reloc_elf64.c
+.elif ${MACHINE_CPUARCH} == "arm"
+SRCS+= load_elf32.c reloc_elf32.c
+.elif ${MACHINE_CPUARCH} == "powerpc"
+SRCS+= load_elf32.c reloc_elf32.c
+SRCS+= load_elf64.c reloc_elf64.c
+.elif ${MACHINE_CPUARCH} == "sparc64"
+SRCS+= load_elf64.c reloc_elf64.c
+.elif ${MACHINE_ARCH:Mmips64*} != ""
+SRCS+= load_elf64.c reloc_elf64.c
+.elif ${MACHINE} == "mips"
+SRCS+= load_elf32.c reloc_elf32.c
+.endif
+
+.if defined(LOADER_NET_SUPPORT)
+SRCS+= dev_net.c
+.endif
+
+.if !defined(LOADER_NO_DISK_SUPPORT)
+SRCS+= disk.c part.c
+CFLAGS+= -DLOADER_DISK_SUPPORT
+.if !defined(LOADER_NO_GPT_SUPPORT)
+CFLAGS+= -DLOADER_GPT_SUPPORT
+.endif
+.if !defined(LOADER_NO_MBR_SUPPORT)
+CFLAGS+= -DLOADER_MBR_SUPPORT
+.endif
+.endif
+.if !defined(LOADER_NO_GELI_SUPPORT)
+CFLAGS+= -DLOADER_GELI_SUPPORT
+.endif
+
+.if defined(HAVE_BCACHE)
+SRCS+= bcache.c
+.endif
+
+.if defined(MD_IMAGE_SIZE)
+CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE}
+SRCS+= md.c
+.endif
+
+# Machine-independant ISA PnP
+.if defined(HAVE_ISABUS)
+SRCS+= isapnp.c
+.endif
+.if defined(HAVE_PNP)
+SRCS+= pnp.c
+.endif
+
+# Forth interpreter
+.if defined(BOOT_FORTH)
+SRCS+= interp_forth.c
+.include "${BOOTDIR}/ficl.mk"
+.endif
+
+.if defined(BOOT_PROMPT_123)
+CFLAGS+= -DBOOT_PROMPT_123
+.endif
+
+.if defined(LOADER_INSTALL_SUPPORT)
+SRCS+= install.c
+.endif
+
+CLEANFILES+= vers.c
+VERSION_FILE?= ${.CURDIR}/version
+.if ${MK_REPRODUCIBLE_BUILD} != no
+REPRO_FLAG= -r
+.endif
+vers.c: ${LDR_MI}/newvers.sh ${VERSION_FILE}
+ sh ${LDR_MI}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \
+ ${NEWVERSWHAT}