diff --git a/Makefile.inc1 b/Makefile.inc1 index d19f84f73726..b2c745c5990d 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -817,19 +817,11 @@ _worldtmp: .PHONY @echo "--------------------------------------------------------------" .if !defined(NO_CLEAN) rm -rf ${WORLDTMP} -.if defined(LIBCOMPAT) - rm -rf ${LIBCOMPATTMP} -.endif .else .if exists(${WORLDTMP}) @echo ">>> Deleting stale files in build tree..." ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ delete-old delete-old-libs >/dev/null -.endif -.if defined(LIBCOMPAT) && exists(${LIBCOMPATTMP}) - ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ - DESTDIR=${LIBCOMPATTMP} \ - delete-old delete-old-libs >/dev/null .endif rm -rf ${WORLDTMP}/legacy/usr/include .if ${USING_SYSTEM_COMPILER} == "yes" diff --git a/Makefile.libcompat b/Makefile.libcompat index 4a3d777a279b..43d6273053d6 100644 --- a/Makefile.libcompat +++ b/Makefile.libcompat @@ -148,6 +148,16 @@ build${libcompat}: .PHONY @echo "--------------------------------------------------------------" @echo ">>> stage 5.1: building lib${libcompat} shim libraries" @echo "--------------------------------------------------------------" +.if !defined(NO_CLEAN) + rm -rf ${LIBCOMPATTMP} +.else +.if exists(${LIBCOMPATTMP}) + ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ + DESTDIR=${LIBCOMPATTMP} \ + delete-old delete-old-libs >/dev/null +.endif +.endif # !defined(NO_CLEAN) + mkdir -p ${LIBCOMPATTMP}/usr/include mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ -p ${LIBCOMPATTMP}/usr >/dev/null