blob: f651e4233e5f5bb94a18bfd9966365b7704b1fbe [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 \
Greg Clayton54e7afa2010-07-09 20:39:50 +000036 lldbSymbol.a \
37 lldbTarget.a \
38 lldbUtility.a \
39 plugin_llvmc_Base.a \
40 plugin_llvmc_Clang.a \
41 clangAnalysis.a \
42 clangAST.a \
43 clangBasic.a \
44 clangCodeGen.a \
45 clangFrontend.a \
46 clangDriver.a \
47 clangIndex.a \
48 clangLex.a \
49 clangRewrite.a \
50 clangParse.a \
51 clangSema.a \
52 CompilerDriver.a \
53 EnhancedDisassembly.a \
Greg Clayton54e7afa2010-07-09 20:39:50 +000054 clangChecker.a
55
Eli Friedman26f93ce2010-07-09 22:11:43 +000056include $(LLDB_LEVEL)/../../Makefile.config
57
58LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
59 ipo selectiondag jit
60
61ifeq ($(HOST_OS),Darwin)
62 USEDLIBS += lldbHostMacOSX.a \
63 lldbPluginDynamicLoaderMacOSX.a \
64 lldbPluginObjectContainerUniversalMachO.a \
65 lldbPluginObjectFileMachO.a \
66 lldbPluginProcessGDBRemote.a \
Stephen Wilsonf6f40332010-07-24 02:19:04 +000067 lldbPluginUtility.a \
68 lldbSymbolVendorMaxOSX.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000069endif
70
71ifeq ($(HOST_OS),Linux)
Stephen Wilsonf6f40332010-07-24 02:19:04 +000072 USEDLIBS += lldbHostLinux.a \
73 lldbPluginProcessLinux.a
Eli Friedman26f93ce2010-07-09 22:11:43 +000074endif
75
Greg Clayton54e7afa2010-07-09 20:39:50 +000076include $(LEVEL)/Makefile.common
77
Greg Clayton54e7afa2010-07-09 20:39:50 +000078ifeq ($(HOST_OS),Darwin)
Eli Friedman26f93ce2010-07-09 22:11:43 +000079 LLVMLibsOptions += -Wl,-all_load
Greg Clayton54e7afa2010-07-09 20:39:50 +000080 # set dylib internal version number to llvmCore submission number
81 ifdef LLDB_SUBMIT_VERSION
82 LLVMLibsOptions += -Wl,-current_version \
83 -Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \
84 -Wl,-compatibility_version -Wl,1
85 endif
86 # extra options to override libtool defaults
87 LLVMLibsOptions += -avoid-version
88 LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
89 LLVMLibsOptions += -framework Foundation -framework CoreFoundation
90 LLVMLibsOptions += -framework DebugSymbols -lpython2.6 -lobjc
Greg Clayton980d0672010-07-12 23:14:00 +000091 LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports"
Greg Clayton54e7afa2010-07-09 20:39:50 +000092 # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
93 DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
94 ifneq ($(DARWIN_VERS),8)
95 LLVMLibsOptions += -no-undefined -Wl,-install_name \
96 -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
97 endif
98endif
99
100ifeq ($(HOST_OS), Linux)
101 # Include everything from the .a's into the shared library.
Eli Friedman26f93ce2010-07-09 22:11:43 +0000102 ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
Greg Clayton54e7afa2010-07-09 20:39:50 +0000103 -Wl,--no-whole-archive
104 # Don't allow unresolved symbols.
105 LLVMLibsOptions += -Wl,--no-undefined
Eli Friedman26f93ce2010-07-09 22:11:43 +0000106 # Link in python
107 LD.Flags += -lpython2.6
Greg Clayton54e7afa2010-07-09 20:39:50 +0000108endif