diff --git a/Makefile.inc1 b/Makefile.inc1 index 2a0d1a075403..d0736817014c 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1745,11 +1745,12 @@ CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ CDENV= ${CDBENV} \ _SHLIBDIRPREFIX=${XDTP} \ TOOLS_PREFIX=${XDTP} -CD2ENV=${CDENV} \ +CD2CFLAGS=-isystem ${XDTP}/usr/include -L${XDTP}/usr/lib -B${XDTP}/usr/lib +CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" \ MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} -CDTMP= ${MAKEOBJDIRPREFIX}/${XDEV}/${.CURDIR}/tmp -CDMAKE=${CDENV} ${MAKE} ${NOFUN} +CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp +CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} XDDESTDIR=${DESTDIR}${XDTP} .if !defined(OSREL) @@ -1759,8 +1760,24 @@ OSREL!= uname -r | sed -e 's/[-(].*//' .ORDER: xdev-build xdev-install xdev: xdev-build xdev-install -.ORDER: _xb-build-tools _xb-cross-tools -xdev-build: _xb-build-tools _xb-cross-tools +.ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools +xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools + +_xb-worldtmp: + mkdir -p ${CDTMP}/usr + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ + -p ${CDTMP}/usr >/dev/null + +_xb-bootstrap-tools: +.for _tool in \ + ${_clang_tblgen} + ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ + cd ${.CURDIR}/${_tool}; \ + ${CDMAKE} DIRPRFX=${_tool}/ obj; \ + ${CDMAKE} DIRPRFX=${_tool}/ depend; \ + ${CDMAKE} DIRPRFX=${_tool}/ all; \ + ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install +.endfor _xb-build-tools: ${_+_}@cd ${.CURDIR}; \ @@ -1770,7 +1787,9 @@ _xb-cross-tools: .for _tool in \ gnu/usr.bin/binutils \ gnu/usr.bin/cc \ - usr.bin/ar + usr.bin/ar \ + ${_clang_libs} \ + ${_clang} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ obj; \ @@ -1796,7 +1815,8 @@ _xi-cross-tools: .for _tool in \ gnu/usr.bin/binutils \ gnu/usr.bin/cc \ - usr.bin/ar + usr.bin/ar \ + ${_clang} ${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \ cd ${.CURDIR}/${_tool}; \ ${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}