blob: 881b23c6185a9100cc16d7b6604190f2c7ecb634 [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
20# Include all archives in liblldb.a files
21USEDLIBS = lldbAPI.a \
22 lldbBreakpoint.a \
23 lldbCommands.a \
24 lldbCore.a \
25 lldbExpression.a \
Greg Clayton8f3b21d2010-09-07 20:11:56 +000026 lldbHostCommon.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000027 lldbInitAndLog.a \
28 lldbInterpreter.a \
29 lldbPluginABIMacOSX_i386.a \
30 lldbPluginABISysV_x86_64.a \
31 lldbPluginDisassemblerLLVM.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000032 lldbPluginObjectContainerBSDArchive.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000033 lldbPluginObjectFileELF.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000034 lldbPluginSymbolFileDWARF.a \
35 lldbPluginSymbolFileSymtab.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000036 lldbPluginUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000037 lldbSymbol.a \
38 lldbTarget.a \
39 lldbUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000040 clangAnalysis.a \
41 clangAST.a \
42 clangBasic.a \
43 clangCodeGen.a \
44 clangFrontend.a \
45 clangDriver.a \
46 clangIndex.a \
47 clangLex.a \
48 clangRewrite.a \
49 clangParse.a \
50 clangSema.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000051 clangSerialization.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000052 EnhancedDisassembly.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000053 clangChecker.a
54
Eli Friedman26f93ce2010-07-09 22:11:43 +000055include $(LLDB_LEVEL)/../../Makefile.config
56
57LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000058 ipo selectiondag jit mc
Eli Friedman26f93ce2010-07-09 22:11:43 +000059
60ifeq ($(HOST_OS),Darwin)
61 USEDLIBS += lldbHostMacOSX.a \
62 lldbPluginDynamicLoaderMacOSX.a \
63 lldbPluginObjectContainerUniversalMachO.a \
64 lldbPluginObjectFileMachO.a \
65 lldbPluginProcessGDBRemote.a \
Stephen Wilsona3f015e2010-07-24 05:18:16 +000066 lldbPluginSymbolVendorMacOSX.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000067endif
68
69ifeq ($(HOST_OS),Linux)
Greg Clayton8f3b21d2010-09-07 20:11:56 +000070 USEDLIBS += lldbPluginProcessLinux.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000071endif
72
Greg Clayton54e7afa2010-07-09 20:39:50 +000073include $(LEVEL)/Makefile.common
74
Greg Clayton54e7afa2010-07-09 20:39:50 +000075ifeq ($(HOST_OS),Darwin)
Eli Friedman26f93ce2010-07-09 22:11:43 +000076 LLVMLibsOptions += -Wl,-all_load
Greg Clayton54e7afa2010-07-09 20:39:50 +000077 # set dylib internal version number to llvmCore submission number
78 ifdef LLDB_SUBMIT_VERSION
79 LLVMLibsOptions += -Wl,-current_version \
80 -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \
81 -Wl,-compatibility_version -Wl,1
82 endif
83 # extra options to override libtool defaults
84 LLVMLibsOptions += -avoid-version
85 LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
86 LLVMLibsOptions += -framework Foundation -framework CoreFoundation
87 LLVMLibsOptions += -framework DebugSymbols -lpython2.6 -lobjc
Greg Clayton980d0672010-07-12 23:14:00 +000088 LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports"
Greg Clayton54e7afa2010-07-09 20:39:50 +000089 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
90 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
91 ifneq ($(DARWIN_VERS),8)
92 LLVMLibsOptions += -no-undefined -Wl,-install_name \
93 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
94 endif
95endif
96
97ifeq ($(HOST_OS), Linux)
98 # Include everything from the .a's into the shared library.
Eli Friedman26f93ce2010-07-09 22:11:43 +000099 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000100 -Wl,--no-whole-archive
101 # Don't allow unresolved symbols.
102 LLVMLibsOptions += -Wl,--no-undefined
Eli Friedman26f93ce2010-07-09 22:11:43 +0000103 # Link in python
104 LD.Flags += -lpython2.6
Greg Clayton54e7afa2010-07-09 20:39:50 +0000105endif