[llvm-commits] CVS: llvm/Makefile.rules

Reid Spencer reid at x10sys.com
Thu Oct 28 02:15:39 PDT 2004



Changes in directory llvm:

Makefile.rules updated: 1.220 -> 1.221
---
Log message:

Bug Fixes:
* Move rules that build directories earlier in the file so that they are
  always built before the things that depend on them. This enables a
  parallel "dist-check" target.
* Fix use of TOOLLINKOPTS and TOOLLINKOPTSB (thanks to Henrik Bach)
* Standardize the output - some scripts using plain echo instead of $(ECHO)


---
Diffs of the changes:  (+34 -49)

Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.220 llvm/Makefile.rules:1.221
--- llvm/Makefile.rules:1.220	Thu Oct 28 02:57:28 2004
+++ llvm/Makefile.rules	Thu Oct 28 04:15:28 2004
@@ -216,16 +216,7 @@
 
 # Adjust linker flags for building an executable
 ifdef TOOLNAME
-  LDFLAGS += -rpath $(TOOLDIR) -export-dynamic $(TOOLLINKOPTS)
-endif
-
-# Use TOOLLINKOPTSB to pass options to the linker like library search 
-# path etc.
-# Note that this is different from TOOLLINKOPTS, these options
-# are passed to the linker *before* the USEDLIBS options are passed.
-# e.g. usage TOOLLINKOPTSB =  -L/home/xxx/lib
-ifdef TOOLLINKOPTSB
-LDFLAGS += $(TOOLLINKOPTSB)
+  LDFLAGS += -rpath $(TOOLDIR) -export-dynamic
 endif
 
 #----------------------------------------------------------
@@ -251,7 +242,8 @@
 BCCompile.C   = $(LLVMGCC) $(CPPFLAGS) $(CompileCommonOpts) $(CFLAGS) -c
 Link          = $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(CPPFLAGS) \
 	        $(CompileCommonOpts) $(LDFLAGS) $(STRIP)
-Relink        = $(LIBTOOL) --tag=CXX --mode=link $(CXX)
+Relink        = $(LIBTOOL) --tag=CXX --mode=link $(CXX) $(CPPFLAGS) \
+                $(CompileCommonOpts)
 BCLinkLib     = $(LLVMGCC) -shared -nostdlib
 Burg          = $(BURG) -I $(BUILD_SRC_DIR)
 TableGen      = $(TBLGEN) -I $(BUILD_SRC_DIR)
@@ -289,6 +281,24 @@
 ###############################################################################
 
 #---------------------------------------------------------
+# Provide rules to make install dirs. This must be early
+# in the file so they get built before dependencies
+#---------------------------------------------------------
+
+$(bindir):
+	$(VERB) $(MKDIR) $(bindir)
+	
+$(libdir):
+	$(VERB) $(MKDIR) $(libdir)
+
+$(bytecode_libdir):
+	$(VERB) $(MKDIR) $(bytecode_libdir)
+
+$(sysconfdir):
+	$(VERB) $(MKDIR) $(sysconfdir)
+
+
+#---------------------------------------------------------
 # Handle the DIRS options for sequential construction
 #---------------------------------------------------------
 
@@ -381,22 +391,12 @@
 	  $(RM) -f $(sysconfdir)/$${file} ; \
 	done
 
-$(sysconfdir):
-	$(VERB) $(MKDIR) $(sysconfdir)
-
 endif
 
 ###############################################################################
 # Library Build Rules: Four ways to build a library
 ###############################################################################
 
-$(libdir):
-	$(VERB) $(MKDIR) $(libdir)
-
-$(bytecode_libdir):
-	$(VERB) $(MKDIR) $(bytecode_libdir)
-
-
 
 # if we're building a library ...
 ifdef LIBRARYNAME
@@ -552,16 +552,6 @@
 
 ifdef TOOLNAME
 
-#---------------------------------------------------------
-# TOOLLINKOPTSB to pass options to the linker like library search path etc
-# Note that this is different from TOOLLINKOPTS, these options
-# are passed to the linker *before* the USEDLIBS options are passed.
-# e.g. usage TOOLLINKOPTSB =  -L/home/xxx/lib
-#---------------------------------------------------------
-ifdef TOOLLINKOPTSB
-Link    += $(TOOLLINKOPTSB) 
-endif
-
 # TOOLEXENAME - This is the output filenames to generate
 TOOLEXENAME := $(TOOLDIR)/$(TOOLNAME)
 
@@ -577,9 +567,6 @@
 PROJ_LIBS_PATHS   := $(addprefix $(LIBDIR)/,$(PROJ_USED_LIBS))
 LLVM_LIBS_PATHS   := $(addprefix $(LLVMLIBDIR)/,$(LLVM_USED_LIBS))
 
