git: e9cfd2dc7e20 - stable/12 - Partially MFC 7d0c2b1131b68, to enable MAKE_PARAMS per target_arch

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Tue, 21 Dec 2021 16:02:07 UTC
The branch stable/12 has been updated by dim:

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

commit e9cfd2dc7e207b65ed6c9aa706b3a2872f24f2be
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2020-08-17 20:11:43 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-12-21 15:56:30 +0000

    Partially MFC 7d0c2b1131b68, to enable MAKE_PARAMS per target_arch
    
    This commit made it possible to use different MAKE_PARAMS for each
    ${target_arch} value, instead of forcing the same MAKE_PARAMS for all of
    the ${target_arch} values under one target. I.e, after this you can
    build arm.arm with gcc, while building arm.armv6 and arm.armv7 with
    clang.
    
    (cherry picked from commit 7d0c2b1131b68f5b120b2df0784cb9da5688f8d9)
---
 Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 9ad32d27fc1d..5f80dd5382a3 100644
--- a/Makefile
+++ b/Makefile
@@ -578,7 +578,7 @@ universe_${target}_worlds: .PHONY
 _need_clang_${target}_${target_arch} != \
 	env TARGET=${target} TARGET_ARCH=${target_arch} \
 	${SUB_MAKE} -C ${.CURDIR} -f Makefile.inc1 test-system-compiler \
-	    ${MAKE_PARAMS_${target}} -V MK_CLANG_BOOTSTRAP 2>/dev/null || \
+	    ${MAKE_PARAMS_${target_arch}} -V MK_CLANG_BOOTSTRAP 2>/dev/null || \
 	    echo unknown
 .export _need_clang_${target}_${target_arch}
 .endif
@@ -586,7 +586,7 @@ _need_clang_${target}_${target_arch} != \
 _need_lld_${target}_${target_arch} != \
 	env TARGET=${target} TARGET_ARCH=${target_arch} \
 	${SUB_MAKE} -C ${.CURDIR} -f Makefile.inc1 test-system-linker \
-	    ${MAKE_PARAMS_${target}} -V MK_LLD_BOOTSTRAP 2>/dev/null || \
+	    ${MAKE_PARAMS_${target_arch}} -V MK_LLD_BOOTSTRAP 2>/dev/null || \
 	    echo unknown
 .export _need_lld_${target}_${target_arch}
 .endif
@@ -600,14 +600,14 @@ _need_lld_${target}_${target_arch} != \
 # XXX: Passing HOST_OBJTOP into the PATH would allow skipping legacy,
 #      bootstrap-tools, and cross-tools.  Need to ensure each tool actually
 #      supports all TARGETS though.
-MAKE_PARAMS_${target}+= \
+MAKE_PARAMS_${target_arch}+= \
 	XCC="${HOST_OBJTOP}/tmp/usr/bin/cc" \
 	XCXX="${HOST_OBJTOP}/tmp/usr/bin/c++" \
 	XCPP="${HOST_OBJTOP}/tmp/usr/bin/cpp"
 .endif
 .if defined(_need_lld_${target}_${target_arch}) && \
     ${_need_lld_${target}_${target_arch}} == "yes"
-MAKE_PARAMS_${target}+= \
+MAKE_PARAMS_${target_arch}+= \
 	XLD="${HOST_OBJTOP}/tmp/usr/bin/ld"
 .endif
 .endfor
@@ -630,7 +630,7 @@ universe_${target}_${target_arch}: universe_${target}_prologue .MAKE .PHONY
 	    ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \
 	    TARGET=${target} \
 	    TARGET_ARCH=${target_arch} \
-	    ${MAKE_PARAMS_${target}} \
+	    ${MAKE_PARAMS_${target_arch}} \
 	    > _.${target}.${target_arch}.${UNIVERSE_TARGET} 2>&1 || \
 	    (echo "${target}.${target_arch} ${UNIVERSE_TARGET} failed," \
 	    "check _.${target}.${target_arch}.${UNIVERSE_TARGET} for details" | \
@@ -694,7 +694,7 @@ universe_kernconf_${TARGET}_${kernel}: .MAKE
 	    ${SUB_MAKE} ${JFLAG} buildkernel \
 	    TARGET=${TARGET} \
 	    TARGET_ARCH=${TARGET_ARCH_${kernel}} \
-	    ${MAKE_PARAMS_${TARGET}} \
+	    ${MAKE_PARAMS_${TARGET_ARCH}} \
 	    KERNCONF=${kernel} \
 	    > _.${TARGET}.${kernel} 2>&1 || \
 	    (echo "${TARGET} ${kernel} kernel failed," \