blob: f2d29ee6ecf16ff5ad751f9b7d6424d92ad8e902 [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
Peter Collingbourne4b93d662011-02-19 23:03:58 +000018LINK_COMPONENTS := support mc
Argyrios Kyrtzidis96210192011-07-09 21:35:58 +000019USEDLIBS = clangARCMigrate.a clangRewrite.a clangFrontend.a clangDriver.a \
20 clangSerialization.a \
Ted Kremenek30660a82012-03-06 20:06:33 +000021 clangParse.a clangSema.a clangEdit.a clangAnalysis.a \
22 clangAST.a clangLex.a clangBasic.a
Ted Kremenekd2fa5662009-08-26 22:36:44 +000023
Daniel Dunbarafed0992010-06-08 20:34:18 +000024include $(CLANG_LEVEL)/Makefile
Ted Kremenekd2fa5662009-08-26 22:36:44 +000025
Sylvestre Ledru0740a252012-04-15 23:17:25 +000026# Add soname to the library.
27ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD OpenBSD GNU))
28 LDFLAGS += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
29endif
30
Ted Kremenekd2fa5662009-08-26 22:36:44 +000031##===----------------------------------------------------------------------===##
32# FIXME: This is copied from the 'lto' makefile. Should we share this?
33##===----------------------------------------------------------------------===##
34
35ifeq ($(HOST_OS),Darwin)
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000036 LLVMLibsOptions += -Wl,-compatibility_version,1
37
38 # Set dylib internal version number to submission number.
Ted Kremenekd2fa5662009-08-26 22:36:44 +000039 ifdef LLVM_SUBMIT_VERSION
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000040 LLVMLibsOptions += -Wl,-current_version \
41 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
Ted Kremenekd2fa5662009-08-26 22:36:44 +000042 endif
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000043
44 # Extra options to override libtool defaults.
45 LLVMLibsOptions += -Wl,-dead_strip -Wl,-seg1addr,0xE0000000
Ted Kremenekd2fa5662009-08-26 22:36:44 +000046
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)
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000050 LLVMLibsOptions += -Wl,-install_name \
51 -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
Ted Kremenekd2fa5662009-08-26 22:36:44 +000052 endif
53endif