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