blob: cefd9ba6df350f12810ea4732b031a31fe6c4b4c [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
Chad Rosierfa1d30d2012-08-08 16:27:29 +000018include $(CLANG_LEVEL)/../../Makefile.config
19LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser support mc
Ted Kremenek305c6132012-09-01 05:09:24 +000020USEDLIBS = 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
Ted Kremenekd2fa5662009-08-26 22:36:44 +000025
Daniel Dunbarafed0992010-06-08 20:34:18 +000026include $(CLANG_LEVEL)/Makefile
Ted Kremenekd2fa5662009-08-26 22:36:44 +000027
Sylvestre Ledru0740a252012-04-15 23:17:25 +000028# Add soname to the library.
Chris Lattner92f4e6e2012-04-25 06:09:30 +000029ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU))
Sylvestre Ledru0740a252012-04-15 23:17:25 +000030 LDFLAGS += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT)
31endif
32
Ted Kremenekd2fa5662009-08-26 22:36:44 +000033##===----------------------------------------------------------------------===##
34# FIXME: This is copied from the 'lto' makefile. Should we share this?
35##===----------------------------------------------------------------------===##
36
37ifeq ($(HOST_OS),Darwin)
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000038 LLVMLibsOptions += -Wl,-compatibility_version,1
39
40 # Set dylib internal version number to submission number.
Ted Kremenekd2fa5662009-08-26 22:36:44 +000041 ifdef LLVM_SUBMIT_VERSION
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000042 LLVMLibsOptions += -Wl,-current_version \
43 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION)
Ted Kremenekd2fa5662009-08-26 22:36:44 +000044 endif
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000045
46 # Extra options to override libtool defaults.
Argyrios Kyrtzidisf6766082012-04-20 22:07:11 +000047 LLVMLibsOptions += -Wl,-dead_strip
Ted Kremenekd2fa5662009-08-26 22:36:44 +000048
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)
Daniel Dunbar57b5b4a2010-08-19 23:44:02 +000052 LLVMLibsOptions += -Wl,-install_name \
53 -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)"
Ted Kremenekd2fa5662009-08-26 22:36:44 +000054 endif
55endif