X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile.rules;h=e28ccf187aa494fe0d074e3e9207fda60d30fe47;hb=f440691a20eff24cf59ac14e10057234ae182dbe;hp=e3a1009b862bc5c4fcae94120ae43a5108335d24;hpb=e43ba3dce745de6e22b1f0e3bd9a39f053349072;p=oota-llvm.git diff --git a/Makefile.rules b/Makefile.rules index e3a1009b862..e28ccf187aa 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -159,7 +159,7 @@ endif #------------------------------------------------------------------------ ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR)) -Makefile: $(PROJ_SRC_DIR)/Makefile +Makefile: $(PROJ_SRC_DIR)/Makefile $(ExtraMakefiles) $(Echo) "Updating Makefile" $(Verb) $(MKDIR) $(@D) $(Verb) $(CP) -f $< $@ @@ -171,11 +171,11 @@ $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_SRC_DIR)/Makefile% @case '$?' in \ *Makefile.rules) ;; \ *.in) ;; \ - *) $(Echo) "Updating $(@F)" ; \ + *) $(EchoCmd) "Updating $(@F)" ; \ $(MKDIR) $(@D) ; \ $(CP) -f $< $@ ;; \ esac - + endif #------------------------------------------------------------------------ @@ -210,9 +210,9 @@ endif ifdef ENABLE_PROFILING BuildMode := Profile - CXX.Flags := $(OPTIMIZE_OPTION) -pg -g - C.Flags := $(OPTIMIZE_OPTION) -pg -g - LD.Flags := $(OPTIMIZE_OPTION) -pg -g + CXX.Flags += $(OPTIMIZE_OPTION) -pg -g + C.Flags += $(OPTIMIZE_OPTION) -pg -g + LD.Flags += $(OPTIMIZE_OPTION) -pg -g KEEP_SYMBOLS := 1 else ifeq ($(ENABLE_OPTIMIZED),1) @@ -229,14 +229,14 @@ else EXTRA_OPTIONS += -fstrict-aliasing endif - CXX.Flags := $(OPTIMIZE_OPTION) $(OmitFramePointer) - C.Flags := $(OPTIMIZE_OPTION) $(OmitFramePointer) - LD.Flags := $(OPTIMIZE_OPTION) + CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer) + C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer) + LD.Flags += $(OPTIMIZE_OPTION) else BuildMode := Debug - CXX.Flags := -g - C.Flags := -g - LD.Flags := -g + CXX.Flags += -g + C.Flags += -g + LD.Flags += -g KEEP_SYMBOLS := 1 endif endif @@ -454,12 +454,11 @@ endif LD.Flags += -L$(LibDir) -L$(LLVMLibDir) CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS # All -I flags should go here, so that they don't confuse llvm-config. -CPP.Flags += -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ - -I$(PROJ_OBJ_ROOT)/include \ - -I$(PROJ_SRC_ROOT)/include \ - -I$(LLVM_OBJ_ROOT)/include \ - -I$(LLVM_SRC_ROOT)/include \ - $(CPP.BaseFlags) +CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ + $(patsubst %,-I%/include,\ + $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \ + $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \ + $(CPP.BaseFlags) Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(CompileCommonOpts) -c LTCompile.C = $(LIBTOOL) $(LibTool.Flags) --mode=compile $(Compile.C) @@ -483,8 +482,14 @@ LTInstall = $(LIBTOOL) $(LibTool.Flags) --mode=install $(INSTALL) \ ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755 ScriptInstall = $(INSTALL) -m 0755 DataInstall = $(INSTALL) -m 0644 -TableGen = $(TBLGEN) -I $(PROJ_SRC_DIR) -I$(PROJ_SRC_ROOT)/include \ - -I $(PROJ_SRC_ROOT)/lib/Target + +# When compiling under Mingw/Cygwin, the tblgen tool expects Windows +# paths. In this case, the SYSPATH function (defined in +# Makefile.config) transforms Unix paths into Windows paths. +TableGen = $(TBLGEN) -I $(call SYSPATH, $(PROJ_SRC_DIR)) \ + -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \ + -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target) + Archive = $(AR) $(AR.Flags) LArchive = $(LLVMToolDir)/llvm-ar rcsf ifdef RANLIB @@ -696,7 +701,7 @@ ifdef LINK_COMPONENTS $(LLVM_CONFIG): @echo "*** llvm-config doesn't exist - rebuilding it." @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config - + $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG) ProjLibsOptions += $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS)) @@ -723,7 +728,7 @@ $(warning Modules require llvm-gcc but no llvm-gcc is available ****) else Module := $(LibDir)/$(MODULE_NAME).bc -LinkModule := $(LLVMLD) -L$(CFERuntimeLibDir) +LinkModule := $(LLVMLD) -L$(CFERuntimeLibDir) -r ifdef EXPORTED_SYMBOL_FILE @@ -800,7 +805,7 @@ SharedLibKindMessage := "Loadable Module" else SharedLibKindMessage := "Shared Library" endif -$(LibName.LA): $(ObjectsLO) $(LibDir)/.dir +$(LibName.LA): $(ObjectsLO) $(ProjLibsPaths) $(LLVMLibsPaths) $(LibDir)/.dir $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \ $(LIBRARYNAME)$(SHLIBEXT) $(Verb) $(LTLink) -o $@ $(ObjectsLO) $(ProjLibsOptions) \ @@ -1081,7 +1086,7 @@ ifndef DISABLE_AUTO_DEPENDENCIES DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \ -MT "$(ObjDir)/$*.lo" -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d" - + # If the build succeeded, move the dependency file over. If it failed, put an # empty file there. DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \ @@ -1248,57 +1253,57 @@ $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp $(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ $(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir $(Echo) "Building $( $(PROJ_SRC_DIR)/$*.cpp - -# IFF the .l file has changed since it was last checked into CVS, copy the .l + +# IFF the .l file has changed since it was last checked into SVN, copy the .l # file to .l.cvs and the generated .cpp file to .cpp.cvs. We use this mechanism # so that people without flex can build LLVM by copying the .cvs files to the # source location and building them. @@ -1380,7 +1385,7 @@ $(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y $(Verb) $(MV) -f $*.tab.c $(PROJ_SRC_DIR)/$*.cpp $(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h -# IFF the .y file has changed since it was last checked into CVS, copy the .y +# IFF the .y file has changed since it was last checked into SVN, copy the .y # file to .y.cvs and the generated .cpp/.h file to .cpp.cvs/.h.cvs. We use this # mechanism so that people without flex can build LLVM by copying the .cvs files # to the source location and building them. @@ -1451,7 +1456,7 @@ clean-all-local:: 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)))