xref: /minix3/external/bsd/llvm/dist/clang/tools/libclang/Makefile (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
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 := AsmParser BitReader Core MC MCParser Option Support
20USEDLIBS = clangIndex.a clangARCMigrate.a \
21	   clangRewriteFrontend.a \
22	   clangFormat.a \
23	   clangTooling.a clangToolingCore.a \
24	   clangFrontend.a clangDriver.a \
25	   clangSerialization.a \
26	   clangParse.a clangSema.a \
27	   clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
28	   clangRewrite.a \
29	   clangAnalysis.a clangEdit.a \
30	   clangASTMatchers.a \
31	   clangAST.a clangLex.a clangBasic.a \
32
33include $(CLANG_LEVEL)/Makefile
34
35# Add soname to the library.
36ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD))
37        LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
38endif
39
40ifeq ($(ENABLE_CLANG_ARCMT),1)
41  CXX.Flags += -DCLANG_ENABLE_ARCMT
42endif
43
44##===----------------------------------------------------------------------===##
45# FIXME: This is copied from the 'lto' makefile.  Should we share this?
46##===----------------------------------------------------------------------===##
47
48ifeq ($(HOST_OS),Darwin)
49    LLVMLibsOptions += -Wl,-compatibility_version,1
50
51    # Set dylib internal version number to submission number.
52    ifdef LLVM_SUBMIT_VERSION
53        LLVMLibsOptions += -Wl,-current_version \
54                           -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
55    endif
56
57    # If we're doing an Apple-style build, add the LTO object path.
58    ifeq ($(RC_XBS),YES)
59       TempFile        := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/clang-lto.XXXXXX)
60       LLVMLibsOptions += -Wl,-object_path_lto -Wl,$(TempFile)
61    endif
62endif
63