Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 1 | ##===- 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 | |
| 10 | LEVEL := ../../.. |
| 11 | LLDB_LEVEL := .. |
| 12 | |
| 13 | LIBRARYNAME = lldb |
| 14 | |
Filipe Cabecinhas | 93024d9 | 2012-05-29 13:41:50 +0000 | [diff] [blame] | 15 | #EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 16 | NO_BUILD_ARCHIVE = 1 |
| 17 | LINK_LIBS_IN_SHARED = 1 |
| 18 | SHARED_LIBRARY = 1 |
| 19 | |
Johnny Chen | 0087612 | 2011-05-19 23:09:48 +0000 | [diff] [blame] | 20 | PYTHON_BUILD_FLAGS = $(shell python-config --ldflags) |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 21 | |
Filipe Cabecinhas | 93024d9 | 2012-05-29 13:41:50 +0000 | [diff] [blame] | 22 | # Include all archives in liblldb.so file |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 23 | USEDLIBS = lldbAPI.a \ |
| 24 | lldbBreakpoint.a \ |
| 25 | lldbCommands.a \ |
| 26 | lldbCore.a \ |
Filipe Cabecinhas | 30c187c | 2013-01-30 00:28:58 +0000 | [diff] [blame] | 27 | lldbDataFormatters.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 28 | lldbExpression.a \ |
Greg Clayton | 8f3b21d | 2010-09-07 20:11:56 +0000 | [diff] [blame] | 29 | lldbHostCommon.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 30 | lldbInitAndLog.a \ |
| 31 | lldbInterpreter.a \ |
Peter Collingbourne | b7f5945 | 2011-05-19 18:32:34 +0000 | [diff] [blame] | 32 | lldbPluginABIMacOSX_arm.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 33 | lldbPluginABIMacOSX_i386.a \ |
| 34 | lldbPluginABISysV_x86_64.a \ |
| 35 | lldbPluginDisassemblerLLVM.a \ |
Stephen Wilson | 8be525a | 2011-03-08 03:57:00 +0000 | [diff] [blame] | 36 | lldbPluginDynamicLoaderStatic.a \ |
Filipe Cabecinhas | 93024d9 | 2012-05-29 13:41:50 +0000 | [diff] [blame] | 37 | lldbPluginDynamicLoaderPOSIX.a \ |
Stephen Wilson | ec113d4 | 2011-04-08 02:01:35 +0000 | [diff] [blame] | 38 | lldbPluginEmulateInstructionARM.a \ |
Charles Davis | 1e58a39 | 2011-05-19 23:53:23 +0000 | [diff] [blame] | 39 | lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \ |
| 40 | lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 41 | lldbPluginObjectContainerBSDArchive.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 42 | lldbPluginObjectFileELF.a \ |
Michael Sartain | a807cee | 2013-07-01 19:45:50 +0000 | [diff] [blame] | 43 | lldbPluginSymbolVendorELF.a \ |
Greg Clayton | fa407ad | 2011-10-11 16:42:21 +0000 | [diff] [blame] | 44 | lldbPluginObjectFilePECOFF.a \ |
Filipe Cabecinhas | 915da35 | 2012-08-28 13:59:38 +0000 | [diff] [blame] | 45 | lldbPluginOperatingSystemPython.a \ |
Stephen Wilson | 3967cef | 2011-03-26 00:32:59 +0000 | [diff] [blame] | 46 | lldbPluginPlatformGDBServer.a \ |
| 47 | lldbPluginProcessGDBRemote.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 48 | lldbPluginSymbolFileDWARF.a \ |
| 49 | lldbPluginSymbolFileSymtab.a \ |
Peter Collingbourne | 59d4cb8 | 2011-05-19 17:34:58 +0000 | [diff] [blame] | 50 | lldbPluginUnwindAssemblyInstEmulation.a \ |
| 51 | lldbPluginUnwindAssemblyx86.a \ |
Stephen Wilson | 64dd0d7 | 2011-01-06 22:11:47 +0000 | [diff] [blame] | 52 | lldbPluginUtility.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 53 | lldbSymbol.a \ |
| 54 | lldbTarget.a \ |
| 55 | lldbUtility.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 56 | clangAnalysis.a \ |
| 57 | clangAST.a \ |
| 58 | clangBasic.a \ |
| 59 | clangCodeGen.a \ |
| 60 | clangFrontend.a \ |
| 61 | clangDriver.a \ |
Benjamin Kramer | 9930b33 | 2012-03-14 11:03:46 +0000 | [diff] [blame] | 62 | clangEdit.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 63 | clangLex.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 64 | clangParse.a \ |
| 65 | clangSema.a \ |
Stephen Wilson | 64dd0d7 | 2011-01-06 22:11:47 +0000 | [diff] [blame] | 66 | clangSerialization.a \ |
Greg Clayton | ed60571 | 2012-02-28 18:25:00 +0000 | [diff] [blame] | 67 | LLVMMCDisassembler.a \ |
| 68 | lldbPluginPlatformMacOSX.a \ |
| 69 | lldbPluginPlatformLinux.a \ |
| 70 | lldbPluginPlatformFreeBSD.a |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 71 | |
Daniel Malea | 8bc4f6e | 2012-12-10 21:05:57 +0000 | [diff] [blame] | 72 | # Because GCC requires RTTI enabled for lldbCore (see source/Core/Makefile) it is |
| 73 | # necessary to also link the clang rewriter libraries so vtable references can |
| 74 | # be resolved correctly, if we are building with GCC. |
Greg Clayton | dbe390e | 2013-05-17 20:56:55 +0000 | [diff] [blame] | 75 | ifeq (g++,$(shell basename $(CXX) | colrm 4)) |
Daniel Malea | 8bc4f6e | 2012-12-10 21:05:57 +0000 | [diff] [blame] | 76 | USEDLIBS += clangRewriteCore.a \ |
| 77 | clangRewriteFrontend.a |
| 78 | endif |
| 79 | |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 80 | include $(LLDB_LEVEL)/../../Makefile.config |
| 81 | |
| 82 | LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \ |
Rafael Espindola | 5d4f6a7 | 2013-06-14 23:00:27 +0000 | [diff] [blame] | 83 | instrumentation ipo irreader selectiondag jit mc mcjit \ |
| 84 | linker option |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 85 | |
| 86 | ifeq ($(HOST_OS),Darwin) |
| 87 | USEDLIBS += lldbHostMacOSX.a \ |
| 88 | lldbPluginDynamicLoaderMacOSX.a \ |
Daniel Dunbar | 8e584ec | 2011-10-31 22:51:08 +0000 | [diff] [blame] | 89 | lldbPluginDynamicLoaderDarwinKernel.a \ |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 90 | lldbPluginObjectContainerUniversalMachO.a \ |
| 91 | lldbPluginObjectFileMachO.a \ |
Stephen Wilson | ef6635b | 2011-03-10 03:08:28 +0000 | [diff] [blame] | 92 | lldbPluginSymbolVendorMacOSX.a \ |
Johnny Chen | 7637a3a | 2012-02-24 18:02:59 +0000 | [diff] [blame] | 93 | lldbPluginProcessDarwin.a \ |
| 94 | lldbPluginProcessMachCore.a |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 95 | endif |
| 96 | |
| 97 | ifeq ($(HOST_OS),Linux) |
Jason Molenda | 4a55d75 | 2012-10-04 02:16:06 +0000 | [diff] [blame] | 98 | USEDLIBS += lldbHostLinux.a \ |
Johnny Chen | 7e99647 | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 99 | lldbPluginProcessLinux.a \ |
Jason Molenda | 4a55d75 | 2012-10-04 02:16:06 +0000 | [diff] [blame] | 100 | lldbPluginProcessPOSIX.a \ |
Ashok Thirumurthi | f6f5269 | 2013-07-17 16:06:12 +0000 | [diff] [blame] | 101 | lldbPluginDynamicLoaderMacOSX.a \ |
| 102 | lldbPluginProcessElfCore.a |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 103 | endif |
| 104 | |
Sylvestre Ledru | fa2cd91 | 2013-07-01 08:21:36 +0000 | [diff] [blame] | 105 | ifneq (,$(filter $(HOST_OS), FreeBSD GNU/kFreeBSD)) |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 106 | USEDLIBS += lldbHostFreeBSD.a \ |
Johnny Chen | 7e99647 | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 107 | lldbPluginProcessPOSIX.a \ |
Ashok Thirumurthi | f6f5269 | 2013-07-17 16:06:12 +0000 | [diff] [blame] | 108 | lldbPluginProcessFreeBSD.a \ |
| 109 | lldbPluginProcessElfCore.a |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 110 | endif |
| 111 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 112 | include $(LEVEL)/Makefile.common |
| 113 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 114 | ifeq ($(HOST_OS),Darwin) |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 115 | LLVMLibsOptions += -Wl,-all_load |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 116 | # set dylib internal version number to llvmCore submission number |
| 117 | ifdef LLDB_SUBMIT_VERSION |
| 118 | LLVMLibsOptions += -Wl,-current_version \ |
| 119 | -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \ |
| 120 | -Wl,-compatibility_version -Wl,1 |
| 121 | endif |
| 122 | # extra options to override libtool defaults |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 123 | LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks |
Charles Davis | 1e58a39 | 2011-05-19 23:53:23 +0000 | [diff] [blame] | 124 | LLVMLibsOptions += -framework Foundation -framework CoreFoundation |
Bill Wendling | 5a45f24 | 2012-04-05 06:20:13 +0000 | [diff] [blame] | 125 | LLVMLibsOptions += -framework CoreServices -framework Carbon -framework Security |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 126 | LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc |
Filipe Cabecinhas | b9f6fd8 | 2012-10-31 23:02:00 +0000 | [diff] [blame] | 127 | LLVMLibsOptions += -lxml2 |
Filipe Cabecinhas | 93024d9 | 2012-05-29 13:41:50 +0000 | [diff] [blame] | 128 | ifneq ($(EXPORTED_SYMBOL_FILE),) |
| 129 | LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(EXPORTED_SYMBOL_FILE)" |
| 130 | endif |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 131 | # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line |
| 132 | DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') |
| 133 | ifneq ($(DARWIN_VERS),8) |
Daniel Dunbar | 2888f55 | 2011-10-31 22:50:30 +0000 | [diff] [blame] | 134 | LLVMLibsOptions += -Wl,-install_name \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 135 | -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" |
| 136 | endif |
| 137 | endif |
| 138 | |
Sylvestre Ledru | fa2cd91 | 2013-07-01 08:21:36 +0000 | [diff] [blame] | 139 | ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD)) |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 140 | # Include everything from the .a's into the shared library. |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 141 | ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 142 | -Wl,--no-whole-archive |
| 143 | # Don't allow unresolved symbols. |
| 144 | LLVMLibsOptions += -Wl,--no-undefined |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 145 | # Link in python |
Filipe Cabecinhas | 93024d9 | 2012-05-29 13:41:50 +0000 | [diff] [blame] | 146 | LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt |
Sylvestre Ledru | 5f6f3e2 | 2013-01-17 16:59:32 +0000 | [diff] [blame] | 147 | LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT) |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 148 | endif |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 149 | |
| 150 | ifeq ($(HOST_OS),FreeBSD) |
| 151 | # Include everything from the .a's into the shared library. |
| 152 | ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \ |
| 153 | -Wl,--no-whole-archive |
Johnny Chen | 7e99647 | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 154 | # Allow unresolved symbols. |
| 155 | LLVMLibsOptions += -Wl,--allow-shlib-undefined |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 156 | # Link in python |
Filipe Cabecinhas | 93024d9 | 2012-05-29 13:41:50 +0000 | [diff] [blame] | 157 | LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 158 | endif |