blob: 5e37a24e6c1f75ec41ccf545f06218e386d22e86 [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
20# Include all archives in liblldb.a files
21USEDLIBS = lldbAPI.a \
22 lldbBreakpoint.a \
23 lldbCommands.a \
24 lldbCore.a \
25 lldbExpression.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000026 lldbHostPosix.a \
27 lldbInitAndLog.a \
28 lldbInterpreter.a \
29 lldbPluginABIMacOSX_i386.a \
30 lldbPluginABISysV_x86_64.a \
31 lldbPluginDisassemblerLLVM.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000032 lldbPluginObjectContainerBSDArchive.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000033 lldbPluginObjectFileELF.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000034 lldbPluginSymbolFileDWARF.a \
35 lldbPluginSymbolFileSymtab.a \
36 lldbPluginSymbolVendorMacOSX.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000037 lldbSymbol.a \
38 lldbTarget.a \
39 lldbUtility.a \
40 plugin_llvmc_Base.a \
41 plugin_llvmc_Clang.a \
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 \
53 CompilerDriver.a \
54 EnhancedDisassembly.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000055 clangChecker.a
56
Eli Friedman26f93ce2010-07-09 22:11:43 +000057include $(LLDB_LEVEL)/../../Makefile.config
58
59LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
60 ipo selectiondag jit
61
62ifeq ($(HOST_OS),Darwin)
63 USEDLIBS += lldbHostMacOSX.a \
64 lldbPluginDynamicLoaderMacOSX.a \
65 lldbPluginObjectContainerUniversalMachO.a \
66 lldbPluginObjectFileMachO.a \
67 lldbPluginProcessGDBRemote.a \
68 lldbPluginUtility.a
69endif
70
71ifeq ($(HOST_OS),Linux)
72 USEDLIBS += lldbHostLinux.a
73endif
74
Greg Clayton54e7afa2010-07-09 20:39:50 +000075include $(LEVEL)/Makefile.common
76
Greg Clayton54e7afa2010-07-09 20:39:50 +000077ifeq ($(HOST_OS),Darwin)
Eli Friedman26f93ce2010-07-09 22:11:43 +000078 LLVMLibsOptions += -Wl,-all_load
Greg Clayton54e7afa2010-07-09 20:39:50 +000079 # 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
89 LLVMLibsOptions += -framework DebugSymbols -lpython2.6 -lobjc
90 LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,$(LLDB_LEVEL)/resources/lldb-framework-exports
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
97endif
98
99ifeq ($(HOST_OS), Linux)
100 # Include everything from the .a's into the shared library.
Eli Friedman26f93ce2010-07-09 22:11:43 +0000101 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000102 -Wl,--no-whole-archive
103 # Don't allow unresolved symbols.
104 LLVMLibsOptions += -Wl,--no-undefined
Eli Friedman26f93ce2010-07-09 22:11:43 +0000105 # Link in python
106 LD.Flags += -lpython2.6
Greg Clayton54e7afa2010-07-09 20:39:50 +0000107endif