Daniel Dunbar | f51f20f | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 1 | ##===- tools/libclang/Makefile -----------------------------*- Makefile -*-===## |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 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 | |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 10 | CLANG_LEVEL := ../.. |
Daniel Dunbar | f51f20f | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 11 | LIBRARYNAME = clang |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 12 | |
Daniel Dunbar | f51f20f | 2010-04-30 21:51:10 +0000 | [diff] [blame] | 13 | EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports |
Dan Gohman | e42e987 | 2010-04-16 04:45:02 +0000 | [diff] [blame] | 14 | |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 15 | LINK_LIBS_IN_SHARED = 1 |
| 16 | SHARED_LIBRARY = 1 |
| 17 | |
Chad Rosier | fa1d30d | 2012-08-08 16:27:29 +0000 | [diff] [blame] | 18 | include $(CLANG_LEVEL)/../../Makefile.config |
| 19 | LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser support mc |
Ted Kremenek | 305c613 | 2012-09-01 05:09:24 +0000 | [diff] [blame] | 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 |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 25 | |
Daniel Dunbar | afed099 | 2010-06-08 20:34:18 +0000 | [diff] [blame] | 26 | include $(CLANG_LEVEL)/Makefile |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 27 | |
Sylvestre Ledru | 0740a25 | 2012-04-15 23:17:25 +0000 | [diff] [blame] | 28 | # Add soname to the library. |
Chris Lattner | 92f4e6e | 2012-04-25 06:09:30 +0000 | [diff] [blame] | 29 | ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU)) |
Sylvestre Ledru | 0740a25 | 2012-04-15 23:17:25 +0000 | [diff] [blame] | 30 | LDFLAGS += -Wl,-soname,lib$(LIBRARYNAME)$(SHLIBEXT) |
| 31 | endif |
| 32 | |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 33 | ##===----------------------------------------------------------------------===## |
| 34 | # FIXME: This is copied from the 'lto' makefile. Should we share this? |
| 35 | ##===----------------------------------------------------------------------===## |
| 36 | |
| 37 | ifeq ($(HOST_OS),Darwin) |
Daniel Dunbar | 57b5b4a | 2010-08-19 23:44:02 +0000 | [diff] [blame] | 38 | LLVMLibsOptions += -Wl,-compatibility_version,1 |
| 39 | |
| 40 | # Set dylib internal version number to submission number. |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 41 | ifdef LLVM_SUBMIT_VERSION |
Daniel Dunbar | 57b5b4a | 2010-08-19 23:44:02 +0000 | [diff] [blame] | 42 | LLVMLibsOptions += -Wl,-current_version \ |
| 43 | -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 44 | endif |
Daniel Dunbar | 57b5b4a | 2010-08-19 23:44:02 +0000 | [diff] [blame] | 45 | |
| 46 | # Extra options to override libtool defaults. |
Argyrios Kyrtzidis | f676608 | 2012-04-20 22:07:11 +0000 | [diff] [blame] | 47 | LLVMLibsOptions += -Wl,-dead_strip |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 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) |
Daniel Dunbar | 57b5b4a | 2010-08-19 23:44:02 +0000 | [diff] [blame] | 52 | LLVMLibsOptions += -Wl,-install_name \ |
| 53 | -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)" |
Ted Kremenek | d2fa566 | 2009-08-26 22:36:44 +0000 | [diff] [blame] | 54 | endif |
| 55 | endif |