blob: bf49958d33f23e88558d77d98d4d3f0b846a6a9c [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 \
Stephen Wilsonec113d42011-04-08 02:01:35 +000035 lldbPluginEmulateInstructionARM.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000036 lldbPluginObjectContainerBSDArchive.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000037 lldbPluginObjectFileELF.a \
Stephen Wilson3967cef2011-03-26 00:32:59 +000038 lldbPluginPlatformGDBServer.a \
39 lldbPluginProcessGDBRemote.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000040 lldbPluginSymbolFileDWARF.a \
41 lldbPluginSymbolFileSymtab.a \
Peter Collingbourne59d4cb82011-05-19 17:34:58 +000042 lldbPluginUnwindAssemblyInstEmulation.a \
43 lldbPluginUnwindAssemblyx86.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000044 lldbPluginUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000045 lldbSymbol.a \
46 lldbTarget.a \
47 lldbUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000048 clangAnalysis.a \
49 clangAST.a \
50 clangBasic.a \
51 clangCodeGen.a \
52 clangFrontend.a \
53 clangDriver.a \
54 clangIndex.a \
55 clangLex.a \
56 clangRewrite.a \
57 clangParse.a \
58 clangSema.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000059 clangSerialization.a \
Stephen Wilsonb6b6fae2011-01-25 23:03:42 +000060 EnhancedDisassembly.a
Greg Clayton54e7afa2010-07-09 20:39:50 +000061
Eli Friedman26f93ce2010-07-09 22:11:43 +000062include $(LLDB_LEVEL)/../../Makefile.config
63
64LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000065 ipo selectiondag jit mc
Eli Friedman26f93ce2010-07-09 22:11:43 +000066
67ifeq ($(HOST_OS),Darwin)
68 USEDLIBS += lldbHostMacOSX.a \
69 lldbPluginDynamicLoaderMacOSX.a \
70 lldbPluginObjectContainerUniversalMachO.a \
71 lldbPluginObjectFileMachO.a \
Stephen Wilsonef6635b2011-03-10 03:08:28 +000072 lldbPluginSymbolVendorMacOSX.a \
73 lldbPluginPlatformMacOSX.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000074endif
75
76ifeq ($(HOST_OS),Linux)
Stephen Wilson92241ef2011-01-16 19:45:39 +000077 USEDLIBS += lldbPluginProcessLinux.a \
Stephen Wilsonef6635b2011-03-10 03:08:28 +000078 lldbPluginDynamicLoaderLinux.a \
Stephen Wilson76fd5dd2011-03-23 01:58:26 +000079 lldbPluginPlatformLinux.a \
80 lldbHostLinux.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000081endif
82
Greg Clayton54e7afa2010-07-09 20:39:50 +000083include $(LEVEL)/Makefile.common
84
Greg Clayton54e7afa2010-07-09 20:39:50 +000085ifeq ($(HOST_OS),Darwin)
Eli Friedman26f93ce2010-07-09 22:11:43 +000086 LLVMLibsOptions += -Wl,-all_load
Greg Clayton54e7afa2010-07-09 20:39:50 +000087 # set dylib internal version number to llvmCore submission number
88 ifdef LLDB_SUBMIT_VERSION
89 LLVMLibsOptions += -Wl,-current_version \
90 -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \
91 -Wl,-compatibility_version -Wl,1
92 endif
93 # extra options to override libtool defaults
94 LLVMLibsOptions += -avoid-version
95 LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
96 LLVMLibsOptions += -framework Foundation -framework CoreFoundation
Greg Clayton1a2f3112011-02-05 02:32:19 +000097 LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
Greg Clayton980d0672010-07-12 23:14:00 +000098 LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports"
Greg Clayton54e7afa2010-07-09 20:39:50 +000099 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
100 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
101 ifneq ($(DARWIN_VERS),8)
102 LLVMLibsOptions += -no-undefined -Wl,-install_name \
103 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
104 endif
105endif
106
107ifeq ($(HOST_OS), Linux)
108 # Include everything from the .a's into the shared library.
Eli Friedman26f93ce2010-07-09 22:11:43 +0000109 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000110 -Wl,--no-whole-archive
111 # Don't allow unresolved symbols.
112 LLVMLibsOptions += -Wl,--no-undefined
Eli Friedman26f93ce2010-07-09 22:11:43 +0000113 # Link in python
Stephen Wilsonec113d42011-04-08 02:01:35 +0000114 LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt
Greg Clayton54e7afa2010-07-09 20:39:50 +0000115endif