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 := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
     20 USEDLIBS = clangIndex.a clangARCMigrate.a \
     21 	   clangRewriteFrontend.a \
     22 	   clangFormat.a \
     23 	   clangTooling.a \
     24 	   clangFrontend.a clangDriver.a \
     25 	   clangSerialization.a \
     26 	   clangParse.a clangSema.a \
     27 	   clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
     28 	   clangRewriteCore.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 ##===----------------------------------------------------------------------===##
     41 # FIXME: This is copied from the 'lto' makefile.  Should we share this?
     42 ##===----------------------------------------------------------------------===##
     43 
     44 ifeq ($(HOST_OS),Darwin)
     45     LLVMLibsOptions += -Wl,-compatibility_version,1
     46 
     47     # Set dylib internal version number to submission number.
     48     ifdef LLVM_SUBMIT_VERSION
     49         LLVMLibsOptions += -Wl,-current_version \
     50                            -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
     51     endif
     52 
     53     # If we're doing an Apple-style build, add the LTO object path.
     54     ifeq ($(RC_XBS),YES)
     55        TempFile        := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/clang-lto.XXXXXX)
     56        LLVMLibsOptions += -Wl,-object_path_lto -Wl,$(TempFile)
     57     endif
     58 endif
     59