Make the text of this file a little more useful.
[oota-llvm.git] / Makefile.rules
index 25a866d18ace8d2c538cf9754a0dd7b7adbe1912..835773bfa7457b0d0ae8ffff857262387e988b45 100644 (file)
@@ -256,10 +256,24 @@ LLVMGCC := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/gcc
 LLVMGXX := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/g++
 
 #--------------------------------------------------------------------------
-# Some of the compiled LLVM tools which are used for compilation of runtime
-# libraries.
+# The compiled LLVM tools
 #
+
 LLVMAS  := $(LLVMTOOLCURRENT)/llvm-as$(EXEEXT)
+# Find the location of the platform specific LLVM GCC libraries
+LLVMGCCLIBDIR=$(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))
+# LLVM Tool Definitions (LLVMGCC, LLVMGXX, LLVMAS are provided by
+# Makefile.rules) 
+LLI       = $(LLVMTOOLCURRENT)/lli$(EXEEXT)
+LLC       = $(LLVMTOOLCURRENT)/llc$(EXEEXT)
+LGCCAS    = $(LLVMTOOLCURRENT)/gccas$(EXEEXT)
+LGCCLD    = $(LGCCLDPROG) -L$(LLVMGCCLIBDIR) -L$(LLVMGCCDIR)/lib
+LDIS      = $(LLVMTOOLCURRENT)/llvm-dis$(EXEEXT)
+LOPT      = $(LLVMTOOLCURRENT)/opt$(EXEEXT)
+LLINK     = $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT)
+LPROF     = $(LLVMTOOLCURRENT)/llvm-prof$(EXEEXT)
+LANALYZE  = $(LLVMTOOLCURRENT)/analyze$(EXEEXT)
+LBUGPOINT = $(LLVMTOOLCURRENT)/bugpoint$(EXEEXT)
 
 
 ###########################################################################
@@ -302,7 +316,7 @@ CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions
 #
 # Compile commands with libtool.
 #
-Compile  := $(LIBTOOL) --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
+Compile  := $(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
 CompileC  := $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(CompileCommonOpts)
 
 # Compile a cpp file, don't link...
@@ -323,7 +337,7 @@ CompileCP := $(CompileC) $(CompileOptimizeOpts) $(PROFILE)
 # Link final executable
 #      (Note that we always link with the C++ compiler).
 #
-Link     := $(LIBTOOL) --mode=link $(CXX)
+Link     := $(LIBTOOL) --tag=CXX --mode=link $(CXX)
 
 # link both projlib and llvmlib libraries
 LinkG    := $(Link) -g -L$(PROJLIBDEBUGSOURCE)  -L$(LLVMLIBDEBUGSOURCE) $(STRIP)
@@ -341,7 +355,7 @@ LinkP    := $(LinkP) $(TOOLLINKOPTSB)
 endif
 
 # Create one .o file from a bunch of .o files...
-Relink := ${LIBTOOL} --mode=link $(CXX)
+Relink := ${LIBTOOL} --tag=CXX --mode=link $(CXX)
 
 #
 # Configure where the item being compiled should go.
@@ -441,6 +455,22 @@ all install clean test bytecode stripped-bytecode install-bytecode::
        done
 endif
 
+#---------------------------------------------------------
+# Handle the CONFIG_FILES options
+#---------------------------------------------------------
+ifdef CONFIG_FILES
+install:: install-config-files
+
+$(sysconfdir):
+       $(MKDIR) $(sysconfdir)
+
+install-config-files: $(sysconfdir) $(CONFIG_FILES)
+       $(VERB) echo Installing Configuration Files To $(sysconfdir)
+       $(VERB) for file in $(CONFIG_FILES); do \
+               $(INSTALL) $(SourceDir)/$${file} $(sysconfdir) ; \
+       done
+endif
+
 ###########################################################################
 # Library Build Rules:
 #
@@ -704,6 +734,7 @@ endif
 #---------------------------------------------------------
 .PRECIOUS: $(BUILD_OBJ_DIR)/Depend/.dir $(BUILD_OBJ_DIR)/BytecodeObj/.dir
 .PRECIOUS: $(BUILD_OBJ_DIR)/Debug/.dir $(BUILD_OBJ_DIR)/Release/.dir
+.PRECIOUS: $(BUILD_OBJ_DIR)/Profile/.dir
 
 # Create .lo files in the ObjectFiles directory from the .cpp and .c files...
 $(BUILD_OBJ_DIR)/Release/%.lo: %.cpp $(BUILD_OBJ_DIR)/Release/.dir