first commit of new LTO system. It is not hooked up in the llvm/tools/Makefile,...
[oota-llvm.git] / tools / lto2 / Makefile
1 ##===- tools/lto2/Makefile ---------------------------------*- Makefile -*-===##
2
3 #                     The LLVM Compiler Infrastructure
4 #
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
7
8 ##===----------------------------------------------------------------------===##
9
10 LEVEL = ../..
11 LIBRARYNAME = LTO
12
13 # Include this here so we can get the configuration of the targets
14 # that have been configured for construction. We have to do this 
15 # early so we can set up LINK_COMPONENTS before includeing Makefile.rules
16 include $(LEVEL)/Makefile.config
17
18 LINK_LIBS_IN_SHARED = 1
19 ifeq ($(OS),Darwin)
20   SHARED_LIBRARY = 1
21   DONT_BUILD_RELINKED = 1
22 else
23   BUILD_ARCHIVE = 1
24 endif
25
26 LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts linker bitreader bitwriter
27
28 include $(LEVEL)/Makefile.common
29
30 ifeq ($(OS),Darwin)
31     # set dylib internal version number to llvmCore submission number
32     ifdef LLVM_SUBMIT_VERSION
33         LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
34                                                 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
35     endif
36     # extra options to override libtool defaults 
37     LLVMLibsOptions    := $(LLVMLibsOptions)  \
38                                 -no-undefined  -avoid-version \
39                 -Wl,-exported_symbols_list -Wl,lto.exports \
40                 -Wl,-dead_strip \
41                 -Wl,-install_name \
42                                 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" \
43                 -Wl,-seg1addr -Wl,0xE0000000 
44
45 endif