2010-07-10 04:39:50 +08:00
|
|
|
##===- source/Makefile -------------------------------------*- Makefile -*-===##
|
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
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 \
|
2010-09-08 04:11:56 +08:00
|
|
|
lldbHostCommon.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbInitAndLog.a \
|
|
|
|
lldbInterpreter.a \
|
2011-05-20 02:32:34 +08:00
|
|
|
lldbPluginABIMacOSX_arm.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginABIMacOSX_i386.a \
|
|
|
|
lldbPluginABISysV_x86_64.a \
|
|
|
|
lldbPluginDisassemblerLLVM.a \
|
2011-03-08 11:57:00 +08:00
|
|
|
lldbPluginDynamicLoaderStatic.a \
|
2012-05-29 21:41:50 +08:00
|
|
|
lldbPluginDynamicLoaderPOSIX.a \
|
2011-04-08 10:01:35 +08:00
|
|
|
lldbPluginEmulateInstructionARM.a \
|
2011-05-20 07:53:23 +08:00
|
|
|
lldbPluginLanguageRuntimeCPlusPlusItaniumABI.a \
|
|
|
|
lldbPluginLanguageRuntimeObjCAppleObjCRuntime.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginObjectContainerBSDArchive.a \
|
|
|
|
lldbPluginObjectFileELF.a \
|
2013-07-02 03:45:50 +08:00
|
|
|
lldbPluginSymbolVendorELF.a \
|
2011-10-12 00:42:21 +08:00
|
|
|
lldbPluginObjectFilePECOFF.a \
|
2012-08-28 21:59:38 +08:00
|
|
|
lldbPluginOperatingSystemPython.a \
|
2011-03-26 08:32:59 +08:00
|
|
|
lldbPluginPlatformGDBServer.a \
|
|
|
|
lldbPluginProcessGDBRemote.a \
|
2010-07-10 04:39:50 +08:00
|
|
|
lldbPluginSymbolFileDWARF.a \
|
|
|
|
lldbPluginSymbolFileSymtab.a \
|
2011-05-20 01:34:58 +08:00
|
|
|
lldbPluginUnwindAssemblyInstEmulation.a \
|
|
|
|
lldbPluginUnwindAssemblyx86.a \
|
2011-01-07 06:11:47 +08:00
|
|
|
lldbPluginUtility.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 \
|
|
|
|
lldbPluginPlatformMacOSX.a \
|
|
|
|
lldbPluginPlatformLinux.a \
|
2013-10-15 21:52:20 +08:00
|
|
|
lldbPluginPlatformWindows.a \
|
2013-08-27 07:57:52 +08:00
|
|
|
lldbPluginPlatformFreeBSD.a \
|
|
|
|
lldbPluginPlatformPOSIX.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))
|
2012-12-11 05:05:57 +08:00
|
|
|
USEDLIBS += clangRewriteCore.a \
|
|
|
|
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 \
|
2013-06-15 07:00:27 +08:00
|
|
|
instrumentation ipo irreader selectiondag jit mc mcjit \
|
|
|
|
linker option
|
2010-07-10 06:11:43 +08:00
|
|
|
|
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
|
|
USEDLIBS += lldbHostMacOSX.a \
|
|
|
|
lldbPluginDynamicLoaderMacOSX.a \
|
2011-11-01 06:51:08 +08:00
|
|
|
lldbPluginDynamicLoaderDarwinKernel.a \
|
2010-07-10 06:11:43 +08:00
|
|
|
lldbPluginObjectContainerUniversalMachO.a \
|
|
|
|
lldbPluginObjectFileMachO.a \
|
2011-03-10 11:08:28 +08:00
|
|
|
lldbPluginSymbolVendorMacOSX.a \
|
2012-02-25 02:02:59 +08:00
|
|
|
lldbPluginProcessDarwin.a \
|
|
|
|
lldbPluginProcessMachCore.a
|
2010-07-10 06:11:43 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(HOST_OS),Linux)
|
2012-10-04 10:16:06 +08:00
|
|
|
USEDLIBS += lldbHostLinux.a \
|
2012-01-06 03:17:38 +08:00
|
|
|
lldbPluginProcessLinux.a \
|
2012-10-04 10:16:06 +08:00
|
|
|
lldbPluginProcessPOSIX.a \
|
2013-07-18 00:06:12 +08:00
|
|
|
lldbPluginDynamicLoaderMacOSX.a \
|
|
|
|
lldbPluginProcessElfCore.a
|
2010-07-10 06:11:43 +08:00
|
|
|
endif
|
2010-07-10 04:39:50 +08:00
|
|
|
|
2013-07-01 16:21:36 +08:00
|
|
|
ifneq (,$(filter $(HOST_OS), FreeBSD GNU/kFreeBSD))
|
2011-08-03 04:52:42 +08:00
|
|
|
USEDLIBS += lldbHostFreeBSD.a \
|
2012-01-06 03:17:38 +08:00
|
|
|
lldbPluginProcessPOSIX.a \
|
2013-07-18 00:06:12 +08:00
|
|
|
lldbPluginProcessFreeBSD.a \
|
|
|
|
lldbPluginProcessElfCore.a
|
2011-08-03 04:52:42 +08:00
|
|
|
endif
|
|
|
|
|
2010-07-10 06:11:43 +08:00
|
|
|
include $(LEVEL)/Makefile.common
|
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
|
|
|
|
# extra options to override libtool defaults
|
|
|
|
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
|
2012-11-01 07:02:00 +08:00
|
|
|
LLVMLibsOptions += -lxml2
|
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
|
2012-05-29 21:41:50 +08:00
|
|
|
LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt
|
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
|
2012-05-29 21:41:50 +08:00
|
|
|
LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo
|
2011-08-03 04:52:42 +08:00
|
|
|
endif
|