blob: 650bcd3645d21297d7a364b7ddc53c1cbe080720 [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
Jeffrey Yasskin33524062010-03-12 22:55:16 +000013CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
Ted Kremenekd2fa5662009-08-26 22:36:44 +000014
15# Include this here so we can get the configuration of the targets
16# that have been configured for construction. We have to do this
17# early so we can set up LINK_COMPONENTS before including Makefile.rules
18include $(LEVEL)/Makefile.config
19
20LINK_LIBS_IN_SHARED = 1
21SHARED_LIBRARY = 1
22
Daniel Dunbar467f0302009-12-02 21:47:55 +000023LINK_COMPONENTS := bitreader mc core
Douglas Gregora030b7c2010-01-22 20:35:53 +000024USEDLIBS = clangFrontend.a clangDriver.a clangSema.a \
Daniel Dunbar467f0302009-12-02 21:47:55 +000025 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