summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2017-11-10 23:54:31 +0000
committerWarner Losh <imp@FreeBSD.org>2017-11-10 23:54:31 +0000
commit4e8fc5c539df16fbb2c57428a429a5f95ad8d13d (patch)
treeb05165bcbf3cc362bb583e731804e6d94e9056eb
parent1f9ecdf78f7535e19ad1a58c744e3f62f4bc9032 (diff)
Notes
-rw-r--r--sys/boot/Makefile.amd642
-rw-r--r--sys/boot/Makefile.i3862
-rw-r--r--sys/boot/Makefile.sparc642
-rw-r--r--sys/boot/i386/loader/Makefile12
-rw-r--r--sys/boot/i386/zfsloader/Makefile9
-rw-r--r--sys/boot/loader.mk13
-rw-r--r--sys/boot/sparc64/Makefile7
-rw-r--r--sys/boot/sparc64/loader/Makefile7
-rw-r--r--sys/boot/sparc64/zfsloader/Makefile2
9 files changed, 30 insertions, 26 deletions
diff --git a/sys/boot/Makefile.amd64 b/sys/boot/Makefile.amd64
index 08f9f50d88d4d..abecaa685022d 100644
--- a/sys/boot/Makefile.amd64
+++ b/sys/boot/Makefile.amd64
@@ -1,7 +1,9 @@
# $FreeBSD$
SUBDIR+= libsa32
+.if ${MK_ZFS} != "no"
SUBDIR+= zfs zfs32
+.endif
.if ${MK_FORTH} != "no"
SUBDIR+= ficl32
.endif
diff --git a/sys/boot/Makefile.i386 b/sys/boot/Makefile.i386
index b0c349c34f65f..fb53744ab5aef 100644
--- a/sys/boot/Makefile.i386
+++ b/sys/boot/Makefile.i386
@@ -3,6 +3,8 @@
.if ${LOADER_GELI_SUPPORT:Uyes} == "yes"
SUBDIR+= geli
.endif
+.if ${MK_ZFS} != "no"
SUBDIR+= zfs
+.endif
SUBDIR+= efi
diff --git a/sys/boot/Makefile.sparc64 b/sys/boot/Makefile.sparc64
index 1064a267db4a8..40b42e9c18e1f 100644
--- a/sys/boot/Makefile.sparc64
+++ b/sys/boot/Makefile.sparc64
@@ -1,4 +1,6 @@
# $FreeBSD$
SUBDIR+= ofw
+.if ${MK_ZFS} != "no"
SUBDIR+= zfs
+.endif
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index e330b6e7b72dc..d97d1bcd549d2 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -21,6 +21,8 @@ INTERNALPROG=
NEWVERSWHAT?= "bootstrap loader" x86
VERSION_FILE= ${.CURDIR}/../loader/version
+.PATH: ${BOOTSRC}/i386/loader
+
# architecture-specific loader code
SRCS= main.c conf.c vers.c chain.c
@@ -30,16 +32,6 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT
LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a
.endif
-# Set by zfsloader Makefile
-.if defined(LOADER_ZFS_SUPPORT)
-CFLAGS+= -DLOADER_ZFS_SUPPORT
-.if ${MACHINE} == "amd64"
-LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a
-.else
-LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
-.endif
-.endif
-
# Include bcache code.
HAVE_BCACHE= yes
diff --git a/sys/boot/i386/zfsloader/Makefile b/sys/boot/i386/zfsloader/Makefile
index 6e07df7769401..67aa8e9438798 100644
--- a/sys/boot/i386/zfsloader/Makefile
+++ b/sys/boot/i386/zfsloader/Makefile
@@ -1,15 +1,10 @@
# $FreeBSD$
-LOADER_ZFS_SUPPORT=yes
-
-.include <bsd.init.mk>
-
-.PATH: ${BOOTSRC}/i386/loader
-
LOADER= zfsloader
NEWVERSWHAT= "ZFS enabled bootstrap loader" x86
LOADER_ONLY= yes
-MAN=
+HAVE_ZFS= yes
+.include <bsd.init.mk>
.include "${BOOTSRC}/i386/loader/Makefile"
diff --git a/sys/boot/loader.mk b/sys/boot/loader.mk
index 26eda97df66de..8b99153589d74 100644
--- a/sys/boot/loader.mk
+++ b/sys/boot/loader.mk
@@ -69,6 +69,19 @@ CFLAGS+= -DBOOT_PROMPT_123
SRCS+= install.c
.endif
+.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
+
CLEANFILES+= vers.c
VERSION_FILE?= ${.CURDIR}/version
.if ${MK_REPRODUCIBLE_BUILD} != no
diff --git a/sys/boot/sparc64/Makefile b/sys/boot/sparc64/Makefile
index a76803909082a..6a81a0580d5f6 100644
--- a/sys/boot/sparc64/Makefile
+++ b/sys/boot/sparc64/Makefile
@@ -1,5 +1,10 @@
# $FreeBSD$
-SUBDIR= boot1 loader zfsboot zfsloader
+.include <bsd.init.mk>
+
+SUBDIR= boot1 loader
+.if ${MK_ZFS} != "no"
+SUBDIR+=zfsboot zfsloader
+.endif
.include <bsd.subdir.mk>
diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile
index 3f3185cd4ea25..7eb0b3420108c 100644
--- a/sys/boot/sparc64/loader/Makefile
+++ b/sys/boot/sparc64/loader/Makefile
@@ -5,7 +5,6 @@ LOADER_UFS_SUPPORT?= yes
LOADER_CD9660_SUPPORT?= yes
LOADER_EXT2FS_SUPPORT?= no
LOADER_MSDOS_SUPPORT?= no
-LOADER_ZFS_SUPPORT?= no
LOADER_NET_SUPPORT?= yes
LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= yes
@@ -28,12 +27,6 @@ SRCS= locore.S main.c metadata.c vers.c
.if ${LOADER_DEBUG} == "yes"
CFLAGS+= -DLOADER_DEBUG
.endif
-.if ${LOADER_ZFS_SUPPORT} == "yes"
-CFLAGS+= -DLOADER_ZFS_SUPPORT
-CFLAGS+= -I${ZFSSRC}
-CFLAGS+= -I${SYSDIR}/cddl/boot/zfs
-LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a
-.endif
# Always add MI sources
.include "${BOOTSRC}/loader.mk"
diff --git a/sys/boot/sparc64/zfsloader/Makefile b/sys/boot/sparc64/zfsloader/Makefile
index 1ed280829245e..a5d433ce401f7 100644
--- a/sys/boot/sparc64/zfsloader/Makefile
+++ b/sys/boot/sparc64/zfsloader/Makefile
@@ -4,6 +4,6 @@
PROG= zfsloader
NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64
-LOADER_ZFS_SUPPORT=yes
+HAVE_ZFS= yes
.include "${.CURDIR}/../loader/Makefile"