Formatting improvements.
[oota-llvm.git] / Makefile.rules
index 0f2be6503b870ac7e3c176add9cf7903b7aca7e7..685569a702d8d94d5b0572fe6abfb92bef6b6a88 100644 (file)
@@ -175,7 +175,7 @@ $(PROJ_OBJ_DIR)/Makefile% : $(PROJ_SRC_DIR)/Makefile%
             $(MKDIR) $(@D) ; \
             $(CP) -f $< $@ ;; \
        esac
-         
+
 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)
@@ -702,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))
@@ -729,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
@@ -806,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) \
@@ -1087,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"; \
@@ -1343,8 +1342,8 @@ $(PROJ_SRC_DIR)/%.cpp: $(PROJ_SRC_DIR)/%.l
        $(SED) 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
        $(SED) 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' \
          > $(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.
@@ -1386,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.