X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllvm-config%2FMakefile;h=de89d290353a1406d51540a17efae3fc6a28bac4;hb=73b43b9b549a75fb0015c825df68abd95705a67c;hp=413fd0a53a310de13339e215f8b66dfdfdeb64b8;hpb=73ebd0974c80d2c0ab79587bb11f948e962df704;p=oota-llvm.git diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile index 413fd0a53a3..de89d290353 100644 --- a/tools/llvm-config/Makefile +++ b/tools/llvm-config/Makefile @@ -2,14 +2,15 @@ # # The LLVM Compiler Infrastructure # -# This file was developed by Reid Spencer and Eric Kidd and is distributed under -# the University of Illinois Open Source License. See LICENSE.TXT for details. +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## LEVEL = ../.. EXTRA_DIST = LibDeps.txt FinalLibDeps.txt llvm-config.in.in find-cycles.pl +REQUIRES_EH := 1 include $(LEVEL)/Makefile.common @@ -19,6 +20,8 @@ include $(LEVEL)/Makefile.common ifeq ($(HAVE_PERL),1) # Combine preprocessor flags (except for -I) and CXX flags. +SUB_CPPFLAGS = ${CPP.BaseFlags} +SUB_CFLAGS = ${CPP.BaseFlags} ${C.Flags} SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags} # This is blank for now. We need to be careful about adding stuff here: @@ -28,17 +31,22 @@ 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) | sort > $(LibDeps) +$(LibDepsTemp): $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a $(LibDir)/*.o) + $(Echo) "Regenerating LibDeps.txt.tmp" + $(Verb) $(PERL) $(GenLibDeps) -flat $(LibDir) "$(NM_PATH)" > $(LibDepsTemp) + +$(LibDeps): $(LibDepsTemp) + $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \ + $(EchoCmd) Updated LibDeps.txt because dependencies changed ) # 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." - $(Verb) $(PERL) $< < $(LibDeps) > $@ + $(Echo) "Checking for cyclic dependencies between LLVM libraries." + $(Verb) $(PERL) $< < $(LibDeps) > $@ || rm -f $@ # Rerun our configure substitutions as needed. ConfigInIn = $(PROJ_SRC_DIR)/llvm-config.in.in @@ -49,7 +57,9 @@ llvm-config.in: $(ConfigInIn) $(ConfigStatusScript) # Build our final script. $(ToolDir)/llvm-config: llvm-config.in $(FinalLibDeps) $(Echo) "Building llvm-config script." - $(Verb) $(ECHO) 's,@LLVM_CXXFLAGS@,$(SUB_CXXFLAGS),' > temp.sed + $(Verb) $(ECHO) 's,@LLVM_CPPFLAGS@,$(SUB_CPPFLAGS),' > temp.sed + $(Verb) $(ECHO) 's,@LLVM_CFLAGS@,$(SUB_CFLAGS),' >> temp.sed + $(Verb) $(ECHO) 's,@LLVM_CXXFLAGS@,$(SUB_CXXFLAGS),' >> temp.sed $(Verb) $(ECHO) 's,@LLVM_LDFLAGS@,$(SUB_LDFLAGS),' >> temp.sed $(Verb) $(ECHO) 's,@LLVM_BUILDMODE@,$(BuildMode),' >> temp.sed $(Verb) $(SED) -f temp.sed < $< > $@