From nobody Sat Apr 22 22:08:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q3ls84pFZz46N7Q; Sat, 22 Apr 2023 22:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q3ls841GZz4Gnc; Sat, 22 Apr 2023 22:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682201308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6PeJbj2W3ie75s/TZ6VsOZ7uve2EC7izWFMPVloeWw=; b=g5Y/UFkrvrKFw+dd/c9o61iBXvchEx5nqS4XieZ9/PBUTUJHXK56iFtKYOyju/MMPGjcc1 NW0qVuc0obFAXNYsM23scWuJ+ZQCA6yQoqHGsGf2I3nlG14BDaRov3ASdOLAJ/fnDV+FNL axMBWhtHKz8u2REJweeX2RYKUT5yC590d1DKLBmnZFotquJmZh9aDjuBtWzK5wVG45lyPs rdidTWhG8jV1AcjpfmqG00CLyGXvaPjCXmGg5qKsA961PGMGFj7ytzkXifwqkzMTxUpl48 dx8mW1RMsyhfMXHkvb1zz/h6zIHZDqIZ4MVTVNGVA3htdynhVDYBSWbJr1cQvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682201308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6PeJbj2W3ie75s/TZ6VsOZ7uve2EC7izWFMPVloeWw=; b=ijIkZYPjy+YQmfdeSwelpK56aLnsfw0cSLRj/gCKgaNz2DdQ1jlXwlCQgr8GBO6610Y7ma PnpVu4CIR+iuS5ysodIOBVub5lEbPPbXeDWePOf3H0w3k/qbHPg5PZWQzYlugkHwHiJFFs kpQJkDzvb8CazZskKDP2hfaNzCCGd0hp+dHWWZbgWHwGZTJZW70XvdoPIjqMoX7ZOMT2uN ttd3VtcOELpxQHI1U2qho7jg/mD/48GALkFxRr9uYkzw14ir4AGul7oKe697Fz3+TUsFGG 0vyER7twP5gT2pPM17apaWwOosWtIDoofxL8ngom8VA37HvjH8Wp0c8iDvW5Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682201308; a=rsa-sha256; cv=none; b=i3dsFX3SaGX/Eq+zUO0NhhAlNkWZPJETaYBrIZbkmQawzveINhu0z3nVm+OkPl4Evb8Goq FfptYd1vq2m2WBLOnEKRfMse/YlDOE6pZxl87cU+239fn+Fp34EwaWj0c/TGhuL0tEePM6 oR2T46AIgv8wrbo4uYkqSOP/qhHFKM+MXbSUDeIUbVAK69K2AZLmbSdNpLpC8snEVky7sQ kqiX6RNDEDlsMy076o8MeqkwMvCcwbee8SHEn5iAjpcZh3Yltpii1DyECCy7h1cEGGpDQL xIa27H6a4meuyjrtACi6M2uCfzYA2ikuRavIaXYjtdVUmE4v/gbzZKt3qUPvMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q3ls83413zJGM; Sat, 22 Apr 2023 22:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33MM8Su6064989; Sat, 22 Apr 2023 22:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33MM8Sij064988; Sat, 22 Apr 2023 22:08:28 GMT (envelope-from git) Date: Sat, 22 Apr 2023 22:08:28 GMT Message-Id: <202304222208.33MM8Sij064988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: cf20b1f81c10 - main - Extract some of local.meta.sys.mk to local.meta.sys.env.mk List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf20b1f81c1043faca2a5e4fe16bc48679494fe0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=cf20b1f81c1043faca2a5e4fe16bc48679494fe0 commit cf20b1f81c1043faca2a5e4fe16bc48679494fe0 Author: Simon J. Gerraty AuthorDate: 2023-04-22 22:07:53 +0000 Commit: Simon J. Gerraty CommitDate: 2023-04-22 22:07:53 +0000 Extract some of local.meta.sys.mk to local.meta.sys.env.mk Latest meta.sys.mk follows sys.mk in including local.meta.sys.env.mk and local.meta.sys.mk late, but we have things we need done early so move them to local.meta.sys.env.mk --- share/mk/local.meta.sys.env.mk | 90 ++++++++++++++++++++++++++++++++++++++++++ share/mk/local.meta.sys.mk | 85 +-------------------------------------- share/mk/local.sys.env.mk | 5 --- 3 files changed, 91 insertions(+), 89 deletions(-) diff --git a/share/mk/local.meta.sys.env.mk b/share/mk/local.meta.sys.env.mk new file mode 100644 index 000000000000..937b9c10bc3b --- /dev/null +++ b/share/mk/local.meta.sys.env.mk @@ -0,0 +1,90 @@ +# $FreeBSD$ + +# local configuration specific to meta mode +# before we process TARGET_SPEC +# we assume that MK_DIRDEPS_BUILD=yes + +.if !defined(HOST_TARGET) || !defined(HOST_MACHINE) +# we need HOST_TARGET etc below. +.include +.export HOST_TARGET +.endif + +# 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 + +.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} + +# For universe we want to potentially +# build for multiple MACHINE_ARCH per MACHINE +# so we need more than MACHINE in TARGET_SPEC +TARGET_SPEC_VARS?= MACHINE 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 + +# this is sufficient for most of the tree. +.MAKE.DEPENDFILE_DEFAULT = ${.MAKE.DEPENDFILE_PREFIX} + +# but if we have a machine qualified file it should be used in preference +.MAKE.DEPENDFILE_PREFERENCE = \ + ${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \ + ${.MAKE.DEPENDFILE_PREFIX} + +.undef .MAKE.DEPENDFILE + +META_MODE+= missing-meta=yes +.if empty(META_MODE:Mnofilemon) +META_MODE+= missing-filemon=yes +.endif diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk index 6e03a99d7dfe..7747329694ff 100644 --- a/share/mk/local.meta.sys.mk +++ b/share/mk/local.meta.sys.mk @@ -6,43 +6,8 @@ # we need this until there is an alternative MK_INSTALL_AS_USER= yes -.if !defined(HOST_TARGET) || !defined(HOST_MACHINE) -# we need HOST_TARGET etc below. -.include -.export HOST_TARGET -.endif - -# 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 -.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} - # to be consistent with src/Makefile just concatenate with '.'s TARGET_OBJ_SPEC:= ${TARGET_SPEC:S;,;.;g} OBJTOP:= ${OBJROOT}${TARGET_OBJ_SPEC} @@ -53,33 +18,6 @@ OBJTOP:= ${OBJROOT}${TARGET_OBJ_SPEC} .endif .endif -HOST_OBJTOP ?= ${OBJROOT}${HOST_TARGET} - -.if ${OBJTOP} == ${HOST_OBJTOP} || ${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 # we want to end up with a singe stage tree for all machines .if ${MK_STAGING} == "yes" @@ -130,25 +68,9 @@ LDFLAGS_LAST+= -L${STAGE_LIBDIR} .-include "local.toolchain.mk" -# this is sufficient for most of the tree. -.MAKE.DEPENDFILE_DEFAULT = ${.MAKE.DEPENDFILE_PREFIX} - -# but if we have a machine qualified file it should be used in preference -.MAKE.DEPENDFILE_PREFERENCE = \ - ${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \ - ${.MAKE.DEPENDFILE_PREFIX} - -.undef .MAKE.DEPENDFILE - -.include "sys.dependfile.mk" - .if ${.MAKE.LEVEL} > 0 && ${MACHINE} == "host" && ${.MAKE.DEPENDFILE:E} != "host" # we can use this but should not update it. -UPDATE_DEPENDFILE= NO -.endif -# Don't require filemon for makeman. -.if make(showconfig) -UPDATE_DEPENDFILE= NO +UPDATE_DEPENDFILE?= NO .endif # define the list of places that contain files we are responsible for @@ -232,11 +154,6 @@ CFLAGS+= ${CROSS_TARGET_FLAGS} ACFLAGS+= ${CROSS_TARGET_FLAGS} .endif -META_MODE+= missing-meta=yes -.if empty(META_MODE:Mnofilemon) -META_MODE+= missing-filemon=yes -.endif - .if ${MK_DIRDEPS_BUILD} == "yes" # we set these here, rather than local.gendirdeps.mk # so we can ensure any DEP_* values that might be used in diff --git a/share/mk/local.sys.env.mk b/share/mk/local.sys.env.mk index 626aafe61270..e3348537db41 100644 --- a/share/mk/local.sys.env.mk +++ b/share/mk/local.sys.env.mk @@ -50,8 +50,3 @@ ECHO_TRACE?= true .include "src.sys.env.mk" .-include - -# For universe we want to potentially -# build for multiple MACHINE_ARCH per MACHINE -# so we need more than MACHINE in TARGET_SPEC -TARGET_SPEC_VARS?= MACHINE MACHINE_ARCH