svn commit: r324652 - in head/sys/boot: . arm/uboot efi/boot1 efi/libefi efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userbo...
Warner Losh
imp at FreeBSD.org
Mon Oct 16 03:59:47 UTC 2017
Author: imp
Date: Mon Oct 16 03:59:44 2017
New Revision: 324652
URL: https://svnweb.freebsd.org/changeset/base/324652
Log:
Move all the ficl common code into ficl.mk
There's a number of copies of basically identical code to enable
building forth in /boot/loader. Move it all into ficl.mk.
Modified:
head/sys/boot/arm/uboot/Makefile
head/sys/boot/defs.mk
head/sys/boot/efi/boot1/Makefile
head/sys/boot/efi/libefi/Makefile
head/sys/boot/efi/loader/Makefile
head/sys/boot/ficl.mk
head/sys/boot/i386/loader/Makefile
head/sys/boot/loader.mk
head/sys/boot/mips/beri/loader/Makefile
head/sys/boot/mips/uboot/Makefile
head/sys/boot/powerpc/kboot/Makefile
head/sys/boot/powerpc/ofw/Makefile
head/sys/boot/powerpc/ps3/Makefile
head/sys/boot/powerpc/uboot/Makefile
head/sys/boot/sparc64/loader/Makefile
head/sys/boot/userboot/userboot/Makefile
Modified: head/sys/boot/arm/uboot/Makefile
==============================================================================
--- head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -81,14 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.
LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a
.endif
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/arm
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
# Always add MI sources
.include "../../loader.mk"
CFLAGS+= -I.
Modified: head/sys/boot/defs.mk
==============================================================================
--- head/sys/boot/defs.mk Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/defs.mk Mon Oct 16 03:59:44 2017 (r324652)
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <src.opts.mk>
+
.if !defined(__BOOT_DEFS_MK__)
__BOOT_DEFS_MK__=${MFILE}
@@ -9,9 +11,12 @@ LDR_MI= ${BOOTDIR}/common
SASRC= ${SRCTOP}/sys/boot/libsa
SYSDIR= ${SRCTOP}/sys
-# Normal Standalone library
+# NB: The makefiles depend on these being empty when we don't build forth.
+.if ${MK_FORTH} != "no"
+LIBFICL= ${OBJTOP}/sys/boot/ficl/libficl.a
+LIBFICL32= ${OBJTOP}/sys/boot/ficl32/libficl.a
+.endif
LIBSA= ${OBJTOP}/sys/boot/libsa/libsa.a
-# Standalone library compiled for 32-bit version of the processor
LIBSA32= ${OBJTOP}/sys/boot/libsa32/libsa32.a
.endif # __BOOT_DEFS_MK__
Modified: head/sys/boot/efi/boot1/Makefile
==============================================================================
--- head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -5,6 +5,7 @@ MAN=
.include "../Makefile.inc"
MK_SSP= no
+MK_FORTH= no
PROG= boot1.sym
INTERNALPROG=
Modified: head/sys/boot/efi/libefi/Makefile
==============================================================================
--- head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -3,7 +3,6 @@
.include <src.opts.mk>
.if ${MK_FORTH} != "no"
-CFLAGS+= -DBOOT_FORTH
.include "../../ficl.mk"
.endif
Modified: head/sys/boot/efi/loader/Makefile
==============================================================================
--- head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -78,14 +78,6 @@ CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID
.endif
.endif
-.if ${MK_FORTH} != "no"
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH
-CFLAGS+= -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH}
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
LOADER_FDT_SUPPORT?= no
.if ${MK_FDT} != "no" && ${LOADER_FDT_SUPPORT} != "no"
CFLAGS+= -I${.CURDIR}/../../fdt
Modified: head/sys/boot/ficl.mk
==============================================================================
--- head/sys/boot/ficl.mk Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/ficl.mk Mon Oct 16 03:59:44 2017 (r324652)
@@ -27,6 +27,8 @@ CFLAGS+= -m32 -mcpu=powerpc -I.
.endif
CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} -I${LDR_MI}
+CFLAGS+= -DBOOT_FORTH
+CFLAGS+= -DBF_DICTSIZE=15000
.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32)
.if !exists(machine)
Modified: head/sys/boot/i386/loader/Makefile
==============================================================================
--- head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -42,17 +42,6 @@ HAVE_BCACHE= yes
HAVE_PNP= yes
HAVE_ISABUS= yes
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
-.if ${MACHINE_CPUARCH} == "amd64"
-LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a
-.else
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-.endif
-
.if defined(LOADER_BZIP2_SUPPORT)
CFLAGS+= -DLOADER_BZIP2_SUPPORT
.endif
@@ -119,8 +108,15 @@ FILES+= loader.rc menu.rc
# XXX crt0.o needs to be first for pxeboot(8) to work
OBJS= ${BTXCRT}
-DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
-LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
+# XXX not happy with this construct, revisit
+.if ${MACHINE_CPUARCH} == "amd64"
+FICL= ${LIBFICL32}
+.else
+FICL= ${LIBFICL}
+.endif
+
+DPADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
+LDADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32}
.include <bsd.prog.mk>
Modified: head/sys/boot/loader.mk
==============================================================================
--- head/sys/boot/loader.mk Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/loader.mk Mon Oct 16 03:59:44 2017 (r324652)
@@ -64,7 +64,7 @@ SRCS+= pnp.c
.endif
# Forth interpreter
-.if defined(BOOT_FORTH)
+.if ${MK_FORTH} != "no"
SRCS+= interp_forth.c
.include "${BOOTDIR}/ficl.mk"
.endif
Modified: head/sys/boot/mips/beri/loader/Makefile
==============================================================================
--- head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -68,14 +68,6 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT
#CFLAGS+= -DLOADER_NFS_SUPPORT
#CFLAGS+= -DLOADER_TFTP_SUPPORT
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../../ficl
-CFLAGS+= -I${.CURDIR}/../../../ficl/mips64
-LIBFICL= ${.OBJDIR}/../../../ficl/libficl.a
-.endif
-
# Always add MI sources
.include "../../../loader.mk"
Modified: head/sys/boot/mips/uboot/Makefile
==============================================================================
--- head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -81,18 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.
LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a
.endif
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-.if ${MACHINE_ARCH:Mmips64*} != ""
-CFLAGS+= -I${.CURDIR}/../../ficl/mips64
-.else
-CFLAGS+= -I${.CURDIR}/../../ficl/mips
-.endif
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
# Always add MI sources
.include "../../loader.mk"
CFLAGS+= -I.
Modified: head/sys/boot/powerpc/kboot/Makefile
==============================================================================
--- head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -60,15 +60,6 @@ CFLAGS+= -DLOADER_FDT_SUPPORT
LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a
.endif
-
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/powerpc
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
CFLAGS+= -mcpu=powerpc64
# Always add MI sources
Modified: head/sys/boot/powerpc/ofw/Makefile
==============================================================================
--- head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -60,16 +60,9 @@ CFLAGS+= -DLOADER_FDT_SUPPORT
LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a
.endif
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/powerpc
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
# Always add MI sources
.include "../../loader.mk"
+
.PATH: ${.CURDIR}/../../../libkern
CFLAGS+= -I${.CURDIR}/../../..
CFLAGS+= -I.
Modified: head/sys/boot/powerpc/ps3/Makefile
==============================================================================
--- head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -61,14 +61,6 @@ LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a
.endif
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/powerpc
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
CFLAGS+= -mcpu=powerpc64
# Always add MI sources
Modified: head/sys/boot/powerpc/uboot/Makefile
==============================================================================
--- head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -66,14 +66,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt.
LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a
.endif
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/powerpc
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
# Always add MI sources
.include "../../loader.mk"
.PATH: ${.CURDIR}/../../../libkern
Modified: head/sys/boot/sparc64/loader/Makefile
==============================================================================
--- head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -57,14 +57,6 @@ CFLAGS+= -DLOADER_NFS_SUPPORT
CFLAGS+= -DLOADER_TFTP_SUPPORT
.endif
-.if ${MK_FORTH} != "no"
-# Enable BootForth
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/sparc64
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
# Always add MI sources
.include "../../loader.mk"
CFLAGS+= -I.
Modified: head/sys/boot/userboot/userboot/Makefile
==============================================================================
--- head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:38 2017 (r324651)
+++ head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:44 2017 (r324652)
@@ -39,14 +39,6 @@ LDFLAGS+= -nostdlib -Wl,-Bsymbolic
NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH}
-.if ${MK_FORTH} != "no"
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/i386
-CFLAGS+= -DBF_DICTSIZE=15000
-LIBFICL= ${.OBJDIR}/../ficl/libficl.a
-.endif
-
.if ${MK_ZFS} != "no"
CFLAGS+= -DUSERBOOT_ZFS_SUPPORT
LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a
More information about the svn-src-head
mailing list