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