summaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2017-11-01 21:22:10 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2017-11-01 21:22:10 +0000
commitc10062b9bfd568e453bb4d6a625c3def48f0b6e8 (patch)
tree4ac3db748b56acc7c5bce7c26df4f4d33edfdf40 /Makefile.inc1
parentdfa099890c456aed9b7924373d4dc2f013856c04 (diff)
downloadsrc-test2-c10062b9bfd568e453bb4d6a625c3def48f0b6e8.tar.gz
src-test2-c10062b9bfd568e453bb4d6a625c3def48f0b6e8.zip
Add a 'make cleanuniverse'.
This will remove all build files for the source directory when MK_UNIFIED_OBJDIR is enabled. Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=325289
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc119
1 files changed, 13 insertions, 6 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 5d33ac280b0f..ad30854bc7c4 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2751,14 +2751,21 @@ builddtb: .PHONY
# in this makefile. We don't do a cleandir walk if MK_AUTO_OBJ is yes
# since it is not possible for files to land in the wrong place.
#
-BW_CANONICALOBJDIR:=${OBJTOP}
-cleanworld: .PHONY
-.if exists(${BW_CANONICALOBJDIR}/)
- -rm -rf ${BW_CANONICALOBJDIR}/*
+.if make(cleanworld)
+BW_CANONICALOBJDIR:=${OBJTOP}/
+.elif make(cleanuniverse)
+BW_CANONICALOBJDIR:=${OBJROOT}
+.if ${MK_UNIFIED_OBJDIR} == "no"
+.error ${.TARGETS} only supported with WITH_UNIFIED_OBJDIR enabled.
+.endif
+.endif
+cleanworld cleanuniverse: .PHONY
+.if !empty(BW_CANONICALOBJDIR) && exists(${BW_CANONICALOBJDIR})
+ -rm -rf ${BW_CANONICALOBJDIR}*
-chflags -R 0 ${BW_CANONICALOBJDIR}
- rm -rf ${BW_CANONICALOBJDIR}/*
+ rm -rf ${BW_CANONICALOBJDIR}*
.endif
-.if ${MK_AUTO_OBJ} == "no"
+.if make(cleanworld) && ${MK_AUTO_OBJ} == "no"
.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
# To be safe in this case, fall back to a 'make cleandir'
${_+_}@cd ${.CURDIR}; ${MAKE} cleandir