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 | |
| 15 | #EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/../resources/lldb-framework-exports |
| 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 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 22 | # Include all archives in liblldb.a files |
| 23 | USEDLIBS = lldbAPI.a \ |
| 24 | lldbBreakpoint.a \ |
| 25 | lldbCommands.a \ |
| 26 | lldbCore.a \ |
| 27 | lldbExpression.a \ |
Greg Clayton | 8f3b21d | 2010-09-07 20:11:56 +0000 | [diff] [blame] | 28 | lldbHostCommon.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 29 | lldbInitAndLog.a \ |
| 30 | lldbInterpreter.a \ |
Peter Collingbourne | b7f5945 | 2011-05-19 18:32:34 +0000 | [diff] [blame] | 31 | lldbPluginABIMacOSX_arm.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 32 | lldbPluginABIMacOSX_i386.a \ |
| 33 | lldbPluginABISysV_x86_64.a \ |
| 34 | lldbPluginDisassemblerLLVM.a \ |
Stephen Wilson | 8be525a | 2011-03-08 03:57:00 +0000 | [diff] [blame] | 35 | lldbPluginDynamicLoaderStatic.a \ |
Stephen Wilson | ec113d4 | 2011-04-08 02:01:35 +0000 | [diff] [blame] | 36 | lldbPluginEmulateInstructionARM.a \ |
Charles Davis | 1e58a39 | 2011-05-19 23:53:23 +0000 | [diff] [blame] | 37 | lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \ |
| 38 | lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 39 | lldbPluginObjectContainerBSDArchive.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 40 | lldbPluginObjectFileELF.a \ |
Greg Clayton | fa407ad | 2011-10-11 16:42:21 +0000 | [diff] [blame] | 41 | lldbPluginObjectFilePECOFF.a \ |
Stephen Wilson | 3967cef | 2011-03-26 00:32:59 +0000 | [diff] [blame] | 42 | lldbPluginPlatformGDBServer.a \ |
| 43 | lldbPluginProcessGDBRemote.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 44 | lldbPluginSymbolFileDWARF.a \ |
| 45 | lldbPluginSymbolFileSymtab.a \ |
Peter Collingbourne | 59d4cb8 | 2011-05-19 17:34:58 +0000 | [diff] [blame] | 46 | lldbPluginUnwindAssemblyInstEmulation.a \ |
| 47 | lldbPluginUnwindAssemblyx86.a \ |
Stephen Wilson | 64dd0d7 | 2011-01-06 22:11:47 +0000 | [diff] [blame] | 48 | lldbPluginUtility.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 49 | lldbSymbol.a \ |
| 50 | lldbTarget.a \ |
| 51 | lldbUtility.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 52 | clangAnalysis.a \ |
| 53 | clangAST.a \ |
| 54 | clangBasic.a \ |
| 55 | clangCodeGen.a \ |
| 56 | clangFrontend.a \ |
| 57 | clangDriver.a \ |
Benjamin Kramer | 9930b33 | 2012-03-14 11:03:46 +0000 | [diff] [blame^] | 58 | clangEdit.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 59 | clangIndex.a \ |
| 60 | clangLex.a \ |
| 61 | clangRewrite.a \ |
| 62 | clangParse.a \ |
| 63 | clangSema.a \ |
Stephen Wilson | 64dd0d7 | 2011-01-06 22:11:47 +0000 | [diff] [blame] | 64 | clangSerialization.a \ |
Greg Clayton | ed60571 | 2012-02-28 18:25:00 +0000 | [diff] [blame] | 65 | LLVMMCDisassembler.a \ |
| 66 | lldbPluginPlatformMacOSX.a \ |
| 67 | lldbPluginPlatformLinux.a \ |
| 68 | lldbPluginPlatformFreeBSD.a |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 69 | |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 70 | include $(LLDB_LEVEL)/../../Makefile.config |
| 71 | |
| 72 | LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \ |
Daniel Dunbar | fd0c1f4 | 2011-11-01 17:32:01 +0000 | [diff] [blame] | 73 | instrumentation ipo selectiondag jit mc mcjit linker |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 74 | |
| 75 | ifeq ($(HOST_OS),Darwin) |
| 76 | USEDLIBS += lldbHostMacOSX.a \ |
| 77 | lldbPluginDynamicLoaderMacOSX.a \ |
Daniel Dunbar | 8e584ec | 2011-10-31 22:51:08 +0000 | [diff] [blame] | 78 | lldbPluginDynamicLoaderDarwinKernel.a \ |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 79 | lldbPluginObjectContainerUniversalMachO.a \ |
| 80 | lldbPluginObjectFileMachO.a \ |
Daniel Dunbar | 8f4cdb4 | 2011-10-31 22:51:11 +0000 | [diff] [blame] | 81 | lldbPluginOperatingSystemDarwinKernel.a \ |
Stephen Wilson | ef6635b | 2011-03-10 03:08:28 +0000 | [diff] [blame] | 82 | lldbPluginSymbolVendorMacOSX.a \ |
Johnny Chen | 7637a3a | 2012-02-24 18:02:59 +0000 | [diff] [blame] | 83 | lldbPluginProcessDarwin.a \ |
| 84 | lldbPluginProcessMachCore.a |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 85 | endif |
| 86 | |
| 87 | ifeq ($(HOST_OS),Linux) |
Johnny Chen | 7e99647 | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 88 | USEDLIBS += lldbPluginProcessPOSIX.a \ |
| 89 | lldbPluginProcessLinux.a \ |
| 90 | lldbPluginDynamicLoaderPOSIX.a \ |
Stephen Wilson | 76fd5dd | 2011-03-23 01:58:26 +0000 | [diff] [blame] | 91 | lldbHostLinux.a |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 92 | endif |
| 93 | |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 94 | ifeq ($(HOST_OS),FreeBSD) |
| 95 | USEDLIBS += lldbHostFreeBSD.a \ |
Johnny Chen | 7e99647 | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 96 | lldbPluginDynamicLoaderPOSIX.a \ |
| 97 | lldbPluginProcessPOSIX.a \ |
Greg Clayton | ed60571 | 2012-02-28 18:25:00 +0000 | [diff] [blame] | 98 | lldbPluginProcessFreeBSD.a |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 99 | endif |
| 100 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 101 | include $(LEVEL)/Makefile.common |
| 102 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 103 | ifeq ($(HOST_OS),Darwin) |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 104 | LLVMLibsOptions += -Wl,-all_load |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 105 | # set dylib internal version number to llvmCore submission number |
| 106 | ifdef LLDB_SUBMIT_VERSION |
| 107 | LLVMLibsOptions += -Wl,-current_version \ |
| 108 | -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \ |
| 109 | -Wl,-compatibility_version -Wl,1 |
| 110 | endif |
| 111 | # extra options to override libtool defaults |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 112 | LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks |
Charles Davis | 1e58a39 | 2011-05-19 23:53:23 +0000 | [diff] [blame] | 113 | LLVMLibsOptions += -framework Foundation -framework CoreFoundation |
| 114 | LLVMLibsOptions += -framework CoreServices -framework Carbon |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 115 | LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc |
Greg Clayton | 980d067 | 2010-07-12 23:14:00 +0000 | [diff] [blame] | 116 | LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports" |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 117 | # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line |
| 118 | DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') |
| 119 | ifneq ($(DARWIN_VERS),8) |
Daniel Dunbar | 2888f55 | 2011-10-31 22:50:30 +0000 | [diff] [blame] | 120 | LLVMLibsOptions += -Wl,-install_name \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 121 | -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" |
| 122 | endif |
| 123 | endif |
| 124 | |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 125 | ifeq ($(HOST_OS),Linux) |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 126 | # Include everything from the .a's into the shared library. |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 127 | ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 128 | -Wl,--no-whole-archive |
| 129 | # Don't allow unresolved symbols. |
| 130 | LLVMLibsOptions += -Wl,--no-undefined |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 131 | # Link in python |
Stephen Wilson | ec113d4 | 2011-04-08 02:01:35 +0000 | [diff] [blame] | 132 | LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 133 | endif |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 134 | |
| 135 | ifeq ($(HOST_OS),FreeBSD) |
| 136 | # Include everything from the .a's into the shared library. |
| 137 | ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \ |
| 138 | -Wl,--no-whole-archive |
Johnny Chen | 7e99647 | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 139 | # Allow unresolved symbols. |
| 140 | LLVMLibsOptions += -Wl,--allow-shlib-undefined |
Johnny Chen | 4b66329 | 2011-08-02 20:52:42 +0000 | [diff] [blame] | 141 | # Link in python |
| 142 | LD.Flags += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo |
| 143 | endif |