blob: 2689637116cdc7ad719d90226605d73d35cfb3e0 [file] [log] [blame]
Greg Clayton54e7afa2010-07-09 20:39:50 +00001##===- source/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 := ../../..
11LLDB_LEVEL := ..
12
13LIBRARYNAME = lldb
14
15#EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../resources/lldb-framework-exports
16NO_BUILD_ARCHIVE = 1
17LINK_LIBS_IN_SHARED = 1
18SHARED_LIBRARY = 1
19
Greg Clayton1a2f3112011-02-05 02:32:19 +000020PYTHON_BUILD_FLAGS = -lpython2.6
21
Greg Clayton54e7afa2010-07-09 20:39:50 +000022# Include all archives in liblldb.a files
23USEDLIBS = lldbAPI.a \
24 lldbBreakpoint.a \
25 lldbCommands.a \
26 lldbCore.a \
27 lldbExpression.a \
Greg Clayton8f3b21d2010-09-07 20:11:56 +000028 lldbHostCommon.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000029 lldbInitAndLog.a \
30 lldbInterpreter.a \
31 lldbPluginABIMacOSX_i386.a \
32 lldbPluginABISysV_x86_64.a \
33 lldbPluginDisassemblerLLVM.a \
Stephen Wilson8be525a2011-03-08 03:57:00 +000034 lldbPluginDynamicLoaderStatic.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000035 lldbPluginObjectContainerBSDArchive.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000036 lldbPluginObjectFileELF.a \
Stephen Wilson3967cef2011-03-26 00:32:59 +000037 lldbPluginPlatformGDBServer.a \
38 lldbPluginProcessGDBRemote.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000039 lldbPluginSymbolFileDWARF.a \
40 lldbPluginSymbolFileSymtab.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000041 lldbPluginUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000042 lldbSymbol.a \
43 lldbTarget.a \
44 lldbUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000045 clangAnalysis.a \
46 clangAST.a \
47 clangBasic.a \
48 clangCodeGen.a \
49 clangFrontend.a \
50 clangDriver.a \
51 clangIndex.a \
52 clangLex.a \
53 clangRewrite.a \
54 clangParse.a \
55 clangSema.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000056 clangSerialization.a \
Stephen Wilsonb6b6fae2011-01-25 23:03:42 +000057 EnhancedDisassembly.a
Greg Clayton54e7afa2010-07-09 20:39:50 +000058
Eli Friedman26f93ce2010-07-09 22:11:43 +000059include $(LLDB_LEVEL)/../../Makefile.config
60
61LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000062 ipo selectiondag jit mc
Eli Friedman26f93ce2010-07-09 22:11:43 +000063
64ifeq ($(HOST_OS),Darwin)
65 USEDLIBS += lldbHostMacOSX.a \
66 lldbPluginDynamicLoaderMacOSX.a \
67 lldbPluginObjectContainerUniversalMachO.a \
68 lldbPluginObjectFileMachO.a \
Stephen Wilsonef6635b2011-03-10 03:08:28 +000069 lldbPluginSymbolVendorMacOSX.a \
70 lldbPluginPlatformMacOSX.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000071endif
72
73ifeq ($(HOST_OS),Linux)
Stephen Wilson92241ef2011-01-16 19:45:39 +000074 USEDLIBS += lldbPluginProcessLinux.a \
Stephen Wilsonef6635b2011-03-10 03:08:28 +000075 lldbPluginDynamicLoaderLinux.a \
Stephen Wilson76fd5dd2011-03-23 01:58:26 +000076 lldbPluginPlatformLinux.a \
77 lldbHostLinux.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000078endif
79
Greg Clayton54e7afa2010-07-09 20:39:50 +000080include $(LEVEL)/Makefile.common
81
Greg Clayton54e7afa2010-07-09 20:39:50 +000082ifeq ($(HOST_OS),Darwin)
Eli Friedman26f93ce2010-07-09 22:11:43 +000083 LLVMLibsOptions += -Wl,-all_load
Greg Clayton54e7afa2010-07-09 20:39:50 +000084 # set dylib internal version number to llvmCore submission number
85 ifdef LLDB_SUBMIT_VERSION
86 LLVMLibsOptions += -Wl,-current_version \
87 -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \
88 -Wl,-compatibility_version -Wl,1
89 endif
90 # extra options to override libtool defaults
91 LLVMLibsOptions += -avoid-version
92 LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
93 LLVMLibsOptions += -framework Foundation -framework CoreFoundation
Greg Clayton1a2f3112011-02-05 02:32:19 +000094 LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
Greg Clayton980d0672010-07-12 23:14:00 +000095 LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports"
Greg Clayton54e7afa2010-07-09 20:39:50 +000096 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
97 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
98 ifneq ($(DARWIN_VERS),8)
99 LLVMLibsOptions += -no-undefined -Wl,-install_name \
100 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
101 endif
102endif
103
104ifeq ($(HOST_OS), Linux)
105 # Include everything from the .a's into the shared library.
Eli Friedman26f93ce2010-07-09 22:11:43 +0000106 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000107 -Wl,--no-whole-archive
108 # Don't allow unresolved symbols.
109 LLVMLibsOptions += -Wl,--no-undefined
Eli Friedman26f93ce2010-07-09 22:11:43 +0000110 # Link in python
Greg Clayton1a2f3112011-02-05 02:32:19 +0000111 LD.Flags += $(PYTHON_BUILD_FLAGS)
Greg Clayton54e7afa2010-07-09 20:39:50 +0000112endif