From nobody Sat May 13 15:17:16 2023 X-Original-To: dev-commits-src-main@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 4QJTl11v4yz4BTGP; Sat, 13 May 2023 15:17:17 +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 4QJTl11Q8wz4Lw7; Sat, 13 May 2023 15:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683991037; 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=GEWGTZdf2p1JhUuZcca/Jg26E6f+Goph7tpZHfax4x0=; b=Fxoowh07zl6XCpADnY6R+99Et0D1F9JIl3h1VSCiILy9MJ+CSzLzZkD2mbUqMRN/tiwxUz q50IpsWW1mO3cBx1VMBZ2uU9l0hzPIeVmWWHppUu6c6i/2Ffy2WYAMYKtsARotjY5Ur0tf H5dEK/ezayrR+MyMz2radeiFrhj4sUyg1WaJX/HOUOjYlGpJWa7Huuhh1UGbpXDjRzdkl/ bcNIpsSiYBTeysJ9MO1Z+TWmP5wZM0muVuOSpIvB/hybzseRr5+Xou435sG5l0BxooYXGn r+5CtonuS/VS8qwaUQ/oFBWp0mrUGIlsVVPdmTszW8FyPNzxkLun+P5I6iSGZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683991037; 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=GEWGTZdf2p1JhUuZcca/Jg26E6f+Goph7tpZHfax4x0=; b=nDgpMmSQkNGeJvLTmuoQQckVJN0G1AKczzK7sRaQ2N809HooB19zrurHRNdlp+1MV62FsJ lMmCnmluENp8FzcxaYg1MA5ae2Pv/b/LCN0z72H3gJeN06Esd385KQLhJ1Vrene0gPpkk/ 0+ZK1mEv4RA4kL8NG0CVh/sN3XOGeQLHveuCnAelr64TT0aIAaUp3IeJ2w5gtw5MlWGmYD fpp3/IIBMS3Iveju4hDVmPBTRHpR0LbCqppzdwwzAgpUVZHIEJsCUuoQtl02Do7kP7SP79 OW6JT0CX1PaV4aDecaB/hpqoLzsrdxLAJabN3ANEJ+RiDyV1TjiOgO9ZbWVC8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683991037; a=rsa-sha256; cv=none; b=M/4suTGpa+Mjpkzep+tM1ONrCpas/jBFTn5ngeL7N87mfUpmBBlrdswZl5T4cESrjjyFck frxN29GEtiG/l5TnRnjT4vm49Xbt/Uzz+Hn4J8VBQH4ySmxP680AzU6AGs5f003q17rK1P U2/ibVHqidVj6V/XlOM9KOMasGxmdqajFMg0JmO/JHZasxlMr1QAQFWX4U3+kcRuGE6MHM K+pDgWJc2ytKLAXnDarthlp3gbPYP1CPMw6/qRRUXLwWdFziKZUGhqndwKHWhziWudLItR NNZVQR6hbqJAV8hGaCOHQQn7Ok0wFVmDbDF2uudoktaQLaCVpGcLHLnUapZsAA== 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 4QJTl10P7jzMpx; Sat, 13 May 2023 15:17:17 +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 34DFHGcN084097; Sat, 13 May 2023 15:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34DFHGCq084096; Sat, 13 May 2023 15:17:16 GMT (envelope-from git) Date: Sat, 13 May 2023 15:17:16 GMT Message-Id: <202305131517.34DFHGCq084096@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: da1ef2d61930 - main - Move MACHINE/MACHINE_ARCH handling to sys.machine.mk List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: da1ef2d6193036518d483a608f4b6ac753b78b96 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=da1ef2d6193036518d483a608f4b6ac753b78b96 commit da1ef2d6193036518d483a608f4b6ac753b78b96 Author: Simon J. Gerraty AuthorDate: 2023-05-13 15:15:49 +0000 Commit: Simon J. Gerraty CommitDate: 2023-05-13 15:15:49 +0000 Move MACHINE/MACHINE_ARCH handling to sys.machine.mk Rather than define the TARGETS and TARGET_ARCHES in src/Makefile put them in sys.machine.mk so they can also be leveraged by non-top-level builds. We have TARGET_MACHINE_LIST as the list of MACHINES we build for. For each MACHINE we have a MACHINE_ARCH_LIST_${MACHINE} and the first entry of each list is used as default for MACHINE_ARCH_${MACHINE} We can now remove a bunch of MACHINE_ARCH.* handling from local.sys.dirdeps*mk Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D40083 --- Makefile | 8 ++------ share/mk/local.sys.dirdeps.env.mk | 30 +++--------------------------- share/mk/local.sys.env.mk | 2 ++ share/mk/sys.machine.mk | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 0b2438a0cfc0..4658a75986f9 100644 --- a/Makefile +++ b/Makefile @@ -530,14 +530,10 @@ worlds: .PHONY # powerpcspe excluded from main list until clang fixed EXTRA_ARCHES_powerpc= powerpcspe .endif -TARGETS?=amd64 arm arm64 i386 powerpc riscv +TARGETS?= ${TARGET_MACHINE_LIST} _UNIVERSE_TARGETS= ${TARGETS} -TARGET_ARCHES_arm?= armv6 armv7 -TARGET_ARCHES_arm64?= aarch64 -TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc} -TARGET_ARCHES_riscv?= riscv64 .for target in ${TARGETS} -TARGET_ARCHES_${target}?= ${target} +TARGET_ARCHES_${target}= ${MACHINE_ARCH_LIST_${target}} .endfor .if defined(USE_GCC_TOOLCHAINS) diff --git a/share/mk/local.sys.dirdeps.env.mk b/share/mk/local.sys.dirdeps.env.mk index 3d45719ff292..fdc03cae29eb 100644 --- a/share/mk/local.sys.dirdeps.env.mk +++ b/share/mk/local.sys.dirdeps.env.mk @@ -12,41 +12,17 @@ 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 +ALL_MACHINE_LIST?= ${TARGET_MACHINE_LIST} + .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" @@ -58,7 +34,7 @@ TARGET_MACHINE= host .endif .if ${MACHINE} == "host" OBJTOP := ${HOST_OBJTOP} -MACHINE_ARCH= ${MACHINE_ARCH.${MACHINE}} +MACHINE_ARCH= ${MACHINE_ARCH_${MACHINE}} .endif diff --git a/share/mk/local.sys.env.mk b/share/mk/local.sys.env.mk index e10bf58e14e8..5444fd77652f 100644 --- a/share/mk/local.sys.env.mk +++ b/share/mk/local.sys.env.mk @@ -56,3 +56,5 @@ ECHO_TRACE?= true .include .export HOST_TARGET .endif + +.include diff --git a/share/mk/sys.machine.mk b/share/mk/sys.machine.mk new file mode 100644 index 000000000000..445aaa4b62fd --- /dev/null +++ b/share/mk/sys.machine.mk @@ -0,0 +1,23 @@ + +.-include + +PSEUDO_MACHINE_LIST?= common host +TARGET_MACHINE_LIST?= amd64 arm arm64 i386 powerpc riscv + +MACHINE_ARCH_host?= ${_HOST_ARCH} + +MACHINE_ARCH_LIST_arm?= armv6 armv7 +MACHINE_ARCH_LIST_arm64?= aarch64 +MACHINE_ARCH_LIST_powerpc?= powerpc powerpc64 powerpc64le ${EXTRA_ARCHES_powerpc} +MACHINE_ARCH_LIST_riscv?= riscv64 + +.for m in ${TARGET_MACHINE_LIST} +MACHINE_ARCH_LIST_$m?= $m +MACHINE_ARCH_$m?= ${MACHINE_ARCH_LIST_$m:[1]} +# for backwards comatability +MACHINE_ARCH.$m?= ${MACHINE_ARCH_$m} +.endfor + +.if empty(MACHINE_ARCH) +MACHINE_ARCH:= ${MACHINE_ARCH_${MACHINE}} +.endif