X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile.rules;h=b7edfbaeaad324fe2e5029236c238e86ad860d7b;hb=57c68f972cbc97c220989167bed6b5ef902c56df;hp=c0ded8e07ad6bf036ce6fc2aeca3bef217075555;hpb=8d69414022333a5ba2700c4176e81d56c10d9458;p=oota-llvm.git diff --git a/Makefile.rules b/Makefile.rules index c0ded8e07ad..b7edfbaeaad 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -57,6 +57,62 @@ VPATH=$(PROJ_SRC_DIR) $(UserTargets):: +#------------------------------------------------------------------------ +# LLVMBuild Integration +#------------------------------------------------------------------------ +# +# We use llvm-build to generate all the data required by the Makefile based +# build system in one swoop: +# +# - We generate a file (a Makefile fragment) in the object root which contains +# all the definitions that are required by Makefiles across the entire +# project. +# +# - We generate the library table used by llvm-config. +# +# - We generate the dependencies for the Makefile fragment, so that we will +# automatically reconfigure outselves. + +# The path to the llvm-build tool itself. +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 + +# The rule to create the LLVMBuild Makefile fragment as well as the llvm-config +# library table. +# +# Note that this target gets its real dependencies generated for us by +# llvm-build. +# +# We include a dependency on this Makefile to ensure that changes to the +# generation command get picked up. +$(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules + $(Echo) Constructing LLVMBuild project information. + $(Verb) $(LLVMBuildTool) \ + --native-target "$(ARCH)" \ + --enable-targets "$(TARGETS_TO_BUILD)" \ + --write-library-table $(LLVMConfigLibraryDependenciesInc) \ + --write-make-fragment $(LLVMBuildMakeFrag) + +# For completeness, let Make know how the extra files are generated. +$(LLVMConfigLibraryDependenciesInc): $(LLVMBuildMakeFrag) + +# Include the generated Makefile fragment. +# +# We currently only include the dependencies for the fragment itself if we are +# at the top-level. Otherwise, recursive invocations would ends up doing +# substantially more redundant stat'ing. +# +# This means that we won't properly regenerate things for developers used to +# building from a subdirectory, but that is always somewhat unreliable. +ifeq ($(LEVEL),.) +LLVMBUILD_INCLUDE_DEPENDENCIES := 1 +endif +-include $(LLVMBuildMakeFrag) + ################################################################################ # PRECONDITIONS: that which must be built/checked first ################################################################################ @@ -245,6 +301,9 @@ else endif endif +#CXX.Flags += -stdlib=libc++ +#LD.Flags += -stdlib=libc++ + ifeq ($(ENABLE_PROFILING),1) BuildMode := $(BuildMode)+Profile CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g @@ -457,7 +516,7 @@ ifndef LLVM_TBLGEN LLVM_TBLGEN := $(LLVMToolDir)/llvm-tblgen$(EXEEXT) endif endif -LLVM_CONFIG := $(LLVMToolDir)/llvm-config +LLVM_CONFIG := $(LLVMToolDir)/llvm-config-2$(EXEEXT) ifndef LLVMLD LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT) endif @@ -1826,7 +1885,6 @@ clean-local:: ifneq ($(strip $(ObjRootDir)),) -$(Verb) $(RM) -rf $(ObjRootDir) endif - -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set -$(Verb) $(RM) -f *$(SHLIBEXT) endif