From 3d165b2f1edccd418471bb11c4dfb56f0b336aad Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 1 Nov 2017 21:22:13 +0000 Subject: [PATCH] native-xtools/xdev: Store these in a location including both MACHINE/TARGET. Given MACHINE/MACHINE_ARCH=amd64, TARGET=arm64 and TARGET_ARCH=aarch64, this change will build them in a location such as: /usr/obj/usr/src/amd64.amd64/nxb/arm64.aarch64/ and /usr/obj/usr/src/amd64.amd64/xdev/aarch64-freebsd/ Sponsored by: Dell EMC Isilon --- Makefile.inc1 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index ad30854bc7c4..cebe4c446fbf 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2093,7 +2093,7 @@ cross-tools: .MAKE .PHONY # already built. It then installs the static tools to NXBDESTDIR for Poudriere # to pickup. # -NXBOBJROOT= ${OBJROOT}nxb/ +NXBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/nxb/ NXBOBJTOP= ${NXBOBJROOT}${TARGET}.${TARGET_ARCH} NXTP?= /nxb-bin .if ${NXTP:N/*} @@ -2790,10 +2790,16 @@ XDTP?=/usr/${XDDIR} .error XDTP variable should be an absolute path .endif -CDBENV=MAKEOBJDIRPREFIX=${OBJTOP}/${XDDIR} \ +CDBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/xdev/ +CDBOBJTOP= ${CDBOBJROOT}${XDDIR} +CDBENV= \ INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ TOOLS_PREFIX=${XDTP} +CDMAKEARGS= \ + OBJTOP=${CDBOBJTOP:Q} \ + OBJROOT=${CDBOBJROOT:Q} +CD2MAKEARGS= ${CDMAKEARGS} .if ${WANT_COMPILER_TYPE} == gcc || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) @@ -2816,8 +2822,9 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CXXFLAGS} ${CD2CFLAGS}" MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} CDTMP= ${OBJTOP}/${XDDIR}/tmp -CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} -CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} +CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${CDMAKEARGS} ${NOFUN} +CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} \ + ${MAKE} ${CD2MAKEARGS} ${NOFUN} .if ${MK_META_MODE} != "no" # Don't rebuild build-tools targets during normal build. CD2MAKE+= BUILD_TOOLS_META=.NOMETA @@ -2849,7 +2856,7 @@ _xb-bootstrap-tools: .PHONY _xb-build-tools: .PHONY ${_+_}@cd ${.CURDIR}; \ - ${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools + ${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools XDEVDIRS= \ ${_clang_libs} \