2010-07-10 04:39:50 +08:00
|
|
|
##===- source/Makefile -------------------------------------*- Makefile -*-===##
|
2015-07-15 04:25:19 +08:00
|
|
|
#
|
2010-07-10 04:39:50 +08:00
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
2015-07-15 04:25:19 +08:00
|
|
|
#
|
2010-07-10 04:39:50 +08:00
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
LEVEL := ../../..
|
|
|
|
LLDB_LEVEL := ..
|
|
|
|
|
|
|
|
LIBRARYNAME = lldb
|
|
|
|
|
2012-05-29 21:41:50 +08:00
|
|
|
#EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/$(LLDB_LEVEL)/resources/lldb-framework-exports
|
2010-07-10 04:39:50 +08:00
|
|
|
NO_BUILD_ARCHIVE = 1
|
|
|
|
LINK_LIBS_IN_SHARED = 1
|
|
|
|
SHARED_LIBRARY = 1
|
|
|
|
|
2013-08-23 20:44:05 +08:00
|
|
|
ifeq (,$(findstring -DLLDB_DISABLE_PYTHON,$(CXXFLAGS)))
|
2011-05-20 07:09:48 +08:00
|
|
|
PYTHON_BUILD_FLAGS = $(shell python-config --ldflags)
|
2013-08-23 20:44:05 +08:00
|
|
|
endif
|
2011-02-05 10:32:19 +08:00
|
|
|
|
2012-05-29 21:41:50 +08:00
|
|
|
# Include all archives in liblldb.so file
|
2010-07-10 04:39:50 +08:00
|
|
|
USEDLIBS = lldbAPI.a \
|
|
|
|
lldbBreakpoint.a \
|
|
|
|
lldbCommands.a \
|
|
|
|
lldbCore.a \
|
2013-01-30 08:28:58 +08:00
|
|
|
lldbDataFormatters.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbExpression.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbInitialization.a \
|
|
|
|
lldbHost.a \
|
|
|
|
lldbBase.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbInterpreter.a \
|
2011-05-20 02:32:34 +08:00
|
|
|
lldbPluginABIMacOSX_arm.a \
|
2014-03-30 02:54:20 +08:00
|
|
|
lldbPluginABIMacOSX_arm64.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginABIMacOSX_i386.a \
|
2015-04-29 18:49:45 +08:00
|
|
|
lldbPluginABISysV_arm.a \
|
2015-04-29 19:52:35 +08:00
|
|
|
lldbPluginABISysV_arm64.a \
|
2014-10-31 23:57:52 +08:00
|
|
|
lldbPluginABISysV_ppc.a \
|
2014-10-31 10:34:28 +08:00
|
|
|
lldbPluginABISysV_ppc64.a \
|
2015-06-18 16:38:40 +08:00
|
|
|
lldbPluginABISysV_mips.a \
|
2015-06-19 12:25:07 +08:00
|
|
|
lldbPluginABISysV_mips64.a \
|
2015-06-26 01:50:15 +08:00
|
|
|
lldbPluginABISysV_i386.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginABISysV_x86_64.a \
|
2014-07-22 01:24:05 +08:00
|
|
|
lldbPluginABISysV_hexagon.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginDisassemblerLLVM.a \
|
2011-03-08 11:57:00 +08:00
|
|
|
lldbPluginDynamicLoaderStatic.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbPluginDynamicLoaderPosixDYLD.a \
|
2014-07-22 01:24:05 +08:00
|
|
|
lldbPluginDynamicLoaderHexagon.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbPluginDynamicLoaderMacOSXDYLD.a \
|
2015-07-10 01:09:09 +08:00
|
|
|
lldbPluginDynamicLoaderWindowsDYLD.a \
|
2015-09-06 04:01:56 +08:00
|
|
|
lldbPluginExpressionParserClang.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbPluginInstructionARM.a \
|
|
|
|
lldbPluginInstructionARM64.a \
|
|
|
|
lldbPluginInstructionMIPS.a \
|
|
|
|
lldbPluginInstructionMIPS64.a \
|
2014-10-11 08:38:55 +08:00
|
|
|
lldbPluginInstrumentationRuntimeAddressSanitizer.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbPluginCXXItaniumABI.a \
|
|
|
|
lldbPluginAppleObjCRuntime.a \
|
|
|
|
lldbPluginRenderScriptRuntime.a \
|
2014-09-08 12:53:03 +08:00
|
|
|
lldbPluginMemoryHistoryASan.a \
|
2015-09-06 04:01:56 +08:00
|
|
|
lldbPluginCPlusPlusLanguage.a \
|
2015-10-08 19:17:01 +08:00
|
|
|
lldbPluginLanguageRuntimeGo.a \
|
2015-09-06 04:01:56 +08:00
|
|
|
lldbPluginObjCLanguage.a \
|
|
|
|
lldbPluginObjCPlusPlusLanguage.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginObjectContainerBSDArchive.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbPluginObjectContainerMachOArchive.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginObjectFileELF.a \
|
2014-03-25 10:03:28 +08:00
|
|
|
lldbPluginObjectFileJIT.a \
|
2013-07-02 03:45:50 +08:00
|
|
|
lldbPluginSymbolVendorELF.a \
|
2011-10-12 00:42:21 +08:00
|
|
|
lldbPluginObjectFilePECOFF.a \
|
2015-09-17 05:20:44 +08:00
|
|
|
lldbPluginOSGo.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbPluginOSPython.a \
|
|
|
|
lldbPluginPlatformGDB.a \
|
2015-09-11 08:31:33 +08:00
|
|
|
lldbPluginProcessElfCore.a \
|
2011-03-26 08:32:59 +08:00
|
|
|
lldbPluginProcessGDBRemote.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginSymbolFileDWARF.a \
|
|
|
|
lldbPluginSymbolFileSymtab.a \
|
2015-03-02 23:14:50 +08:00
|
|
|
lldbPluginSystemRuntimeMacOSX.a \
|
2011-05-20 01:34:58 +08:00
|
|
|
lldbPluginUnwindAssemblyInstEmulation.a \
|
2015-07-15 04:25:19 +08:00
|
|
|
lldbPluginUnwindAssemblyX86.a \
|
2015-07-16 06:39:44 +08:00
|
|
|
lldbPluginProcessUtility.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbSymbol.a \
|
|
|
|
lldbTarget.a \
|
|
|
|
lldbUtility.a \
|
|
|
|
clangAnalysis.a \
|
|
|
|
clangAST.a \
|
|
|
|
clangBasic.a \
|
|
|
|
clangCodeGen.a \
|
|
|
|
clangFrontend.a \
|
|
|
|
clangDriver.a \
|
2012-03-14 19:03:46 +08:00
|
|
|
clangEdit.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
clangLex.a \
|
|
|
|
clangParse.a \
|
|
|
|
clangSema.a \
|
2011-01-07 06:11:47 +08:00
|
|
|
clangSerialization.a \
|
2012-02-29 02:25:00 +08:00
|
|
|
LLVMMCDisassembler.a \
|
2014-04-25 17:49:32 +08:00
|
|
|
LLVMProfileData.a \
|
2015-09-11 11:52:08 +08:00
|
|
|
LLVMObjCARCOpts.a \
|
2012-02-29 02:25:00 +08:00
|
|
|
lldbPluginPlatformMacOSX.a \
|
|
|
|
lldbPluginPlatformLinux.a \
|
2013-10-15 21:52:20 +08:00
|
|
|
lldbPluginPlatformWindows.a \
|
2013-08-27 07:57:52 +08:00
|
|
|
lldbPluginPlatformFreeBSD.a \
|
2015-10-24 09:28:24 +08:00
|
|
|
lldbPluginPlatformNetBSD.a \
|
2014-07-16 23:03:10 +08:00
|
|
|
lldbPluginPlatformPOSIX.a \
|
2015-02-13 20:27:24 +08:00
|
|
|
lldbPluginPlatformKalimba.a \
|
2015-08-05 20:46:53 +08:00
|
|
|
lldbPluginPlatformAndroid.a \
|
2015-09-11 18:37:17 +08:00
|
|
|
lldbPluginJITLoaderGDB.a \
|
2015-08-05 20:46:53 +08:00
|
|
|
lldbPluginScriptInterpreterNone.a \
|
|
|
|
lldbPluginScriptInterpreterPython.a
|
2010-07-10 04:39:50 +08:00
|
|
|
|
2012-12-11 05:05:57 +08:00
|
|
|
# Because GCC requires RTTI enabled for lldbCore (see source/Core/Makefile) it is
|
|
|
|
# necessary to also link the clang rewriter libraries so vtable references can
|
|
|
|
# be resolved correctly, if we are building with GCC.
|
2013-08-23 20:44:05 +08:00
|
|
|
ifeq (g++,$(shell basename $(CXX) | cut -c 1-4))
|
2014-07-17 02:53:18 +08:00
|
|
|
USEDLIBS += clangRewrite.a \
|
2012-12-11 05:05:57 +08:00
|
|
|
clangRewriteFrontend.a
|
|
|
|
endif
|
|
|
|
|
2010-07-10 06:11:43 +08:00
|
|
|
include $(LLDB_LEVEL)/../../Makefile.config
|
|
|
|
|
|
|
|
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
|
2014-09-06 10:03:06 +08:00
|
|
|
instrumentation ipo irreader selectiondag mc mcjit \
|
2013-06-15 07:00:27 +08:00
|
|
|
linker option
|
2010-07-10 06:11:43 +08:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),Darwin)
|
2015-07-15 04:25:19 +08:00
|
|
|
USEDLIBS += lldbPluginDynamicLoaderDarwinKernel.a \
|
2010-07-10 06:11:43 +08:00
|
|
|
lldbPluginObjectFileMachO.a \
|
2011-03-10 11:08:28 +08:00
|
|
|
lldbPluginSymbolVendorMacOSX.a \
|
2012-02-25 02:02:59 +08:00
|
|
|
lldbPluginProcessDarwin.a \
|
2015-09-11 18:37:17 +08:00
|
|
|
lldbPluginProcessMachCore.a
|
2010-07-10 06:11:43 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),Linux)
|
2015-07-15 04:25:19 +08:00
|
|
|
USEDLIBS += lldbPluginProcessLinux.a \
|
2015-09-11 18:37:17 +08:00
|
|
|
lldbPluginProcessPOSIX.a
|
2014-03-13 00:04:29 +08:00
|
|
|
endif
|
|
|
|
|
2013-07-01 16:21:36 +08:00
|
|
|
ifneq (,$(filter $(HOST_OS), FreeBSD GNU/kFreeBSD))
|
2015-07-15 04:25:19 +08:00
|
|
|
USEDLIBS += lldbPluginProcessPOSIX.a \
|
2015-09-11 18:37:17 +08:00
|
|
|
lldbPluginProcessFreeBSD.a
|
2011-08-03 04:52:42 +08:00
|
|
|
endif
|
|
|
|
|
2015-10-24 09:28:24 +08:00
|
|
|
ifeq ($(HOST_OS),NetBSD)
|
|
|
|
USEDLIBS += lldbPluginProcessPOSIX.a
|
|
|
|
endif
|
|
|
|
|
2010-07-10 06:11:43 +08:00
|
|
|
include $(LEVEL)/Makefile.common
|
2010-07-10 04:39:50 +08:00
|
|
|
|
2014-03-13 19:12:05 +08:00
|
|
|
ifeq ($(HOST_OS),MingW)
|
|
|
|
LLVMLibsOptions += -lws2_32
|
2014-03-24 21:44:52 +08:00
|
|
|
# Include everything from the .a's into the shared library.
|
|
|
|
ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
|
|
|
|
-Wl,--no-whole-archive
|
2014-03-13 19:12:05 +08:00
|
|
|
endif
|
|
|
|
|
2010-07-10 04:39:50 +08:00
|
|
|
ifeq ($(HOST_OS),Darwin)
|
2010-07-10 06:11:43 +08:00
|
|
|
LLVMLibsOptions += -Wl,-all_load
|
2010-07-10 04:39:50 +08:00
|
|
|
# set dylib internal version number to llvmCore submission number
|
|
|
|
ifdef LLDB_SUBMIT_VERSION
|
|
|
|
LLVMLibsOptions += -Wl,-current_version \
|
|
|
|
-Wl,$(LLDB_SUBMIT_VERSION).$(LLDB_SUBMIT_SUBVERSION) \
|
|
|
|
-Wl,-compatibility_version -Wl,1
|
|
|
|
endif
|
2015-07-15 04:25:19 +08:00
|
|
|
# extra options to override libtool defaults
|
2010-07-10 04:39:50 +08:00
|
|
|
LLVMLibsOptions += -F/System/Library/Frameworks -F/System/Library/PrivateFrameworks
|
2011-05-20 07:53:23 +08:00
|
|
|
LLVMLibsOptions += -framework Foundation -framework CoreFoundation
|
2012-04-05 14:20:13 +08:00
|
|
|
LLVMLibsOptions += -framework CoreServices -framework Carbon -framework Security
|
2011-02-05 10:32:19 +08:00
|
|
|
LLVMLibsOptions += -framework DebugSymbols $(PYTHON_BUILD_FLAGS) -lobjc
|
2014-03-01 05:55:46 +08:00
|
|
|
LLVMLibsOptions += -lxml2 -ledit -lpanel -lcurses
|
2012-05-29 21:41:50 +08:00
|
|
|
ifneq ($(EXPORTED_SYMBOL_FILE),)
|
|
|
|
LLVMLibsOptions += -Wl,-exported_symbols_list -Wl,"$(EXPORTED_SYMBOL_FILE)"
|
|
|
|
endif
|
2010-07-10 04:39:50 +08:00
|
|
|
# Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
|
|
|
|
DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
|
|
|
|
ifneq ($(DARWIN_VERS),8)
|
2011-11-01 06:50:30 +08:00
|
|
|
LLVMLibsOptions += -Wl,-install_name \
|
2010-07-10 04:39:50 +08:00
|
|
|
-Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-07-01 16:21:36 +08:00
|
|
|
ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux GNU GNU/kFreeBSD))
|
2010-07-10 04:39:50 +08:00
|
|
|
# Include everything from the .a's into the shared library.
|
2010-07-10 06:11:43 +08:00
|
|
|
ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
|
2010-07-10 04:39:50 +08:00
|
|
|
-Wl,--no-whole-archive
|
|
|
|
# Don't allow unresolved symbols.
|
|
|
|
LLVMLibsOptions += -Wl,--no-undefined
|
2010-07-10 06:11:43 +08:00
|
|
|
# Link in python
|
2015-06-30 05:52:45 +08:00
|
|
|
LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -ledit -lncurses -lpanel -lpthread
|
2013-01-18 00:59:32 +08:00
|
|
|
LLVMLibsOptions += -Wl,--soname,lib$(LIBRARYNAME)$(SHLIBEXT)
|
2010-07-10 04:39:50 +08:00
|
|
|
endif
|
2011-08-03 04:52:42 +08:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),FreeBSD)
|
|
|
|
# Include everything from the .a's into the shared library.
|
|
|
|
ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
|
|
|
|
-Wl,--no-whole-archive
|
2012-01-06 03:17:38 +08:00
|
|
|
# Allow unresolved symbols.
|
|
|
|
LLVMLibsOptions += -Wl,--allow-shlib-undefined
|
2011-08-03 04:52:42 +08:00
|
|
|
# Link in python
|
2014-01-31 22:30:11 +08:00
|
|
|
LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo \
|
2015-06-30 05:52:45 +08:00
|
|
|
-ledit -lncurses -lpanel -lpthread
|
2011-08-03 04:52:42 +08:00
|
|
|
endif
|