blob: 7bdbba172f2c866aa08e3a954e617a74cf4e3f26 [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
Daniel Dunbar467f0302009-12-02 21:47:55 +000024LINK_COMPONENTS := bitreader mc core
Douglas Gregora030b7c2010-01-22 20:35:53 +000025USEDLIBS = clangFrontend.a clangDriver.a clangSema.a \
Daniel Dunbar467f0302009-12-02 21:47:55 +000026 clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
Ted Kremenekd2fa5662009-08-26 22:36:44 +000027
28include $(LEVEL)/Makefile.common
29
30##===----------------------------------------------------------------------===##
31# FIXME: This is copied from the 'lto' makefile. Should we share this?
32##===----------------------------------------------------------------------===##
33
34ifeq ($(HOST_OS),Darwin)
35 # set dylib internal version number to llvmCore submission number
36 ifdef LLVM_SUBMIT_VERSION
37 LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
38 -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
39 -Wl,-compatibility_version -Wl,1
40 endif
41 # extra options to override libtool defaults
42 LLVMLibsOptions := $(LLVMLibsOptions) \
43 -avoid-version \
44 -Wl,-exported_symbols_list -Wl,$(PROJ_SRC_DIR)/CIndex.exports \
45 -Wl,-dead_strip \
46 -Wl,-seg1addr -Wl,0xE0000000
47
48 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
49 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
50 ifneq ($(DARWIN_VERS),8)
51 LLVMLibsOptions := $(LLVMLibsOptions) \
52 -no-undefined -Wl,-install_name \
53 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
54 endif
55endif