Correcting some ripple from recent cleanup
[u/mrichter/AliRoot.git] / Makefile
index 16a276dd846b0410ae3691b5b7770faa0cc8a6bc..340db0d5b697e2010968952f393cad9fefadd924 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,8 @@ else
 MUTE:=@
 endif
 
+CLEAN=$(findstring clean,$(patsubst %clean%,clean,$(MAKECMDGOALS)))
+
 #-------------------------------------------------------------------------------
 # IRST coding rule check
 
@@ -146,23 +148,21 @@ ifndef ALIQUIET
 endif
        @share/alibtool mkmodule  $(patsubst %/module.mk,%,$@) > $@;
 
-#-------------------------------------------------------------------------------
-# If cleaning, do not include dependencies or module.mk files.
-
-ifeq ($(findstring $(MAKECMDGOALS), clean distclean clean-all clean-dicts \
-clean-modules clean-depend clean-objects clean-libs clean-bins \
-clean-check-all),)
-
 #-------------------------------------------------------------------------------
 # If making modules, not not include anything
 
-ifneq ($(findstring modules,$(MAKECMDGOALS)),modules)
+ifeq ($(findstring modules,$(MAKECMDGOALS)),)
 
 #-------------------------------------------------------------------------------
 # Include the modules
 
 -include $(patsubst %,%/module.mk,$(MODULES))
 
+#-------------------------------------------------------------------------------
+# If cleaning, do not include dependencies or module.mk files.
+
+ifeq ($(CLEAN),)
+
 #-------------------------------------------------------------------------------
 # Include dependencies if not making them!