Ignore the LibDeps.txt.tmp file.
[oota-llvm.git] / tools / llvm-config / Makefile
index fe4993d67273697df317199107e97a5a88936578..410808b1f269ed3ed99e94fc977ec2551b21b130 100644 (file)
@@ -29,16 +29,21 @@ SUB_LDFLAGS =
 
 FinalLibDeps = $(PROJ_OBJ_DIR)/FinalLibDeps.txt
 LibDeps      = $(PROJ_OBJ_DIR)/LibDeps.txt
+LibDepsTemp  = $(PROJ_OBJ_DIR)/LibDeps.txt.tmp
 GenLibDeps   = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl
 
-$(LibDeps): $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a $(LibDir)/*.o)
-       $(Echo) "Regenerating LibDeps.txt"
-       $(Verb) $(GenLibDeps) -flat $(LibDir) $(NM_PATH) > $(LibDeps)
+$(LibDepsTemp): $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a $(LibDir)/*.o)
+       $(Echo) "Regenerating LibDeps.txt.tmp"
+       $(Verb) $(GenLibDeps) -flat $(LibDir) $(NM_PATH) > $(LibDepsTemp)
+
+$(LibDeps): $(LibDepsTemp)
+       $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \
+         $(EchoCmd) Updated LibDeps.txt because dependencies changes )
 
 # Find all the cyclic dependencies between various LLVM libraries, so we
 # don't have to process them at runtime.
 $(FinalLibDeps): find-cycles.pl $(LibDeps)
-       $(Echo) "Finding cyclic dependencies between LLVM libraries."
+       $(Echo) "Checking for cyclic dependencies between LLVM libraries."
        $(Verb) $(PERL) $< < $(LibDeps) > $@ || rm -f $@
 
 # Rerun our configure substitutions as needed.