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 10 CLANG_LEVEL := ../.. 11 LIBRARYNAME = clang 12 13 EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports 14 15 LINK_LIBS_IN_SHARED = 1 16 SHARED_LIBRARY = 1 17 18 include $(CLANG_LEVEL)/../../Makefile.config 19 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter core \ 20 instrumentation ipo mc mcparser objcarcopts option support \ 21 object 22 USEDLIBS = 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 35 include $(CLANG_LEVEL)/Makefile 36 37 # Add soname to the library. 38 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD)) 39 LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT) 40 endif 41 42 ifeq ($(ENABLE_CLANG_ARCMT),1) 43 CXX.Flags += -DCLANG_ENABLE_ARCMT 44 endif 45 46 ##===----------------------------------------------------------------------===## 47 # FIXME: This is copied from the 'lto' makefile. Should we share this? 48 ##===----------------------------------------------------------------------===## 49 50 ifeq ($(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 64 endif 65