llvm.org GIT mirror llvm / 815cbcf
Fix 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17953 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 14 years ago
5 changed file(s) with 28 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
175175 # Directory locations
176176 #--------------------------------------------------------------------
177177 ObjDir := $(BUILD_OBJ_DIR)/$(BuildMode)
178 LibDir := $(BUILD_OBJ_ROOT)/lib/$(BuildMode)
179 ToolDir := $(BUILD_OBJ_ROOT)/tools/$(BuildMode)
180 LLVMLibDir := $(LLVM_OBJ_ROOT)/lib/$(BuildMode)
181 LLVMToolDir := $(LLVM_OBJ_ROOT)/tools/$(BuildMode)
178 LibDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/lib
179 ToolDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/tools
180 ExmplDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/examples
181 LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib
182 LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/tools
183 LExmplDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/examples
182184
183185 #--------------------------------------------------------------------
184186 # Full Paths To Compiled Tools and Utilities
247249
248250 # Adjust linker flags for building an executable
249251 ifdef TOOLNAME
252 ifdef EXAMPLE_TOOL
253 LD.Flags += -rpath $(ExmplDir) -export-dynamic
254 else
250255 LD.Flags += -rpath $(ToolDir) -export-dynamic
256 endif
251257 endif
252258
253259 #----------------------------------------------------------
336342 $(Verb) $(MKDIR) $* > /dev/null
337343 @$(DATE) > $@
338344
339 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(LLVMLibDir)/.dir
340 .PRECIOUS: $(LLVMToolDir)/.dir
345 .PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir
346 .PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir
341347
342348 #---------------------------------------------------------
343349 # Handle the DIRS options for sequential construction
608614 #---------------------------------------------------------
609615 # Set up variables for building a tool.
610616 #---------------------------------------------------------
617 ifdef EXAMPLE_TOOL
618 ToolBuildPath := $(ExmplDir)/$(TOOLNAME)$(EXEEXT)
619 else
611620 ToolBuildPath := $(ToolDir)/$(TOOLNAME)$(EXEEXT)
621 endif
612622 ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
613623 ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions))
614624 LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
646656 -$(Verb) $(RM) -f $(ToolBuildPath)
647657 endif
648658
649 $(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)\
650 $(ToolDir)/.dir
659 ifdef EXAMPLE_TOOL
660 $(ToolBuildPath): $(ExmplDir)/.dir
661 else
662 $(ToolBuildPath): $(ToolDir)/.dir
663 endif
664
665 $(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
651666 $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
652667 $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
653668 $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB)
11931208 $(Echo) "ObjDir : " '$(ObjDir)'
11941209 $(Echo) "LibDir : " '$(LibDir)'
11951210 $(Echo) "ToolDir : " '$(ToolDir)'
1211 $(Echo) "ExmplDir : " '$(ExmplDir)'
11961212 $(Echo) "TDFiles : " '$(TDFiles)'
11971213 $(Echo) "INCFiles : " '$(INCFiles)'
11981214 $(Echo) "Compile.CXX : " '$(Compile.CXX)'
88
99 LEVEL = ../..
1010 TOOLNAME = BFtoLLVM
11 EXAMPLE_TOOL = 1
1112 include $(LEVEL)/Makefile.common
88
99 LEVEL = ../..
1010 TOOLNAME = Fibonacci
11 EXAMPLE_TOOL = 1
1112
1213 # Enable JIT support
1314 include $(LEVEL)/tools/Makefile.JIT
77 ##===----------------------------------------------------------------------===##
88 LEVEL = ../..
99 TOOLNAME = HowToUseJIT
10 EXAMPLE_TOOL = 1
1011
1112 # Enable JIT support
1213 include $(LEVEL)/tools/Makefile.JIT
77 ##===----------------------------------------------------------------------===##
88 LEVEL=../..
99 TOOLNAME=ModuleMaker
10 EXAMPLE_TOOL = 1
1011 USEDLIBS= LLVMBCWriter LLVMCore LLVMSupport.a LLVMSystem.a
1112
1213 include $(LEVEL)/Makefile.common