summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/mk/src.opts.mk16
-rw-r--r--stand/Makefile39
-rw-r--r--stand/Makefile.amd6418
-rw-r--r--stand/Makefile.arm10
-rw-r--r--stand/Makefile.arm6410
-rw-r--r--stand/Makefile.i38610
-rw-r--r--stand/Makefile.mips7
-rw-r--r--stand/Makefile.powerpc8
-rw-r--r--stand/Makefile.sparc646
-rw-r--r--stand/efi/Makefile6
10 files changed, 49 insertions, 81 deletions
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 0a018d2..b305571 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -131,6 +131,8 @@ __DEFAULT_YES_OPTIONS = \
LPR \
LS_COLORS \
LZMA_SUPPORT \
+ LOADER_OFW \
+ LOADER_UBOOT \
MAIL \
MAILWRAPPER \
MAKE \
@@ -276,9 +278,23 @@ BROKEN_OPTIONS+=LLDB
.if ${__T} != "armv6"
BROKEN_OPTIONS+=LIBSOFT
.endif
+# EFI doesn't exist on mips, powerpc, sparc or riscv.
.if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*}
BROKEN_OPTIONS+=EFI
.endif
+# GELI isn't supported on !x86
+.if ${__T} != "i386" && ${__T} != "amd64"
+BROKEN_OPTIONS+=LOADER_GELI
+.endif
+# OFW is only for powerpc and sparc64, exclude others
+.if ${__T:Mpowerpc*} == "" && ${__T:Msparc64} == ""
+BROKEN_OPTIONS+=LOADER_OFW
+.endif
+# UBOOT is only for arm, mips and powerpc, exclude others
+.if ${__T:Marm*} == "" && ${__T:Mmips*} == "" && ${__T:Mpowerpc*} == ""
+BROKEN_OPTIONS+=LOADER_UBOOT
+.endif
+
.if ${__T:Mmips64*}
# profiling won't work on MIPS64 because there is only assembly for o32
BROKEN_OPTIONS+=PROFILE
diff --git a/stand/Makefile b/stand/Makefile
index 9ba6ea7..59eb324 100644
--- a/stand/Makefile
+++ b/stand/Makefile
@@ -2,20 +2,43 @@
.include <src.opts.mk>
-SUBDIR+= libsa
-.if ${MK_FORTH} != "no"
-# Build the add-in FORTH interpreter.
-SUBDIR+= ficl
-SUBDIR+= forth
+# For amd64 we have to build 32 and 64 bit versions of things. For
+# others we don't. LIB32LIST is a list of libraries, which if
+# included, need to be built 32-bit as well.
+.if ${MACHINE_ARCH} == "amd64"
+LIB32LIST=libsa ficl liblua zfs
.endif
-SUBDIR+= defaults
-SUBDIR+= man
+S.yes+= libsa
+
+S.${MK_FORTH}+= ficl
+S.${MK_FORTH}+= forth
+S.${MK_LOADER_LUA}+= liblua
+S.${MK_LOADER_LUA}+= lua
+S.${MK_FDT}+= fdt
+S.${MK_LOADER_OFW}+= ofw
+S.${MK_ZFS}+= zfs
+S.yes+= defaults
+S.yes+= man
+
+S.${MK_LOADER_GELI}+= geli
.include <bsd.arch.inc.mk>
+S.${MK_EFI}+= efi
+S.${MK_LOADER_UBOOT}+= uboot
+
.if exists(${.CURDIR}/${MACHINE}/.)
-SUBDIR+= ${MACHINE}
+S.yes+= ${MACHINE}
+.endif
+
+# Build the actual subdir list from S.yes, adding in the 32-bit
+# variant if necessary.
+.for _x in ${S.yes}
+SUBDIR+=${_x}
+.if defined(LIB32LIST) && ${LIB32LIST:M${_x}}
+SUBDIR+=${_x}32
.endif
+.endfor
.include <bsd.subdir.mk>
diff --git a/stand/Makefile.amd64 b/stand/Makefile.amd64
index 6e8c967..b2b918e 100644
--- a/stand/Makefile.amd64
+++ b/stand/Makefile.amd64
@@ -1,18 +1,4 @@
# $FreeBSD$
-SUBDIR+= libsa32
-.if ${MK_ZFS} != "no"
-SUBDIR+= zfs zfs32
-.endif
-.if ${MK_FORTH} != "no"
-SUBDIR+= ficl32
-.endif
-
-SUBDIR+= efi
-SUBDIR+= userboot
-
-.if ${MK_LOADER_GELI} == "yes"
-SUBDIR+= geli
-.endif
-
-SUBDIR+= i386
+S.yes+= userboot
+S.yes+= i386
diff --git a/stand/Makefile.arm b/stand/Makefile.arm
deleted file mode 100644
index 387b77b..0000000
--- a/stand/Makefile.arm
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-.if ${MK_FDT} != "no"
-SUBDIR+= fdt
-.endif
-.if ${MK_ZFS} != "no"
-SUBDIR+= zfs
-.endif
-
-SUBDIR+= efi uboot
diff --git a/stand/Makefile.arm64 b/stand/Makefile.arm64
deleted file mode 100644
index bf0fd39..0000000
--- a/stand/Makefile.arm64
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-.if ${MK_FDT} != "no"
-SUBDIR+= fdt
-.endif
-.if ${MK_ZFS} != "no"
-SUBDIR+= zfs
-.endif
-
-SUBDIR+= efi
diff --git a/stand/Makefile.i386 b/stand/Makefile.i386
deleted file mode 100644
index 9664974..0000000
--- a/stand/Makefile.i386
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-.if ${MK_LOADER_GELI} == "yes"
-SUBDIR+= geli
-.endif
-.if ${MK_ZFS} != "no"
-SUBDIR+= zfs
-.endif
-
-SUBDIR+= efi
diff --git a/stand/Makefile.mips b/stand/Makefile.mips
deleted file mode 100644
index 46fc574..0000000
--- a/stand/Makefile.mips
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD$
-
-.if ${MK_FDT} != "no"
-SUBDIR+= fdt
-.endif
-
-SUBDIR+= uboot
diff --git a/stand/Makefile.powerpc b/stand/Makefile.powerpc
deleted file mode 100644
index b7660f4..0000000
--- a/stand/Makefile.powerpc
+++ /dev/null
@@ -1,8 +0,0 @@
-# $FreeBSD$
-
-.if ${MK_FDT} != "no"
-SUBDIR+= fdt
-.endif
-
-SUBDIR+= ofw
-SUBDIR+= uboot
diff --git a/stand/Makefile.sparc64 b/stand/Makefile.sparc64
deleted file mode 100644
index 40b42e9..0000000
--- a/stand/Makefile.sparc64
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD$
-
-SUBDIR+= ofw
-.if ${MK_ZFS} != "no"
-SUBDIR+= zfs
-.endif
diff --git a/stand/efi/Makefile b/stand/efi/Makefile
index ee1abfd..bf37fcc 100644
--- a/stand/efi/Makefile
+++ b/stand/efi/Makefile
@@ -8,17 +8,11 @@ NO_OBJ=t
# than 4.5 supports it.
.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500
-.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
.if ${MK_FDT} != "no"
SUBDIR+= fdt
.endif
-.endif
-.if ${MACHINE_CPUARCH} == "aarch64" || \
- ${MACHINE_CPUARCH} == "amd64" || \
- ${MACHINE_CPUARCH} == "arm"
SUBDIR+= libefi loader boot1
-.endif
.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500
OpenPOWER on IntegriCloud