Home | History | Annotate | Download | only in libclang
      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 := AsmParser BitReader Core MC MCParser Option Support
     20 USEDLIBS = 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 
     33 include $(CLANG_LEVEL)/Makefile
     34 
     35 # Add soname to the library.
     36 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU GNU/kFreeBSD))
     37         LLVMLibsOptions += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
     38 endif
     39 
     40 ifeq ($(ENABLE_CLANG_ARCMT),1)
     41   CXX.Flags += -DCLANG_ENABLE_ARCMT
     42 endif
     43 
     44 ##===----------------------------------------------------------------------===##
     45 # FIXME: This is copied from the 'lto' makefile.  Should we share this?
     46 ##===----------------------------------------------------------------------===##
     47 
     48 ifeq ($(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
     62 endif
     63