aboutsummaryrefslogtreecommitdiff
path: root/sys/boot
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/arm/uboot/Makefile1
-rw-r--r--sys/boot/efi/loader/Makefile8
-rw-r--r--sys/boot/efi/loader/arch/arm/Makefile.inc2
-rw-r--r--sys/boot/efi/loader/arch/arm64/Makefile.inc3
-rw-r--r--sys/boot/fdt.mk9
-rw-r--r--sys/boot/mips/uboot/Makefile1
-rw-r--r--sys/boot/powerpc/Makefile7
-rw-r--r--sys/boot/powerpc/kboot/Makefile8
-rw-r--r--sys/boot/powerpc/ofw/Makefile8
-rw-r--r--sys/boot/powerpc/uboot/Makefile1
-rw-r--r--sys/boot/uboot.mk8
-rw-r--r--sys/boot/uboot/lib/Makefile9
12 files changed, 27 insertions, 38 deletions
diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile
index 0db9f96d32d2..9f44e0f46d4e 100644
--- a/sys/boot/arm/uboot/Makefile
+++ b/sys/boot/arm/uboot/Makefile
@@ -9,7 +9,6 @@ LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= no
LOADER_GZIP_SUPPORT?= no
LOADER_BZIP2_SUPPORT?= no
-LOADER_FDT_SUPPORT= ${MK_FDT}
.include <bsd.init.mk>
diff --git a/sys/boot/efi/loader/Makefile b/sys/boot/efi/loader/Makefile
index 82852da1733e..3561d6e46a37 100644
--- a/sys/boot/efi/loader/Makefile
+++ b/sys/boot/efi/loader/Makefile
@@ -71,13 +71,9 @@ CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID
.endif
.endif
-LOADER_FDT_SUPPORT?= no
-.if ${MK_FDT} != "no" && ${LOADER_FDT_SUPPORT} != "no"
-CFLAGS+= -I${BOOTSRC}/fdt
-CFLAGS+= -I${BOOTSRC}/fdt
-CFLAGS+= -DLOADER_FDT_SUPPORT
+.if defined(HAVE_FDT) && ${MK_FDT} != "no"
+.include "${BOOTSRC}/fdt.mk"
LIBEFI_FDT= ${BOOTOBJ}/efi/fdt/libefi_fdt.a
-LIBFDT= ${BOOTOBJ}/fdt/libfdt.a
.endif
# Include bcache code.
diff --git a/sys/boot/efi/loader/arch/arm/Makefile.inc b/sys/boot/efi/loader/arch/arm/Makefile.inc
index b2876ca19518..74e6616e991b 100644
--- a/sys/boot/efi/loader/arch/arm/Makefile.inc
+++ b/sys/boot/efi/loader/arch/arm/Makefile.inc
@@ -3,4 +3,4 @@
SRCS+= exec.c \
start.S
-LOADER_FDT_SUPPORT=yes
+HAVE_FDT=yes
diff --git a/sys/boot/efi/loader/arch/arm64/Makefile.inc b/sys/boot/efi/loader/arch/arm64/Makefile.inc
index 2ce5af79d0c3..b62ce41c0e27 100644
--- a/sys/boot/efi/loader/arch/arm64/Makefile.inc
+++ b/sys/boot/efi/loader/arch/arm64/Makefile.inc
@@ -1,6 +1,7 @@
# $FreeBSD$
-LOADER_FDT_SUPPORT=yes
+HAVE_FDT=yes
+
SRCS+= exec.c \
start.S
diff --git a/sys/boot/fdt.mk b/sys/boot/fdt.mk
new file mode 100644
index 000000000000..4d4794d980f2
--- /dev/null
+++ b/sys/boot/fdt.mk
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+.if ${MK_FDT} == "yes"
+CFLAGS+= -I${FDTSRC}
+CFLAGS+= -I${BOOTOBJ}/fdt
+CFLAGS+= -I${SYSDIR}/contrib/libfdt
+CFLAGS+= -DLOADER_FDT_SUPPORT
+LIBFDT= ${BOOTOBJ}/fdt/libfdt.a
+.endif
diff --git a/sys/boot/mips/uboot/Makefile b/sys/boot/mips/uboot/Makefile
index 01df0b4e9183..a262b8756920 100644
--- a/sys/boot/mips/uboot/Makefile
+++ b/sys/boot/mips/uboot/Makefile
@@ -9,7 +9,6 @@ LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= no
LOADER_GZIP_SUPPORT?= no
LOADER_BZIP2_SUPPORT?= no
-LOADER_FDT_SUPPORT= ${MK_FDT}
.include <bsd.init.mk>
diff --git a/sys/boot/powerpc/Makefile b/sys/boot/powerpc/Makefile
index e3ac008fb799..969eee8dc63e 100644
--- a/sys/boot/powerpc/Makefile
+++ b/sys/boot/powerpc/Makefile
@@ -1,8 +1,13 @@
# $FreeBSD$
-SUBDIR= boot1.chrp kboot ofw uboot
+.include <bsd.init.mk>
+
+SUBDIR= boot1.chrp ofw uboot
.if ${MACHINE_ARCH} != "powerpcspe"
SUBDIR+= ps3
.endif
+.if ${MK_FDT} == "yes"
+SUBDIR+= kboot
+.endif
.include <bsd.subdir.mk>
diff --git a/sys/boot/powerpc/kboot/Makefile b/sys/boot/powerpc/kboot/Makefile
index fbb429419aa3..2d45796f5063 100644
--- a/sys/boot/powerpc/kboot/Makefile
+++ b/sys/boot/powerpc/kboot/Makefile
@@ -8,7 +8,6 @@ LOADER_NET_SUPPORT?= yes
LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= no
LOADER_GZIP_SUPPORT?= yes
-LOADER_FDT_SUPPORT= yes
LOADER_BZIP2_SUPPORT?= no
.include <bsd.init.mk>
@@ -24,12 +23,7 @@ SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c
SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c
SRCS+= ucmpdi2.c
-.if ${LOADER_FDT_SUPPORT} == "yes"
-CFLAGS+= -I${FDTSRC}
-CFLAGS+= -I${SYSDIR}/contrib/libfdt
-CFLAGS+= -DLOADER_FDT_SUPPORT
-LIBFDT= ${BOOTOBJ}/fdt/libfdt.a
-.endif
+.include "${BOOTSRC}/fdt.mk"
CFLAGS+= -mcpu=powerpc64
diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile
index 3e49303433d0..ae3dfbd54f2d 100644
--- a/sys/boot/powerpc/ofw/Makefile
+++ b/sys/boot/powerpc/ofw/Makefile
@@ -9,7 +9,6 @@ LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= no
LOADER_GZIP_SUPPORT?= yes
LOADER_BZIP2_SUPPORT?= no
-LOADER_FDT_SUPPORT?= yes
.include <bsd.init.mk>
MK_SSP= no
@@ -23,12 +22,9 @@ INSTALLFLAGS= -b
SRCS= conf.c metadata.c vers.c start.c
SRCS+= ucmpdi2.c
-.if ${LOADER_FDT_SUPPORT} == "yes"
+.include "${BOOTSRC}/fdt.mk"
+.if ${MK_FDT} == "yes"
SRCS+= ofwfdt.c
-CFLAGS+= -I${FDTSRC}
-CFLAGS+= -I${SYSDIR}/contrib/libfdt
-CFLAGS+= -DLOADER_FDT_SUPPORT
-LIBFDT= ${BOOTOBJ}/fdt/libfdt.a
.endif
# Always add MI sources
diff --git a/sys/boot/powerpc/uboot/Makefile b/sys/boot/powerpc/uboot/Makefile
index 6d45d917bdd5..06130306d0df 100644
--- a/sys/boot/powerpc/uboot/Makefile
+++ b/sys/boot/powerpc/uboot/Makefile
@@ -8,7 +8,6 @@ LOADER_NFS_SUPPORT?= yes
LOADER_TFTP_SUPPORT?= no
LOADER_GZIP_SUPPORT?= no
LOADER_BZIP2_SUPPORT?= no
-LOADER_FDT_SUPPORT= ${MK_FDT}
.include <bsd.init.mk>
diff --git a/sys/boot/uboot.mk b/sys/boot/uboot.mk
index d8871bb47456..d120481a4b96 100644
--- a/sys/boot/uboot.mk
+++ b/sys/boot/uboot.mk
@@ -11,10 +11,8 @@ LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a
CFLAGS+= -I${UBOOTSRC}/lib
CFLAGS+= -I${BOOTOBJ}/uboot/lib
-.if ${LOADER_FDT_SUPPORT} == "yes"
-CFLAGS+= -I${FDTSRC}
-CFLAGS+= -I${BOOTOBJ}/fdt
-CFLAGS+= -DLOADER_FDT_SUPPORT
+.include "${BOOTSRC}/fdt.mk"
+
+.if ${MK_FDT} == "yes"
LIBUBOOT_FDT= ${BOOTOBJ}/uboot/fdt/libuboot_fdt.a
-LIBFDT= ${BOOTOBJ}/fdt/libfdt.a
.endif
diff --git a/sys/boot/uboot/lib/Makefile b/sys/boot/uboot/lib/Makefile
index 13dee0e22f62..6eebbaaa33e7 100644
--- a/sys/boot/uboot/lib/Makefile
+++ b/sys/boot/uboot/lib/Makefile
@@ -17,14 +17,7 @@ CFLAGS+= -ffreestanding -msoft-float
SRCS+= disk.c
.endif
-LOADER_FDT_SUPPORT= ${MK_FDT}
-
-.if ${LOADER_FDT_SUPPORT} == "yes"
-CFLAGS+= -DLOADER_FDT_SUPPORT -I${FDTSRC}
-.endif
-
-# Pick up FDT includes
-CFLAGS+= -I${SYSDIR}/contrib/libfdt/
+.include "${BOOTSRC}/fdt.mk"
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I.