fixed up clean making deps files first
authorPatrik Gornicz <Gornicz.P@gmail.com>
Fri, 1 May 2009 22:28:23 +0000 (18:28 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Fri, 1 May 2009 22:28:23 +0000 (18:28 -0400)
Makefile

index b062fc2..59420c8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -111,6 +111,8 @@ ${DEPSDIR}%.d: ${SRCSDIR}%.cpp | $$(dir $$@)
        ${Q2}${CXX} -MM ${CXXFLAGS} $< ${INCFLAGS} | \
                sed 's/\(^.*\):/$(subst /,\/,${OBJSDIR}\1 $@):/' > $@
 
+CLEANCMDS := cleanbin cleanobjs cleandeps clean cleanall
+
 .PHONY: cleanbin
 cleanbin:
        ${Q1}${PRNTFMT} "rm" "${WORKINGDIR}"
@@ -128,9 +130,14 @@ cleandeps:
 
 .PHONY: clean
 clean: cleanobjs
+       ${Q1}${PRNTFMT} "rm" "${TARGET}"
+       ${Q2}rm -rf ${TARGET}
 
 .PHONY: cleanall
 cleanall: clean cleanbin cleandeps
 
+# Do not include deps files when doing a _single_ clean operation
+ifeq ($(findstring ${MAKECMDGOALS},${CLEANCMDS}),)
+    -include ${DEPS}
+endif
 
--include ${DEPS}