-# Concatenate all the optoins
-LINK_OPTS := $(TOOLLINKOPTS) $(PROJ_LIBS_OPTIONS) $(LLVM_LIBS_OPTIONS)
-
 # Handle compression libraries automatically
 ifeq ($(HAVE_BZIP2),1)
 LIBS += -lbz2
@@ -601,7 +588,8 @@
 
 $(TOOLEXENAME): $(BUILT_SOURCES) $(ObjectsO) $(PROJ_LIBS_PATHS) $(LLVM_LIBS_PATHS) $(TOOLDIR)/.dir
 	@$(ECHO) Linking $(CONFIGURATION) executable $(TOOLNAME) $(STRIP_WARN_MSG)
-	$(VERB) $(Link) -o $@ $(ObjectsO) $(PROJ_LIBS_OPTIONS) $(LLVM_LIBS_OPTIONS) $(LIBS)
+	$(VERB) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(PROJ_LIBS_OPTIONS) \
+          $(LLVM_LIBS_OPTIONS) $(LIBS) $(TOOLLINKOPTSB)
 	@$(ECHO) ======= Finished Linking $(CONFIGURATION) Executable $(TOOLNAME) $(STRIP_WARN_MSG) 
 
 DestTool = $(bindir)/$(TOOLNAME)
@@ -612,9 +600,6 @@
 	@$(ECHO) Installing $(CONFIGURATION) $(DestTool)
 	$(VERB) $(INSTALL) $(TOOLEXENAME) $(DestTool)
 
-$(bindir):
-	$(VERB) $(MKDIR) $(bindir)
-	
 uninstall-local::
 	@$(ECHO) Uninstalling $(CONFIGURATION) $(DestTool)
 	$(VERB) $(RM) -f $(DestTool)
@@ -713,43 +698,43 @@
 $(INCFILES) : $(TBLGEN) $(TDFILES)
 
 %GenRegisterNames.inc : %.td 
-	@echo "Building $(<F) register names with tblgen"
+	@$(ECHO) "Building $(<F) register names with tblgen"
 	$(VERB) $(TableGen) -gen-register-enums -o $@ $<
 
 %GenRegisterInfo.h.inc : %.td 
-	@echo "Building $(<F) register information header with tblgen"
+	@$(ECHO) "Building $(<F) register information header with tblgen"
 	$(VERB) $(TableGen) -gen-register-desc-header -o $@ $<
 
 %GenRegisterInfo.inc : %.td
-	@echo "Building $(<F) register info implementation with tblgen"
+	@$(ECHO) "Building $(<F) register info implementation with tblgen"
 	$(VERB) $(TableGen) -gen-register-desc -o $@ $<
 
 %GenInstrNames.inc : %.td
-	@echo "Building $(<F) instruction names with tblgen"
+	@$(ECHO) "Building $(<F) instruction names with tblgen"
 	$(VERB) $(TableGen) -gen-instr-enums -o $@ $<
 
 %GenInstrInfo.inc : %.td
-	@echo "Building $(<F) instruction information with tblgen"
+	@$(ECHO) "Building $(<F) instruction information with tblgen"
 	$(VERB) $(TableGen) -gen-instr-desc -o $@ $<
 
 %GenAsmWriter.inc : %.td
-	@echo "Building $(<F) assembly writer with tblgen"
+	@$(ECHO) "Building $(<F) assembly writer with tblgen"
 	$(VERB) $(TableGen) -gen-asm-writer -o $@ $<
 
 %GenATTAsmWriter.inc : %.td
-	@echo "Building $(<F) AT&T assembly writer with tblgen"
+	@$(ECHO) "Building $(<F) AT&T assembly writer with tblgen"
 	$(VERB) $(TableGen) -gen-asm-writer -o $@ $< 
 
 %GenIntelAsmWriter.inc : %.td
-	@echo "Building $(<F) Intel assembly writer with tblgen"
+	@$(ECHO) "Building $(<F) Intel assembly writer with tblgen"
 	$(VERB) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $@ $< 
 
 %GenInstrSelector.inc: %.td
-	@echo "Building $(<F) instruction selector with tblgen"
+	@$(ECHO) "Building $(<F) instruction selector with tblgen"
 	$(VERB) $(TableGen) -gen-instr-selector -o $@ $< 
 
 %GenCodeEmitter.inc:: %.td
-	@echo "Building $(<F) code emitter with tblgen"
+	@$(ECHO) "Building $(<F) code emitter with tblgen"
 	$(VERB) $(TableGen) -gen-emitter -o $@ $<
 
 clean-local::
@@ -973,7 +958,7 @@
 	    find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';'  || \
 	      exit 1 ; \
 	  fi ; \
-	  echo Removing $(DistDir) ; \
+	  $(ECHO) Removing $(DistDir) ; \
 	  $(RM) -rf $(DistDir); \
 	fi
 	$(VERB) $(MKDIR) $(DistDir) 






More information about the llvm-commits mailing list