Makefile revision 57b5b4aee9f8e0bc20e142250a3109ed2e057b45
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
15LINK_LIBS_IN_SHARED = 1
16SHARED_LIBRARY = 1
17
18LINK_COMPONENTS := bitreader mc core
19USEDLIBS = clangFrontend.a clangDriver.a clangSerialization.a clangSema.a \
20	   clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
21
22include $(CLANG_LEVEL)/Makefile
23
24##===----------------------------------------------------------------------===##
25# FIXME: This is copied from the 'lto' makefile.  Should we share this?
26##===----------------------------------------------------------------------===##
27
28ifeq ($(HOST_OS),Darwin)
29    LLVMLibsOptions += -Wl,-compatibility_version,1
30
31    # Set dylib internal version number to submission number.
32    ifdef LLVM_SUBMIT_VERSION
33        LLVMLibsOptions += -Wl,-current_version \
34                           -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
35    endif
36
37    # Extra options to override libtool defaults.
38    LLVMLibsOptions += -Wl,-dead_strip -Wl,-seg1addr,0xE0000000 
39
40    # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
41    DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
42    ifneq ($(DARWIN_VERS),8)
43       LLVMLibsOptions += -Wl,-install_name \
44                          -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
45    endif
46endif
47