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 support mc 20 USEDLIBS = clangARCMigrate.a clangRewriteCore.a clangRewriteFrontend.a \ 21 clangFrontend.a clangDriver.a \ 22 clangSerialization.a \ 23 clangParse.a clangSema.a clangEdit.a clangAnalysis.a \ 24 clangAST.a clangLex.a clangTooling.a clangBasic.a 25 26 include $(CLANG_LEVEL)/Makefile 27 28 # Add soname to the library. 29 ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU)) 30 LDFLAGS += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT) 31 endif 32 33 ##===----------------------------------------------------------------------===## 34 # FIXME: This is copied from the 'lto' makefile. Should we share this? 35 ##===----------------------------------------------------------------------===## 36 37 ifeq ($(HOST_OS),Darwin) 38 LLVMLibsOptions += -Wl,-compatibility_version,1 39 40 # Set dylib internal version number to submission number. 41 ifdef LLVM_SUBMIT_VERSION 42 LLVMLibsOptions += -Wl,-current_version \ 43 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) 44 endif 45 46 # Extra options to override libtool defaults. 47 LLVMLibsOptions += -Wl,-dead_strip 48 49 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line 50 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') 51 ifneq ($(DARWIN_VERS),8) 52 LLVMLibsOptions += -Wl,-install_name \ 53 -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)" 54 endif 55 endif 56