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

Reid Spencer reid at x10sys.com
Thu Nov 18 02:03:58 PST 2004



Changes in directory llvm:

Makefile.rules updated: 1.236 -> 1.237
---
Log message:

Fix PR456: http://llvm.cs.uiuc.edu/PR456 :\
Tools and libraries will be built into $(BUILD_OBJ_ROOT)/$(BuildMode)/bin and \
$(BUILD_OBJ_ROOT)/$(BuildMode)/lib, respectively. Furthermore, the example \
programs will go in $(BUILD_OBJ_ROOT)/$(BuildMode)/examples to keep them \
separate from the tools and hopefully out of the PATH. Install targets \
have not changed.

---
Diffs of the changes:  (+24 -8)

Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.236 llvm/Makefile.rules:1.237
--- llvm/Makefile.rules:1.236	Wed Nov 17 13:08:44 2004
+++ llvm/Makefile.rules	Thu Nov 18 04:03:46 2004
@@ -176,10 +176,12 @@
 # Directory locations
 #--------------------------------------------------------------------
 ObjDir      := $(BUILD_OBJ_DIR)/$(BuildMode)
-LibDir      := $(BUILD_OBJ_ROOT)/lib/$(BuildMode)
-ToolDir     := $(BUILD_OBJ_ROOT)/tools/$(BuildMode)
-LLVMLibDir  := $(LLVM_OBJ_ROOT)/lib/$(BuildMode)
-LLVMToolDir := $(LLVM_OBJ_ROOT)/tools/$(BuildMode)
+LibDir      := $(BUILD_OBJ_ROOT)/$(BuildMode)/lib
+ToolDir     := $(BUILD_OBJ_ROOT)/$(BuildMode)/tools
+ExmplDir    := $(BUILD_OBJ_ROOT)/$(BuildMode)/examples
+LLVMLibDir  := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
+LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/tools
+LExmplDir   := $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
 
 #--------------------------------------------------------------------
 # Full Paths To Compiled Tools and Utilities
@@ -248,8 +250,12 @@
 
 # Adjust linker flags for building an executable
 ifdef TOOLNAME
+ifdef EXAMPLE_TOOL
+  LD.Flags += -rpath $(ExmplDir) -export-dynamic
+else
   LD.Flags += -rpath $(ToolDir) -export-dynamic
 endif
+endif
 
 #----------------------------------------------------------
 # Options To Invoke Tools
@@ -337,8 +343,8 @@
 	$(Verb) $(MKDIR) $* > /dev/null
 	@$(DATE) > $@
 
-.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(LLVMLibDir)/.dir
-.PRECIOUS: $(LLVMToolDir)/.dir
+.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
+.PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
 
 #---------------------------------------------------------
 # Handle the DIRS options for sequential construction
@@ -609,7 +615,11 @@
 #---------------------------------------------------------
 # Set up variables for building a tool.
 #---------------------------------------------------------
+ifdef EXAMPLE_TOOL
+ToolBuildPath   := $(ExmplDir)/$(TOOLNAME)$(EXEEXT)
+else
 ToolBuildPath   := $(ToolDir)/$(TOOLNAME)$(EXEEXT)
+endif
 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o,  $(ProjLibsOptions))
 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
@@ -647,8 +657,13 @@
 	-$(Verb) $(RM) -f $(ToolBuildPath)
 endif
 
-$(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)\
-                  $(ToolDir)/.dir
+ifdef EXAMPLE_TOOL
+$(ToolBuildPath): $(ExmplDir)/.dir
+else
+$(ToolBuildPath): $(ToolDir)/.dir
+endif
+
+$(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
 	$(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
 	$(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
           $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB)
@@ -1194,6 +1209,7 @@
 	$(Echo) "ObjDir         : " '$(ObjDir)'
 	$(Echo) "LibDir         : " '$(LibDir)'
 	$(Echo) "ToolDir        : " '$(ToolDir)'
+	$(Echo) "ExmplDir       : " '$(ExmplDir)'
 	$(Echo) "TDFiles        : " '$(TDFiles)'
 	$(Echo) "INCFiles       : " '$(INCFiles)'
 	$(Echo) "Compile.CXX    : " '$(Compile.CXX)'






More information about the llvm-commits mailing list