blob: 87f805f6ba257f5ea0ebf5c72a2504a98513c5f2 [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
Filipe Cabecinhas93024d92012-05-29 13:41:50 +000015#EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports
Greg Clayton54e7afa2010-07-09 20:39:50 +000016NO_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
Filipe Cabecinhas93024d92012-05-29 13:41:50 +000022# Include all archives in liblldb.so file
Greg Clayton54e7afa2010-07-09 20:39:50 +000023USEDLIBS = 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 \
Filipe Cabecinhas93024d92012-05-29 13:41:50 +000036 lldbPluginDynamicLoaderPOSIX.a \
Stephen Wilsonec113d42011-04-08 02:01:35 +000037 lldbPluginEmulateInstructionARM.a \
Charles Davis1e58a392011-05-19 23:53:23 +000038 lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \
39 lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000040 lldbPluginObjectContainerBSDArchive.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000041 lldbPluginObjectFileELF.a \
Greg Claytonfa407ad2011-10-11 16:42:21 +000042 lldbPluginObjectFilePECOFF.a \
Filipe Cabecinhas915da352012-08-28 13:59:38 +000043 lldbPluginOperatingSystemPython.a \
Stephen Wilson3967cef2011-03-26 00:32:59 +000044 lldbPluginPlatformGDBServer.a \
45 lldbPluginProcessGDBRemote.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000046 lldbPluginSymbolFileDWARF.a \
47 lldbPluginSymbolFileSymtab.a \
Peter Collingbourne59d4cb82011-05-19 17:34:58 +000048 lldbPluginUnwindAssemblyInstEmulation.a \
49 lldbPluginUnwindAssemblyx86.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000050 lldbPluginUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000051 lldbSymbol.a \
52 lldbTarget.a \
53 lldbUtility.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000054 clangAnalysis.a \
55 clangAST.a \
56 clangBasic.a \
57 clangCodeGen.a \
58 clangFrontend.a \
59 clangDriver.a \
Benjamin Kramer9930b332012-03-14 11:03:46 +000060 clangEdit.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000061 clangLex.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000062 clangParse.a \
63 clangSema.a \
Stephen Wilson64dd0d72011-01-06 22:11:47 +000064 clangSerialization.a \
Greg Claytoned605712012-02-28 18:25:00 +000065 LLVMMCDisassembler.a \
66 lldbPluginPlatformMacOSX.a \
67 lldbPluginPlatformLinux.a \
68 lldbPluginPlatformFreeBSD.a
Greg Clayton54e7afa2010-07-09 20:39:50 +000069
Eli Friedman26f93ce2010-07-09 22:11:43 +000070include $(LLDB_LEVEL)/../../Makefile.config
71
72LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
Daniel Dunbarfd0c1f42011-11-01 17:32:01 +000073 instrumentation ipo selectiondag jit mc mcjit linker
Eli Friedman26f93ce2010-07-09 22:11:43 +000074
75ifeq ($(HOST_OS),Darwin)
76 USEDLIBS += lldbHostMacOSX.a \
77 lldbPluginDynamicLoaderMacOSX.a \
Daniel Dunbar8e584ec2011-10-31 22:51:08 +000078 lldbPluginDynamicLoaderDarwinKernel.a \
Eli Friedman26f93ce2010-07-09 22:11:43 +000079 lldbPluginObjectContainerUniversalMachO.a \
80 lldbPluginObjectFileMachO.a \
Daniel Dunbar8f4cdb42011-10-31 22:51:11 +000081 lldbPluginOperatingSystemDarwinKernel.a \
Stephen Wilsonef6635b2011-03-10 03:08:28 +000082 lldbPluginSymbolVendorMacOSX.a \
Johnny Chen7637a3a2012-02-24 18:02:59 +000083 lldbPluginProcessDarwin.a \
84 lldbPluginProcessMachCore.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000085endif
86
87ifeq ($(HOST_OS),Linux)
Jason Molenda4a55d752012-10-04 02:16:06 +000088 USEDLIBS += lldbHostLinux.a \
Johnny Chen7e996472012-01-05 19:17:38 +000089 lldbPluginProcessLinux.a \
Jason Molenda4a55d752012-10-04 02:16:06 +000090 lldbPluginProcessPOSIX.a \
91 lldbPluginDynamicLoaderMacOSX.a \
92 lldbPluginDynamicLoaderDarwinKernel.a \
93 lldbPluginOperatingSystemDarwinKernel.a
94
Eli Friedman26f93ce2010-07-09 22:11:43 +000095endif
96
Johnny Chen4b663292011-08-02 20:52:42 +000097ifeq ($(HOST_OS),FreeBSD)
98 USEDLIBS += lldbHostFreeBSD.a \
Johnny Chen7e996472012-01-05 19:17:38 +000099 lldbPluginProcessPOSIX.a \
Greg Claytoned605712012-02-28 18:25:00 +0000100 lldbPluginProcessFreeBSD.a
Johnny Chen4b663292011-08-02 20:52:42 +0000101endif
102
Greg Clayton54e7afa2010-07-09 20:39:50 +0000103include $(LEVEL)/Makefile.common
104
Greg Clayton54e7afa2010-07-09 20:39:50 +0000105ifeq ($(HOST_OS),Darwin)
Eli Friedman26f93ce2010-07-09 22:11:43 +0000106 LLVMLibsOptions += -Wl,-all_load
Greg Clayton54e7afa2010-07-09 20:39:50 +0000107 # set dylib internal version number to llvmCore submission number
108 ifdef LLDB_SUBMIT_VERSION
109 LLVMLibsOptions += -Wl,-current_version \
110 -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \
111 -Wl,-compatibility_version -Wl,1
112 endif
113 # extra options to override libtool defaults
Greg Clayton54e7afa2010-07-09 20:39:50 +0000114 LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
Charles Davis1e58a392011-05-19 23:53:23 +0000115 LLVMLibsOptions += -framework Foundation -framework CoreFoundation
Bill Wendling5a45f242012-04-05 06:20:13 +0000116 LLVMLibsOptions += -framework CoreServices -framework Carbon -framework Security
Greg Clayton1a2f3112011-02-05 02:32:19 +0000117 LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
Filipe Cabecinhas93024d92012-05-29 13:41:50 +0000118 ifneq ($(EXPORTED_SYMBOL_FILE),)
119 LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(EXPORTED_SYMBOL_FILE)"
120 endif
Greg Clayton54e7afa2010-07-09 20:39:50 +0000121 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
122 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
123 ifneq ($(DARWIN_VERS),8)
Daniel Dunbar2888f552011-10-31 22:50:30 +0000124 LLVMLibsOptions += -Wl,-install_name \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000125 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
126 endif
127endif
128
Johnny Chen4b663292011-08-02 20:52:42 +0000129ifeq ($(HOST_OS),Linux)
Greg Clayton54e7afa2010-07-09 20:39:50 +0000130 # Include everything from the .a's into the shared library.
Eli Friedman26f93ce2010-07-09 22:11:43 +0000131 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000132 -Wl,--no-whole-archive
133 # Don't allow unresolved symbols.
134 LLVMLibsOptions += -Wl,--no-undefined
Eli Friedman26f93ce2010-07-09 22:11:43 +0000135 # Link in python
Filipe Cabecinhas93024d92012-05-29 13:41:50 +0000136 LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt
Greg Clayton54e7afa2010-07-09 20:39:50 +0000137endif
Johnny Chen4b663292011-08-02 20:52:42 +0000138
139ifeq ($(HOST_OS),FreeBSD)
140 # Include everything from the .a's into the shared library.
141 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
142 -Wl,--no-whole-archive
Johnny Chen7e996472012-01-05 19:17:38 +0000143 # Allow unresolved symbols.
144 LLVMLibsOptions += -Wl,--allow-shlib-undefined
Johnny Chen4b663292011-08-02 20:52:42 +0000145 # Link in python
Filipe Cabecinhas93024d92012-05-29 13:41:50 +0000146 LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo
Johnny Chen4b663292011-08-02 20:52:42 +0000147endif