Add a new MergeFunctions pass. It finds identical functions and merges them.
[oota-llvm.git] / Makefile.rules
index a9a8c34cb80cde020e5a2a60345c64541daeca87..d1b3a551dd13c4f845e434cb5493378187475078 100644 (file)
@@ -195,6 +195,11 @@ install-bytecode:: install-bytecode-local
 # VARIABLES: Set up various variables based on configuration data
 ###############################################################################
 
+# Variable for if this make is for a "cleaning" target
+ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
+  IS_CLEANING_TARGET=1
+endif
+
 #--------------------------------------------------------------------
 # Variables derived from configuration we are building
 #--------------------------------------------------------------------
@@ -313,7 +318,14 @@ ifeq ($(LLVM_CROSS_COMPILING),1)
 endif
 
 ObjRootDir  := $(PROJ_OBJ_DIR)/$(BuildMode)
-ObjDir      := $(ObjRootDir)/$(TargetMode)
+# It is very important that ObjDir not have an extra trailing
+# slash. This ends up changing the rules so that dependency file (.d)
+# information is not used at all!
+ifeq ($(TargetMode),)
+  ObjDir      := $(ObjRootDir)
+else
+  ObjDir      := $(ObjRootDir)/$(TargetMode)
+endif
 LibDir      := $(PROJ_OBJ_ROOT)/$(BuildMode)/$(TargetMode)/lib
 ToolDir     := $(PROJ_OBJ_ROOT)/$(BuildMode)/$(TargetMode)/bin
 ExmplDir    := $(PROJ_OBJ_ROOT)/$(BuildMode)/$(TargetMode)/examples
@@ -471,7 +483,7 @@ CPP.BaseFlags += -include llvm/System/Solaris.h
 endif
 
 LD.Flags      += -L$(LibDir) -L$(LLVMLibDir) 
-CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
+CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_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) \
                 $(patsubst %,-I%/include,\
@@ -739,7 +751,7 @@ LLVMUsedLibs    := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
 LLVMLibsPaths   := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs))
 endif
 
-ifeq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),)
+ifndef IS_CLEANING_TARGET
 ifdef LINK_COMPONENTS
 
 # If LLVM_CONFIG doesn't exist, build it.  This can happen if you do a make
@@ -1507,7 +1519,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))),)
+ifndef IS_CLEANING_TARGET
 
 # Get the list of dependency files
 DependFiles := $(basename $(filter %.cpp %.c %.cc, $(Sources)))