• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
18include $(CLANG_LEVEL)/../../Makefile.config
19LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter core \
20                   instrumentation ipo mc mcparser objcarcopts option support \
21                   object
22USEDLIBS = clangIndex.a clangARCMigrate.a \
23	   clangRewriteFrontend.a \
24	   clangFormat.a \
25	   clangTooling.a clangToolingCore.a \
26	   clangFrontend.a clangCodeGen.a clangDriver.a \
27	   clangSerialization.a \
28	   clangParse.a clangSema.a \
29	   clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
30	   clangRewrite.a \
31	   clangAnalysis.a clangEdit.a \
32	   clangASTMatchers.a \
33	   clangAST.a clangLex.a clangBasic.a
34
35include $(CLANG_LEVEL)/Makefile
36
37# Add soname to the library.
38ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD))
39        LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
40endif
41
42ifeq ($(ENABLE_CLANG_ARCMT),1)
43  CXX.Flags += -DCLANG_ENABLE_ARCMT
44endif
45
46##===----------------------------------------------------------------------===##
47# FIXME: This is copied from the 'lto' makefile.  Should we share this?
48##===----------------------------------------------------------------------===##
49
50ifeq ($(HOST_OS),Darwin)
51    LLVMLibsOptions += -Wl,-compatibility_version,1
52
53    # Set dylib internal version number to submission number.
54    ifdef LLVM_SUBMIT_VERSION
55        LLVMLibsOptions += -Wl,-current_version \
56                           -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
57    endif
58
59    # If we're doing an Apple-style build, add the LTO object path.
60    ifeq ($(RC_XBS),YES)
61       TempFile        := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/clang-lto.XXXXXX)
62       LLVMLibsOptions += -Wl,-object_path_lto -Wl,$(TempFile)
63    endif
64endif
65