Makefile revision c4dec1c58eeb2ef46cdb64120eb6b819c6927afb
1##===- tools/libclang/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
10CLANG_LEVEL := ../..
11LIBRARYNAME = clang
12
13EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports
14
15# Include this here so we can get the configuration of the targets
16# that have been configured for construction. We have to do this 
17# early so we can set up LINK_COMPONENTS before including Makefile.rules
18include $(CLANG_LEVEL)/../../Makefile.config
19
20LINK_LIBS_IN_SHARED = 1
21SHARED_LIBRARY = 1
22
23LINK_COMPONENTS := bitreader mc core
24USEDLIBS = clangFrontend.a clangDriver.a clangSema.a \
25	   clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
26
27include $(CLANG_LEVEL)/Makefile
28
29##===----------------------------------------------------------------------===##
30# FIXME: This is copied from the 'lto' makefile.  Should we share this?
31##===----------------------------------------------------------------------===##
32
33ifeq ($(HOST_OS),Darwin)
34    # set dylib internal version number to llvmCore submission number
35    ifdef LLVM_SUBMIT_VERSION
36        LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
37                        -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
38                        -Wl,-compatibility_version -Wl,1
39    endif
40    # extra options to override libtool defaults 
41    LLVMLibsOptions    := $(LLVMLibsOptions)  \
42                         -avoid-version \
43                         -Wl,-dead_strip \
44                         -Wl,-seg1addr -Wl,0xE0000000 
45
46    # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
47    DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
48    ifneq ($(DARWIN_VERS),8)
49       LLVMLibsOptions    := $(LLVMLibsOptions)  \
50                            -no-undefined -Wl,-install_name \
51                            -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
52    endif
53endif
54