blob: 17e1f3d034a00f2c17cbde6733fdf4602cba7e07 [file] [log] [blame]
Ted Kremenekd2fa5662009-08-26 22:36:44 +00001##===- tools/CIndex/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
10LEVEL = ../../../..
11LIBRARYNAME = CIndex
12
13CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
14CXXFLAGS = -fno-rtti
15
16# Include this here so we can get the configuration of the targets
17# that have been configured for construction. We have to do this
18# early so we can set up LINK_COMPONENTS before including Makefile.rules
19include $(LEVEL)/Makefile.config
20
21LINK_LIBS_IN_SHARED = 1
22SHARED_LIBRARY = 1
23
Ted Kremenek80088a92009-08-28 18:33:53 +000024LINK_COMPONENTS := MC support
Nuno Lopes7896ea12009-12-02 20:20:47 +000025USEDLIBS = clangFrontend.a clangDriver.a clangIndex.a clangSema.a clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
Ted Kremenekd2fa5662009-08-26 22:36:44 +000026
27include $(LEVEL)/Makefile.common
28
29##===----------------------------------------------------------------------===##
30# FIXME: This is copied from the 'lto' makefile. Should we share this?
31##===----------------------------------------------------------------------===##
32
33ifeq ($(HOST_OS),Darwin)
34 # set dylib internal version number to llvmCore submission number
35 ifdef LLVM_SUBMIT_VERSION
36 LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
37 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
38 -Wl,-compatibility_version -Wl,1
39 endif
40 # extra options to override libtool defaults
41 LLVMLibsOptions := $(LLVMLibsOptions) \
42 -avoid-version \
43 -Wl,-exported_symbols_list -Wl,$(PROJ_SRC_DIR)/CIndex.exports \
44 -Wl,-dead_strip \
45 -Wl,-seg1addr -Wl,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 := $(LLVMLibsOptions) \
51 -no-undefined -Wl,-install_name \
52 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
53 endif
54endif