blob: 7a620c15a937470d135a10d30c9223683d221b00 [file] [log] [blame]
Daniel Dunbarf51f20f2010-04-30 21:51:10 +00001##===- tools/libclang/Makefile -----------------------------*- Makefile -*-===##
Ted Kremenekd2fa5662009-08-26 22:36:44 +00002#
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
Daniel Dunbarafed0992010-06-08 20:34:18 +000010CLANG_LEVEL := ../..
Daniel Dunbarf51f20f2010-04-30 21:51:10 +000011LIBRARYNAME = clang
Ted Kremenekd2fa5662009-08-26 22:36:44 +000012
Daniel Dunbarf51f20f2010-04-30 21:51:10 +000013EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports
Dan Gohmane42e9872010-04-16 04:45:02 +000014
Ted Kremenekd2fa5662009-08-26 22:36:44 +000015LINK_LIBS_IN_SHARED = 1
16SHARED_LIBRARY = 1
17
Daniel Dunbar467f0302009-12-02 21:47:55 +000018LINK_COMPONENTS := bitreader mc core
Douglas Gregora030b7c2010-01-22 20:35:53 +000019USEDLIBS = clangFrontend.a clangDriver.a clangSema.a \
Douglas Gregore638f862010-08-17 19:00:27 +000020 clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
Ted Kremenekd2fa5662009-08-26 22:36:44 +000021
Daniel Dunbarafed0992010-06-08 20:34:18 +000022include $(CLANG_LEVEL)/Makefile
Ted Kremenekd2fa5662009-08-26 22:36:44 +000023
24##===----------------------------------------------------------------------===##
25# FIXME: This is copied from the 'lto' makefile. Should we share this?
26##===----------------------------------------------------------------------===##
27
28ifeq ($(HOST_OS),Darwin)
29 # set dylib internal version number to llvmCore submission number
30 ifdef LLVM_SUBMIT_VERSION
31 LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
32 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
33 -Wl,-compatibility_version -Wl,1
34 endif
35 # extra options to override libtool defaults
36 LLVMLibsOptions := $(LLVMLibsOptions) \
Ted Kremenekd2fa5662009-08-26 22:36:44 +000037 -Wl,-dead_strip \
38 -Wl,-seg1addr -Wl,0xE0000000
39
40 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
41 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
42 ifneq ($(DARWIN_VERS),8)
43 LLVMLibsOptions := $(LLVMLibsOptions) \
Daniel Dunbarf9ae8f92010-07-31 21:33:01 +000044 -Wl,-install_name \
Ted Kremenekf0229d82010-05-14 23:50:33 +000045 -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
Ted Kremenekd2fa5662009-08-26 22:36:44 +000046 endif
47endif