summaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc140
1 files changed, 17 insertions, 23 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 44af27d8963b6..70756d6653b4f 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -968,29 +968,10 @@ _worldtmp: .PHONY
.endif # !defined(NO_CLEAN)
@mkdir -p ${WORLDTMP}
@touch ${WORLDTMP}/${.TARGET}
-
-.for _dir in \
- lib lib/casper lib/geom usr legacy/bin legacy/usr
- mkdir -p ${WORLDTMP}/${_dir}
-.endfor
- ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
- -p ${WORLDTMP}/legacy/usr >/dev/null
- ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
- -p ${WORLDTMP}/legacy/usr/include >/dev/null
- ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
- -p ${WORLDTMP}/usr >/dev/null
- ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
- -p ${WORLDTMP}/usr/include >/dev/null
- ln -sf ${.CURDIR}/sys ${WORLDTMP}
-.if ${MK_DEBUG_FILES} != "no"
- ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
- -p ${WORLDTMP}/legacy/usr/lib >/dev/null
- ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
- -p ${WORLDTMP}/usr/lib >/dev/null
-.endif
-.for _mtree in ${LOCAL_MTREE}
- ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
-.endfor
+# We can't use mtree to create the worldtmp directories since it may not be
+# available on the target system (this happens e.g. when building on non-FreeBSD)
+ cd ${.CURDIR}/tools/build; \
+ ${MAKE} DIRPRFX=tools/build/ DESTDIR=${WORLDTMP}/legacy installdirs
_legacy:
@echo
@echo "--------------------------------------------------------------"
@@ -1003,6 +984,19 @@ _bootstrap-tools:
@echo ">>> stage 1.2: bootstrap tools"
@echo "--------------------------------------------------------------"
${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
+ mkdir -p ${WORLDTMP}/usr ${WORLDTMP}/lib/casper ${WORLDTMP}/lib/geom
+ ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
+ -p ${WORLDTMP}/usr >/dev/null
+ ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
+ -p ${WORLDTMP}/usr/include >/dev/null
+ ln -sf ${.CURDIR}/sys ${WORLDTMP}
+.if ${MK_DEBUG_FILES} != "no"
+ ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
+ -p ${WORLDTMP}/usr/lib >/dev/null
+.endif
+.for _mtree in ${LOCAL_MTREE}
+ ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
+.endfor
_cleanobj:
.if !defined(NO_CLEAN)
@echo