X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile.rules;h=76cec18ff8aaeeb53ed7e3a86e7bec47d1c0eb33;hb=442ee9c3f7f6b29ff4ca82f3fdd7e20fc9cd5ee4;hp=1c5effe65be12b6e2ad55d8dbe33074635c3851f;hpb=ae7e2a4bbbdfa82b4e2670fccb3a0aed812c3b0a;p=oota-llvm.git diff --git a/Makefile.rules b/Makefile.rules index 1c5effe65be..76cec18ff8a 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -79,7 +79,7 @@ LLVMBuildTool := $(PROJ_SRC_ROOT)/utils/llvm-build/llvm-build # The files we are going to generate using llvm-build. LLVMBuildMakeFrag := $(PROJ_OBJ_ROOT)/Makefile.llvmbuild LLVMConfigLibraryDependenciesInc := \ - $(PROJ_OBJ_ROOT)/tools/llvm-config-2/LibraryDependencies.inc + $(PROJ_OBJ_ROOT)/tools/llvm-config/LibraryDependencies.inc # This is for temporary backwards compatibility. ifndef TARGET_NATIVE_ARCH @@ -94,7 +94,8 @@ endif # # We include a dependency on this Makefile to ensure that changes to the # generation command get picked up. -$(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules +$(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules \ + $(PROJ_OBJ_ROOT)/Makefile.config $(Echo) Constructing LLVMBuild project information. $(Verb) $(LLVMBuildTool) \ --native-target "$(TARGET_NATIVE_ARCH)" \ @@ -115,6 +116,10 @@ $(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag) # building from a subdirectory, but that is always somewhat unreliable. ifeq ($(LEVEL),.) LLVMBUILD_INCLUDE_DEPENDENCIES := 1 + +# Clean the generated makefile fragment at the top-level. +clean-local:: + -$(Verb) $(RM) -f $(LLVMBuildMakeFrag) endif -include $(LLVMBuildMakeFrag) @@ -319,9 +324,9 @@ ifeq ($(ENABLE_PROFILING),1) KEEP_SYMBOLS := 1 endif -#ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1) -# CXX.Flags += -fvisibility-inlines-hidden -#endif +ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1) + CXX.Flags += -fvisibility-inlines-hidden +endif ifdef ENABLE_EXPENSIVE_CHECKS # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above. @@ -528,9 +533,9 @@ ifndef LLVM_TBLGEN endif endif ifeq ($(LLVM_CROSS_COMPILING),1) - LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config-2$(BUILD_EXEEXT) + LLVM_CONFIG := $(BuildLLVMToolDir)/llvm-config$(BUILD_EXEEXT) else - LLVM_CONFIG := $(LLVMToolDir)/llvm-config-2$(EXEEXT) + LLVM_CONFIG := $(LLVMToolDir)/llvm-config$(EXEEXT) endif ifndef LLVMLD LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT) @@ -645,7 +650,7 @@ ifndef NO_PEDANTIC CompileCommonOpts += -pedantic -Wno-long-long endif CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \ - $(EXTRA_OPTIONS) + $(EXTRA_OPTIONS) $(COVERED_SWITCH_DEFAULT) # Enable cast-qual for C++; the workaround is to use const_cast. CXX.Flags += -Wcast-qual @@ -696,7 +701,13 @@ ifeq ($(HOST_OS),AuroraUX) CPP.BaseFlags += -include llvm/Support/Solaris.h endif # !HOST_OS - AuroraUX. -LD.Flags += -L$(LibDir) -L$(LLVMLibDir) +# On Windows, SharedLibDir != LibDir. The order is important. +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + LD.Flags += -L$(SharedLibDir) -L$(LibDir) -L$(LLVMToolDir) -L$(LLVMLibDir) +else + LD.Flags += -L$(LibDir) -L$(LLVMLibDir) +endif + CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS # All -I flags should go here, so that they don't confuse llvm-config. CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ @@ -1059,7 +1070,7 @@ ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir $(Verb) echo "{" > $@ - $(Verb) grep -q "\<" $< && echo " global:" >> $@ || : + $(Verb) grep -q '[[:alnum:]_]' $< && echo " global:" >> $@ || : $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@ ifneq ($(HOST_OS),OpenBSD) $(Verb) echo " local: *;" >> $@ @@ -1481,12 +1492,23 @@ else $(ToolBuildPath): $(ToolDir)/.dir endif +ifdef CODESIGN_TOOLS $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg) $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS) $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \ $(StripWarnMsg) + $(Echo) ======= Code-Signing $(BuildMode) Executable $(TOOLNAME) + $(Verb) codesign -s - $@ +else +$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) + $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg) + $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ + $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS) + $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \ + $(StripWarnMsg) +endif ifneq ($(strip $(ToolAliasBuildPath)),) $(ToolAliasBuildPath): $(ToolBuildPath) @@ -1858,6 +1880,9 @@ $(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir $(LLVM_TBLGEN) $(Echo) "Building $(