Makefile.kmk revision 6785933f645ac117df702bbae16c57b3acca5100
# $Id$
## @file
# Makefile for the VBox debugger.
#
#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
DEPTH = ../../..
include $(KBUILD_PATH)/header.kmk
#
# The targets.
#
ifdef VBOX_WITH_DEBUGGER
LIBRARIES += Debugger
ifdef VBOX_WITH_TESTCASES
PROGRAMS += tstDBGCParser
endif
ifdef VBOX_WITH_DEBUGGER_GUI
DLLS += VBoxDbg
ifdef VBOX_WITH_TESTCASES
PROGRAMS += tstVBoxDbg
endif
endif
endif # VBOX_WITH_DEBUGGER
ifndef VBOX_OSE
INSTALLS.win.x86 += dbghelp
endif
#
# Debugger library - linked into VBoxVMM.
#
Debugger_TEMPLATE = VBOXR3
Debugger_DEFS = IN_VMM_R3 IN_PDM_R3 IN_CFGM_R3 IN_IOM_R3 IN_SUP_R3 IN_VM_R3 IN_RT_R3 IN_CPUM_R3 IN_SELM_R3 IN_PGM_R3 IN_TRPM_R3 IN_MM_R3 IN_DBG_R3 IN_DBGF_R3 IN_DIS_R3
Debugger_SOURCES = \
DBGConsole.cpp \
DBGCBuiltInSymbols.cpp \
DBGCCmdHlp.cpp \
DBGCCmdWorkers.cpp \
DBGCCommands.cpp \
DBGCEmulateCodeView.cpp \
DBGCOps.cpp \
DBGCTcp.cpp \
DBGPlugInSolaris.cpp
#
# The DBGC parser testcase.
# This stubs all the VBoxVMM APIs.
#
tstDBGCParser_TEMPLATE = VBOXR3TSTEXE
tstDBGCParser_DEFS = IN_DBGF_R3 IN_CPUM_R3 IN_MM_R3 IN_PGM_R3 IN_SELM_R3
tstDBGCParser_SOURCES = \
testcase/tstDBGCParser.cpp \
testcase/tstDBGCStubs.cpp
tstDBGCParser_LIBS = \
$(TARGET_Debugger) \
$(LIB_RUNTIME)
#
# Debugger GUI component.
#
VBoxDbg_TEMPLATE = VBOXQTGUI
VBoxDbg_DEFS = IN_DBG_R3
VBoxDbg_CXXFLAGS.linux = $(TEMPLATE_VBOXQTGUI_CXXFLAGS.linux) -O2
VBoxDbg_INCS = \
. \
$(PATH_VBoxDbg)/ui \
$(PATH_VBoxDbg)/moc \
$(PATH_VBoxDbg)/include
# QDesigner UI sources
VBoxDbg_QT_UISRCS =
# Headers containing definitions of classes that use the Q_OBJECT macro
VBoxDbg_QT_MOCHDRS = \
VBoxDbgConsole.h \
VBoxDbgStats.h \
VBoxDbgGui.h
# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
VBoxDbg_QT_MOCUIHDRS =
VBoxDbg_GENSRCS = \
$(foreach moc,$(notdir $(basename $(VBoxDbg_QT_MOCHDRS))), $(PATH_VBoxDbg)/moc/moc_$(moc).cpp) \
$(foreach ui,$(notdir $(basename $(VBoxDbg_QT_UISRCS))), $(PATH_VBoxDbg)/ui/$(ui).cpp $(PATH_VBoxDbg)/moc/moc_$(ui).cpp)
VBoxDbg_GENHDRS = \
$(foreach mocui,$(basename $(VBoxDbg_QT_MOCUIHDRS)), $(PATH_VBoxDbg)/moc/$(mocui).moc) \
$(foreach moc,$(basename $(VBoxDbg_QT_MOCSRCS)), $(PATH_VBoxDbg)/moc/$(moc).moc) \
$(foreach ui,$(basename $(VBoxDbg_QT_UISRCS)), $(PATH_VBoxDbg)/$(ui).h)
VBoxDbg_SOURCES = \
$(VBoxDbg_GENSRCS) \
VBoxDbg.cpp \
VBoxDbgGui.cpp \
VBoxDbgBase.cpp \
VBoxDbgConsole.cpp \
VBoxDbgStats.cpp
VBoxDbg_LDFLAGS.darwin = -install_name @executable_path/VBoxDbg.dylib
VBoxDbg_LIBS = \
$(LIB_VMM)
# generated files we need to clean manually
VBoxDbg_CLEAN += \
$(VBoxDbg_GENSRCS) \
$(VBoxDbg_GENHDRS)
#
# The VBoxDBG testcase.
#
tstVBoxDbg_TEMPLATE = VBOXQTGUIEXE
tstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp
tstVBoxDbg_LIBS = \
$(LIB_VMM) \
$(LIB_RUNTIME)
ifeq ($(KBUILD_TARGET),win)
tstVBoxDbg_LIBS += \
$(PATH_LIB)/VBoxDbg.lib
else
tstVBoxDbg_LIBS += \
$(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL)
endif
#
# Install the dbghelp.dll binary.
#
dbghelp_INST = bin/
dbghelp_SOURCES.x86 = win32/dbghelp.dll
dbghelp_SOURCES.amd64 = win64/dbghelp.dll
include $(KBUILD_PATH)/footer.kmk
#
# Source file generation rules
#
## Generate a rule to create a MOC source file from a header containing
# classes that use the Q_OBJECT macro.
# @param $mochdr the header file with Q_OBJECT
define def_qt_gen_src_moc
$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
$$(mocsrc): $(mochdr)
$(call MSG_TOOL,moc,$(target),$(mocsrc),$(mochdr))
$(QUIET)$(MKDIR) -p $(basename $(mocsrc))
$(QUIET)$(VBOX_MOC) $(mochdr) -o $(mocsrc)
endef
## Generate a rule to create a MOC include file from a source containing
# local classes that use the Q_OBJECT macro. This include is then included
# by that source, so it must be generated before the source gets compiled.
# @param $mocsrc the source file with Q_OBJECT
define def_qt_gen_inc_moc
$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
$$(mocobj): $(mocinc)
$$(mocinc): $(mocsrc)
$(call MSG_TOOL,moc,$(target),$(mocsrc),$(mocinc))
$(QUIET)$(MKDIR) -p $(basename $(mocinc))
$(QUIET)$(VBOX_MOC) -i $(mocsrc) -o $(mocinc)
endef
## Generate a rule to create a MOC include file from a UI header (ui.h) containing
# local classes that use the Q_OBJECT macro. This include is then included
# by that header, so it must be generated before the UI source gets compiled.
# @param $mocuihdr the UI header file with Q_OBJECT
define def_qt_gen_inc_mocuihdr
$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
$(eval uiobj := $(PATH_$(target)_$(uisrc))/$(notdir $(basename $(uisrc)))$(VBOX_SUFF_OBJ))
$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
$$(uisrc): $(mocuiinc)
$$(mocuiinc): $(mocuihdr)
$(call MSG_TOOL,moc,$(target),$(mocuihdr),$(mocuiinc))
$(QUIET)$(MKDIR) -p $(basename $(mocuiinc))
$(QUIET)$(VBOX_MOC) -i $(mocuihdr) -o $(mocuiinc)
endef
define def_qt_gen_src_ui
$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
$$(uihdr): $(uifile) | $(call DIRDEP,$(dir $(uihdr)))
$(call MSG_TOOL,uic,$(target),$(uifile),$(uihdr))
$(QUIET)$(VBOX_UIC) $(uifile) -o $(uihdr)
$$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $(call DIRDEP,$(dir $(uisrc)))
$(call MSG_TOOL,uic,$(target),$(uihdr),$(uisrc))
$(QUIET)$(VBOX_UIC) $(uifile) -i $(uihdr) -o $(uisrc)
$$(mocsrc): $(uihdr) | $(call DIRDEP,$(dir $(mocsrc)))
$(call MSG_TOOL,uic,$(target),$(uihdr),$(mocsrc))
$(QUIET)$(VBOX_MOC) $(uihdr) -o $(mocsrc)
endef
## Generate rules for generating the Qt source for a target.
# @param $target Target name.
define def_qt_gen_src
# moc srcs from hdrs with Q_OBJECT
$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
# moc includes from srcs with Q_OBJECT
$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
# moc includes from UI headers with Q_OBJECT
$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
# ui
$(foreach uifile,$($(target)_QT_UISRCS) ,$(eval $(def_qt_gen_src_ui)))
# dirs
$(call DIRDEP,$(PATH_$(target))/ui/) $(call DIRDEP,$(PATH_$(target))/moc/):
$(call MSG_MKDIR,$$@)
$(QUIET)$(MKDIR) -p $$@
endef
# Generate Qt sources.
$(foreach target,VBoxDbg,$(eval $(def_qt_gen_src)))
$(call DIRDEP,$(PATH_VBoxDbg)/include/):
$(call MSG_MKDIR,$@)
$(QUIET)$(MKDIR) -p $@
#
# Translation stuff
#
VBoxDbg_TRANSLATIONS = \
nls/VBoxDbg_de.ts
updatenls:
$(VBOX_LUPDATE) $(VBoxDbg_SOURCES) $(VBoxDbg_QT_MOCHDRS) $(VBoxDbg_GENHDRS) -ts $(VBoxDbg_TRANSLATIONS)
#
# Hand made dependencies go here
#
$(PATH_VBoxDbg)/gen/ui/VBoxNewVMWzd$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxNewVMWzd.h $(PATH_VBoxDbg)/ui/VBoxDiskImageMgrDlg.h
$(PATH_VBoxDbg)/gen/ui/VBoxDiskImageMgrDlg$(VBOX_SUFF_OBJ): ui/VBoxDiskImageMgrDlg.ui $(PATH_VBoxDbg)/ui/VBoxNewHDWzd.h
$(PATH_VBoxDbg)/gen/ui/VBoxCloseVMDlg$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxCloseVMDlg.h
test:
echo $(VBoxDbg_GENSRCS) | sed -e "s/ /\n/g"
testwrappers: $(WRAPPERSFILE)