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 | |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 20 | PYTHON_BUILD_FLAGS = -lpython2.6 |
| 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 \ |
| 31 | lldbPluginABIMacOSX_i386.a \ |
| 32 | lldbPluginABISysV_x86_64.a \ |
| 33 | lldbPluginDisassemblerLLVM.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 34 | lldbPluginObjectContainerBSDArchive.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 35 | lldbPluginObjectFileELF.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 36 | lldbPluginSymbolFileDWARF.a \ |
| 37 | lldbPluginSymbolFileSymtab.a \ |
Stephen Wilson | 64dd0d7 | 2011-01-06 22:11:47 +0000 | [diff] [blame] | 38 | lldbPluginUtility.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 39 | lldbSymbol.a \ |
| 40 | lldbTarget.a \ |
| 41 | lldbUtility.a \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 42 | clangAnalysis.a \ |
| 43 | clangAST.a \ |
| 44 | clangBasic.a \ |
| 45 | clangCodeGen.a \ |
| 46 | clangFrontend.a \ |
| 47 | clangDriver.a \ |
| 48 | clangIndex.a \ |
| 49 | clangLex.a \ |
| 50 | clangRewrite.a \ |
| 51 | clangParse.a \ |
| 52 | clangSema.a \ |
Stephen Wilson | 64dd0d7 | 2011-01-06 22:11:47 +0000 | [diff] [blame] | 53 | clangSerialization.a \ |
Stephen Wilson | b6b6fae | 2011-01-25 23:03:42 +0000 | [diff] [blame] | 54 | EnhancedDisassembly.a |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 55 | |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 56 | include $(LLDB_LEVEL)/../../Makefile.config |
| 57 | |
| 58 | LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \ |
Stephen Wilson | 64dd0d7 | 2011-01-06 22:11:47 +0000 | [diff] [blame] | 59 | ipo selectiondag jit mc |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 60 | |
| 61 | ifeq ($(HOST_OS),Darwin) |
| 62 | USEDLIBS += lldbHostMacOSX.a \ |
| 63 | lldbPluginDynamicLoaderMacOSX.a \ |
| 64 | lldbPluginObjectContainerUniversalMachO.a \ |
| 65 | lldbPluginObjectFileMachO.a \ |
| 66 | lldbPluginProcessGDBRemote.a \ |
Stephen Wilson | a3f015e | 2010-07-24 05:18:16 +0000 | [diff] [blame] | 67 | lldbPluginSymbolVendorMacOSX.a |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 68 | endif |
| 69 | |
| 70 | ifeq ($(HOST_OS),Linux) |
Stephen Wilson | 92241ef | 2011-01-16 19:45:39 +0000 | [diff] [blame] | 71 | USEDLIBS += lldbPluginProcessLinux.a \ |
| 72 | lldbPluginDynamicLoaderLinux.a |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 73 | endif |
| 74 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 75 | include $(LEVEL)/Makefile.common |
| 76 | |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 77 | ifeq ($(HOST_OS),Darwin) |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 78 | LLVMLibsOptions += -Wl,-all_load |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 79 | # set dylib internal version number to llvmCore submission number |
| 80 | ifdef LLDB_SUBMIT_VERSION |
| 81 | LLVMLibsOptions += -Wl,-current_version \ |
| 82 | -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \ |
| 83 | -Wl,-compatibility_version -Wl,1 |
| 84 | endif |
| 85 | # extra options to override libtool defaults |
| 86 | LLVMLibsOptions += -avoid-version |
| 87 | LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks |
| 88 | LLVMLibsOptions += -framework Foundation -framework CoreFoundation |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 89 | LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc |
Greg Clayton | 980d067 | 2010-07-12 23:14:00 +0000 | [diff] [blame] | 90 | 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] | 91 | # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line |
| 92 | DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') |
| 93 | ifneq ($(DARWIN_VERS),8) |
| 94 | LLVMLibsOptions += -no-undefined -Wl,-install_name \ |
| 95 | -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)" |
| 96 | endif |
| 97 | endif |
| 98 | |
| 99 | ifeq ($(HOST_OS), Linux) |
| 100 | # Include everything from the .a's into the shared library. |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 101 | ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \ |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 102 | -Wl,--no-whole-archive |
| 103 | # Don't allow unresolved symbols. |
| 104 | LLVMLibsOptions += -Wl,--no-undefined |
Eli Friedman | 26f93ce | 2010-07-09 22:11:43 +0000 | [diff] [blame] | 105 | # Link in python |
Greg Clayton | 1a2f311 | 2011-02-05 02:32:19 +0000 | [diff] [blame] | 106 | LD.Flags += $(PYTHON_BUILD_FLAGS) |
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 107 | endif |