Make LINK_COMPONENTS interact well with make clean
[oota-llvm.git] / Makefile.rules
index ae1adc3663e6126dd8fd49fb47f1a88185475219..b48b906cb779f0bc8f069e8556ed3f9bb6ddb947 100644 (file)
@@ -707,10 +707,12 @@ LLVMUsedLibs    := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
 LLVMLibsPaths   := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
 endif
 
+ifneq ($(strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),)
 ifdef LINK_COMPONENTS
 ProjLibsOptions := $(shell $(LLVM_CONFIG) --libs     $(LINK_COMPONENTS))
 ProjLibsPaths   := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS))
 endif
+endif
 
 ###############################################################################
 # Library Build Rules: Four ways to build a library
@@ -1415,7 +1417,7 @@ CTAGS:
 ifndef DISABLE_AUTO_DEPENDENCIES
 
 # If its not one of the cleaning targets
-ifneq ($strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS))),)
+ifneq ($(strip($(filter-out clean clean-local dist-clean,$(MAKECMDGOALS)))),)
 
 # Get the list of dependency files
 DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))