summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-02-16 20:18:25 +0000
committergad <gad@FreeBSD.org>2004-02-16 20:18:25 +0000
commit80b725fa150ba392556b12b559adc42643393cc0 (patch)
tree61fad72c1d8c9f6ec8b93413b1830a78b2dfb20c /Makefile
parentbc27cba087649bc45346c9a2c126cd4b9817b542 (diff)
downloadFreeBSD-src-80b725fa150ba392556b12b559adc42643393cc0.zip
FreeBSD-src-80b725fa150ba392556b12b559adc42643393cc0.tar.gz
Add a 'realclean' target, which simply and quickly removes everything
that was built in previous 'make buildworld' and 'make buildkernel'. The target knows enough to run a 'chflags -R 0' and a second 'rm' if the first 'rm' ran into any errors while removing files. Suggested by: email with Richard Coleman Re: upcoming 64b-time_t changes. Reviewed by: imp, marcel, and others on -hackers MFC after: 1 week
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index fccd360..487535c 100644
--- a/Makefile
+++ b/Makefile
@@ -104,6 +104,21 @@ buildworld: upgrade_checks
.endif
#
+# This 'realclean' target is not included in TGTS, because it is not
+# a recursive target. All of the work for it is done right here.
+# The first 'rm' will usually remove all files and directories. If
+# it does not, then there are probably some files with chflags set.
+# Unset all special chflags, and try the 'rm' a second time.
+realclean :
+ -rm -Rf ${.OBJDIR}/* 2>/dev/null
+ @-if [ "`echo ${.OBJDIR}/*`" != "${.OBJDIR}/*" ] ; then \
+ echo "chflags -R 0 ${.OBJDIR}/*" ; \
+ chflags -R 0 ${.OBJDIR}/* ; \
+ echo "rm -Rf ${.OBJDIR}/*" ; \
+ rm -Rf ${.OBJDIR}/* ; \
+ fi
+
+#
# Handle the user-driven targets, using the source relative mk files.
#
OpenPOWER on IntegriCloud