git: d1c8420702b7 - main - Move more DIRDEPS_BUILD settings

From: Simon J. Gerraty <sjg_at_FreeBSD.org>
Date: Sat, 13 May 2023 00:42:45 UTC
The branch main has been updated by sjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=d1c8420702b7ad118ca909e9f7f39af8a6358e73

commit d1c8420702b7ad118ca909e9f7f39af8a6358e73
Author:     Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2023-05-13 00:40:37 +0000
Commit:     Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2023-05-13 00:40:37 +0000

    Move more DIRDEPS_BUILD settings
    
    local.meta.sys.env.mk should now concern itself only with
    META_MODE.
    
    Move any DIRDEPS_BUILD settings to local.sys.dirdeps.env.mk
---
 share/mk/local.meta.sys.env.mk    | 66 ---------------------------------------
 share/mk/local.sys.dirdeps.env.mk | 66 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/share/mk/local.meta.sys.env.mk b/share/mk/local.meta.sys.env.mk
index f109da4f39dd..c0b17cec8f7e 100644
--- a/share/mk/local.meta.sys.env.mk
+++ b/share/mk/local.meta.sys.env.mk
@@ -1,68 +1,9 @@
 # $FreeBSD$
 
 # local configuration specific to meta mode
-# before we process TARGET_SPEC
-# we assume that MK_DIRDEPS_BUILD=yes
-
-# from src/Makefile (for universe)
-TARGET_ARCHES_arm?=     arm armv6 armv7
-TARGET_ARCHES_arm64?=   aarch64
-TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpc64le powerpcspe
-TARGET_ARCHES_riscv?=   riscv64
-
-# some corner cases
-BOOT_MACHINE_DIR.amd64 = boot/i386
-MACHINE_ARCH.host = ${_HOST_ARCH}
-
-# the list of machines we support
-ALL_MACHINE_LIST?= amd64 arm arm64 i386 powerpc riscv
 
 .-include <site.meta.sys.env.mk>
 
-.for m in ${ALL_MACHINE_LIST:O:u}
-MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m}
-MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]}
-BOOT_MACHINE_DIR.$m ?= boot/$m
-.endfor
-
-.if empty(MACHINE_ARCH)
-.if !empty(TARGET_ARCH)
-MACHINE_ARCH= ${TARGET_ARCH}
-.else
-MACHINE_ARCH= ${MACHINE_ARCH.${MACHINE}}
-.endif
-.endif
-MACHINE_ARCH?= ${MACHINE_ARCH.${MACHINE}}
-MACHINE_ARCH:= ${MACHINE_ARCH}
-
-HOST_OBJTOP ?= ${OBJROOT}${HOST_TARGET}
-
-.if ${REQUESTED_MACHINE:U${MACHINE}} == "host"
-MACHINE= host
-.if ${TARGET_MACHINE:Uno} == ${HOST_TARGET}
-# not what we want
-TARGET_MACHINE= host
-.endif
-.endif
-.if ${MACHINE} == "host"
-OBJTOP := ${HOST_OBJTOP}
-MACHINE_ARCH= ${MACHINE_ARCH.${MACHINE}}
-.endif
-
-.if ${.MAKE.LEVEL} == 0 || empty(PYTHON)
-PYTHON ?= /usr/local/bin/python
-.export PYTHON
-# _SKIP_BUILD is not 100% as it requires wrapping all 'all:' targets to avoid
-# building in MAKELEVEL0.  Just prohibit 'all' entirely in this case to avoid
-# problems.
-.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL} == 0
-.MAIN: dirdeps
-.if make(all)
-.error DIRDEPS_BUILD: Please run '${MAKE}' instead of '${MAKE} all'.
-.endif
-.endif
-.endif
-
 .if !defined(NO_META_MISSING)
 META_MODE+=    missing-meta=yes
 .endif
@@ -78,10 +19,3 @@ META_MODE+=	missing-filemon=yes
 # this does not need/want filemon
 UPDATE_DEPENDFILE= NO
 .endif
-
-.if ${MK_DIRDEPS_BUILD} == "yes"
-.if ${.MAKE.OS} != "FreeBSD" || ${_HOST_OSREL:R} < ${OS_REVISION:R}
-# a pseudo option to indicate we need libegacy for host
-MK_host_egacy= yes
-.endif
-.endif
diff --git a/share/mk/local.sys.dirdeps.env.mk b/share/mk/local.sys.dirdeps.env.mk
index ab22f4c9e7d9..3d45719ff292 100644
--- a/share/mk/local.sys.dirdeps.env.mk
+++ b/share/mk/local.sys.dirdeps.env.mk
@@ -12,3 +12,69 @@ TARGET_SPEC_VARS?= MACHINE MACHINE_ARCH
 	${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \
 	${.MAKE.DEPENDFILE_PREFIX}
 
+# before we process TARGET_SPEC
+# we assume that MK_DIRDEPS_BUILD=yes
+
+# from src/Makefile (for universe)
+# would be nice to have this sort of info in sys.machine.mk
+TARGET_ARCHES_arm?=     armv6 armv7
+TARGET_ARCHES_arm64?=   aarch64
+TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpc64le powerpcspe
+TARGET_ARCHES_riscv?=   riscv64
+
+# some corner cases
+BOOT_MACHINE_DIR.amd64 = boot/i386
+MACHINE_ARCH.host = ${_HOST_ARCH}
+
+# the list of machines we support
+ALL_MACHINE_LIST?= amd64 arm arm64 i386 powerpc riscv
+
+.-include <site.sys.dirdeps.env.mk>
+
+.for m in ${ALL_MACHINE_LIST:O:u}
+MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m}
+MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]}
+BOOT_MACHINE_DIR.$m ?= boot/$m
+.endfor
+
+.if empty(MACHINE_ARCH)
+.if !empty(TARGET_ARCH)
+MACHINE_ARCH= ${TARGET_ARCH}
+.else
+MACHINE_ARCH= ${MACHINE_ARCH.${MACHINE}}
+.endif
+.endif
+MACHINE_ARCH?= ${MACHINE_ARCH.${MACHINE}}
+MACHINE_ARCH:= ${MACHINE_ARCH}
+
+HOST_OBJTOP ?= ${OBJROOT}${HOST_TARGET}
+
+.if ${REQUESTED_MACHINE:U${MACHINE}} == "host"
+MACHINE= host
+.if ${TARGET_MACHINE:Uno} == ${HOST_TARGET}
+# not what we want
+TARGET_MACHINE= host
+.endif
+.endif
+.if ${MACHINE} == "host"
+OBJTOP := ${HOST_OBJTOP}
+MACHINE_ARCH= ${MACHINE_ARCH.${MACHINE}}
+.endif
+
+
+.if ${.MAKE.LEVEL} == 0 || empty(PYTHON)
+PYTHON ?= /usr/local/bin/python
+.export PYTHON
+
+# _SKIP_BUILD is not 100% as it requires wrapping all 'all:' targets to avoid
+# building in MAKELEVEL0.  Just prohibit 'all' entirely in this case to avoid
+# problems.
+.if make(all)
+.error DIRDEPS_BUILD: Please run '${MAKE}' instead of '${MAKE} all'.
+.endif
+.endif
+
+.if ${.MAKE.OS} != "FreeBSD" || ${_HOST_OSREL:R} < ${OS_REVISION:R}
+# a pseudo option to indicate we need libegacy for host
+MK_host_egacy= yes
+.endif