Makefile.kmk revision efac9f717fd7349cf92633656338f9eb43b39c0f
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# $Id$
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync## @file
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# Makefile for the VBox debugger.
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
62263e030f89e8323226e9f7243cbba769597e14vboxsync# Copyright (C) 2006-2007 innotek GmbH
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# available from http://www.virtualbox.org. This file is free software;
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# General Public License as published by the Free Software Foundation,
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncDEPTH = ../../..
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncinclude $(PATH_KBUILD)/header.kmk
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncLIBRARIES = Debugger
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncifdef VBOX_WITH_DEBUGGER_GUI
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncDLLS = VBoxDbg
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncPROGRAMS = tstVBoxDbg
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncendif
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncifndef VBOX_OSE
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncINSTALLS.win.x86 = dbghelp
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncendif
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# Debugger library
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncDebugger_TEMPLATE = VBOXR3
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncDebugger_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
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncDebugger_SOURCES = \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync DBGConsole.cpp \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync DBGCOps.cpp \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync DBGCEmulateCodeView.cpp \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync DBGCTcp.cpp
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# The testcase.
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsynctstVBoxDbg_TEMPLATE = VBOXQTGUIEXE
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsynctstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsynctstVBoxDbg_LIBS = \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync $(LIB_VMM) \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync $(LIB_RUNTIME)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncifeq ($(BUILD_TARGET),win)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsynctstVBoxDbg_LIBS += \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync $(PATH_LIB)/VBoxDbg.lib
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncelse
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsynctstVBoxDbg_LIBS += \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync $(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL)
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncendif
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# Debugger GUI component.
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync#
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncVBoxDbg_TEMPLATE = VBOXQTGUI
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncVBoxDbg_DEFS = IN_DBG_R3
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncVBoxDbg_CXXFLAGS.linux = $(TEMPLATE_VBOXQTGUI_CXXFLAGS.linux) -O2
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncVBoxDbg_CXXFLAGS.win = -wd4244
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncVBoxDbg_INCS = \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync . \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync $(PATH_VBoxDbg)/ui \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync $(PATH_VBoxDbg)/moc \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync $(PATH_VBoxDbg)/include
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# QDesigner UI sources
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncVBoxDbg_QT_UISRCS =
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync# Headers containing definitions of classes that use the Q_OBJECT macro
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsyncVBoxDbg_QT_MOCHDRS = \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync VBoxDbgConsole.h \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync VBoxDbgStats.h \
07ca5489e6fa49b415eb5e0e42567833699a9e57vboxsync 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 \
DBGConsole.cpp \
DBGCOps.cpp \
DBGCEmulateCodeView.cpp
VBoxDbg_LIBS = $(LIB_VMM)
# generated files we need to clean manually
VBoxDbg_CLEAN += \
$(VBoxDbg_GENSRCS) \
$(VBoxDbg_GENHDRS)
#
# Install the dbghelp.dll binary.
#
dbghelp_INST = bin/
dbghelp_SOURCES.x86 = win32/dbghelp.dll
dbghelp_SOURCES.amd64 = win64/dbghelp.dll
include $(PATH_KBUILD)/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)