aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2015-11-09 23:36:57 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2015-11-09 23:36:57 +0000
commitddd945c7b5b0d0d0641cb568abbe6e84ece1ec17 (patch)
treed728d6ff8f7362da9dcdd154bd80cd0f01fafff2 /Makefile.inc1
parent2753ba1ab6248821e78e11598af24a3183d3b69c (diff)
downloadsrc-ddd945c7b5b0d0d0641cb568abbe6e84ece1ec17.tar.gz
src-ddd945c7b5b0d0d0641cb568abbe6e84ece1ec17.zip
Fix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees.
This simplifies the logic to always try removing the objdir if it exists and to fallback on a 'cleandir' if no objdir exists. The reasoning for this is to avoid rm -rf src/* (r126024) Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=290627
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc18
1 files changed, 2 insertions, 6 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index d6942f0822f2..50a0f8ba5c8a 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2219,20 +2219,16 @@ builddtb:
# created by bsd.obj.mk, except that we don't want to .include that file
# in this makefile.
#
-BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
+BW_CANONICALOBJDIR:=${OBJTREE}${.CURDIR}
cleanworld: .PHONY
-.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
.if exists(${BW_CANONICALOBJDIR}/)
-rm -rf ${BW_CANONICALOBJDIR}/*
-chflags -R 0 ${BW_CANONICALOBJDIR}
rm -rf ${BW_CANONICALOBJDIR}/*
.endif
+.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
# To be safe in this case, fall back to a 'make cleandir'
${_+_}@cd ${.CURDIR}; ${MAKE} cleandir
-.else
- -rm -rf ${.OBJDIR}/*
- -chflags -R 0 ${.OBJDIR}
- rm -rf ${.OBJDIR}/*
.endif
.if defined(TARGET) && defined(TARGET_ARCH)