blob: 929728f88b10d447ade0431f577a150b98a80dd8 [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
Johnny Chen00876122011-05-19 23:09:48 +000020PYTHON_BUILD_FLAGS = $(shell python-config --ldflags)
Greg Clayton1a2f3112011-02-05 02:32:19 +000021
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 \
Peter Collingbourneb7f59452011-05-19 18:32:34 +000031 lldbPluginABIMacOSX_arm.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000032 lldbPluginABIMacOSX_i386.a \
33 lldbPluginABISysV_x86_64.a \
34 lldbPluginDisassemblerLLVM.a \
Stephen Wilson8be525a2011-03-08 03:57:00 +000035 lldbPluginDynamicLoaderStatic.a \
Stephen Wilsonec113d42011-04-08 02:01:35 +000036 lldbPluginEmulateInstructionARM.a \
Charles Davis1e58a392011-05-19 23:53:23 +000037 lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \
38 lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000039 lldbPluginObjectContainerBSDArchive.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000040 lldbPluginObjectFileELF.a \
Stephen Wilson3967cef2011-03-26 00:32:59 +000041 lldbPluginPlatformGDBServer.a \
42 lldbPluginProcessGDBRemote.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000043 lldbPluginSymbolFileDWARF.a \
44 lldbPluginSymbolFileSymtab.a \
Peter Collingbourne59d4cb82011-05-19 17:34:58 +000045 lldbPluginUnwindAssemblyInstEmulation.a \
46 lldbPluginUnwindAssemblyx86.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000047 lldbPluginUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000048 lldbSymbol.a \
49 lldbTarget.a \
50 lldbUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000051 clangAnalysis.a \
52 clangAST.a \
53 clangBasic.a \
54 clangCodeGen.a \
55 clangFrontend.a \
56 clangDriver.a \
57 clangIndex.a \
58 clangLex.a \
59 clangRewrite.a \
60 clangParse.a \
61 clangSema.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000062 clangSerialization.a \
Johnny Chen1bcd1382011-08-23 22:36:23 +000063 EnhancedDisassembly.a \
64 LLVMMCDisassembler.a
Greg Clayton54e7afa2010-07-09 20:39:50 +000065
Eli Friedman26f93ce2010-07-09 22:11:43 +000066include $(LLDB_LEVEL)/../../Makefile.config
67
68LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
Charles Davisa0b5fcc2011-05-24 01:54:03 +000069 instrumentation ipo selectiondag jit mc mcjit
Eli Friedman26f93ce2010-07-09 22:11:43 +000070
71ifeq ($(HOST_OS),Darwin)
72 USEDLIBS += lldbHostMacOSX.a \
73 lldbPluginDynamicLoaderMacOSX.a \
74 lldbPluginObjectContainerUniversalMachO.a \
75 lldbPluginObjectFileMachO.a \
Stephen Wilsonef6635b2011-03-10 03:08:28 +000076 lldbPluginSymbolVendorMacOSX.a \
Johnny Chen4b663292011-08-02 20:52:42 +000077 lldbPluginPlatformMacOSX.a \
78 lldbPluginProcessDarwin
Eli Friedman26f93ce2010-07-09 22:11:43 +000079endif
80
81ifeq ($(HOST_OS),Linux)
Stephen Wilson92241ef2011-01-16 19:45:39 +000082 USEDLIBS += lldbPluginProcessLinux.a \
Stephen Wilsonef6635b2011-03-10 03:08:28 +000083 lldbPluginDynamicLoaderLinux.a \
Stephen Wilson76fd5dd2011-03-23 01:58:26 +000084 lldbPluginPlatformLinux.a \
85 lldbHostLinux.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000086endif
87
Johnny Chen4b663292011-08-02 20:52:42 +000088ifeq ($(HOST_OS),FreeBSD)
89 USEDLIBS += lldbHostFreeBSD.a \
90 lldbPluginPlatformFreeBSD.a
91endif
92
Greg Clayton54e7afa2010-07-09 20:39:50 +000093include $(LEVEL)/Makefile.common
94
Greg Clayton54e7afa2010-07-09 20:39:50 +000095ifeq ($(HOST_OS),Darwin)
Eli Friedman26f93ce2010-07-09 22:11:43 +000096 LLVMLibsOptions += -Wl,-all_load
Greg Clayton54e7afa2010-07-09 20:39:50 +000097 # set dylib internal version number to llvmCore submission number
98 ifdef LLDB_SUBMIT_VERSION
99 LLVMLibsOptions += -Wl,-current_version \
100 -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \
101 -Wl,-compatibility_version -Wl,1
102 endif
103 # extra options to override libtool defaults
104 LLVMLibsOptions += -avoid-version
105 LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
Charles Davis1e58a392011-05-19 23:53:23 +0000106 LLVMLibsOptions += -framework Foundation -framework CoreFoundation
107 LLVMLibsOptions += -framework CoreServices -framework Carbon
Greg Clayton1a2f3112011-02-05 02:32:19 +0000108 LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
Greg Clayton980d0672010-07-12 23:14:00 +0000109 LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports"
Greg Clayton54e7afa2010-07-09 20:39:50 +0000110 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
111 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
112 ifneq ($(DARWIN_VERS),8)
113 LLVMLibsOptions += -no-undefined -Wl,-install_name \
114 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
115 endif
116endif
117
Johnny Chen4b663292011-08-02 20:52:42 +0000118ifeq ($(HOST_OS),Linux)
Greg Clayton54e7afa2010-07-09 20:39:50 +0000119 # Include everything from the .a's into the shared library.
Eli Friedman26f93ce2010-07-09 22:11:43 +0000120 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000121 -Wl,--no-whole-archive
122 # Don't allow unresolved symbols.
123 LLVMLibsOptions += -Wl,--no-undefined
Eli Friedman26f93ce2010-07-09 22:11:43 +0000124 # Link in python
Stephen Wilsonec113d42011-04-08 02:01:35 +0000125 LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt
Greg Clayton54e7afa2010-07-09 20:39:50 +0000126endif
Johnny Chen4b663292011-08-02 20:52:42 +0000127
128ifeq ($(HOST_OS),FreeBSD)
129 # Include everything from the .a's into the shared library.
130 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
131 -Wl,--no-whole-archive
132 # Don't allow unresolved symbols.
133 LLVMLibsOptions += -Wl,--no-undefined
134 # Link in python
135 LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo
136endif