VirtualBox

source: vbox/trunk/src/VBox/Debugger/Makefile.kmk@ 5677

Last change on this file since 5677 was 5677, checked in by vboxsync, 17 years ago

Split out command worker routines and stuffed the variable manipulation routines in with them.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.2 KB
Line 
1# $Id: Makefile.kmk 5677 2007-11-11 05:54:53Z vboxsync $
2## @file
3# Makefile for the VBox debugger.
4#
5
6#
7# Copyright (C) 2006-2007 innotek GmbH
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License as published by the Free Software Foundation,
13# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14# distribution. VirtualBox OSE is distributed in the hope that it will
15# be useful, but WITHOUT ANY WARRANTY of any kind.
16
17DEPTH = ../../..
18include $(PATH_KBUILD)/header.kmk
19
20LIBRARIES = Debugger
21ifdef VBOX_WITH_DEBUGGER_GUI
22DLLS = VBoxDbg
23PROGRAMS = tstVBoxDbg
24endif
25
26ifndef VBOX_OSE
27INSTALLS.win.x86 = dbghelp
28endif
29
30
31#
32# Debugger library
33#
34Debugger_TEMPLATE = VBOXR3
35Debugger_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
36Debugger_SOURCES = \
37 DBGConsole.cpp \
38 DBGCBuiltInSymbols.cpp \
39 DBGCCmdHlp.cpp \
40 DBGCCmdWorkers.cpp \
41 DBGCCommands.cpp \
42 DBGCEmulateCodeView.cpp \
43 DBGCOps.cpp \
44 DBGCTcp.cpp
45
46#
47# The testcase.
48#
49tstVBoxDbg_TEMPLATE = VBOXQTGUIEXE
50tstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp
51tstVBoxDbg_LIBS = \
52 $(LIB_VMM) \
53 $(LIB_RUNTIME)
54ifeq ($(BUILD_TARGET),win)
55tstVBoxDbg_LIBS += \
56 $(PATH_LIB)/VBoxDbg.lib
57else
58tstVBoxDbg_LIBS += \
59 $(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL)
60endif
61
62
63#
64# Debugger GUI component.
65#
66VBoxDbg_TEMPLATE = VBOXQTGUI
67VBoxDbg_DEFS = IN_DBG_R3
68VBoxDbg_CXXFLAGS.linux = $(TEMPLATE_VBOXQTGUI_CXXFLAGS.linux) -O2
69VBoxDbg_CXXFLAGS.win = -wd4244
70VBoxDbg_INCS = \
71 . \
72 $(PATH_VBoxDbg)/ui \
73 $(PATH_VBoxDbg)/moc \
74 $(PATH_VBoxDbg)/include
75
76# QDesigner UI sources
77VBoxDbg_QT_UISRCS =
78
79# Headers containing definitions of classes that use the Q_OBJECT macro
80VBoxDbg_QT_MOCHDRS = \
81 VBoxDbgConsole.h \
82 VBoxDbgStats.h \
83 VBoxDbgGui.h
84
85# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
86VBoxDbg_QT_MOCUIHDRS =
87
88VBoxDbg_GENSRCS = \
89 $(foreach moc,$(notdir $(basename $(VBoxDbg_QT_MOCHDRS))), $(PATH_VBoxDbg)/moc/moc_$(moc).cpp) \
90 $(foreach ui,$(notdir $(basename $(VBoxDbg_QT_UISRCS))), $(PATH_VBoxDbg)/ui/$(ui).cpp $(PATH_VBoxDbg)/moc/moc_$(ui).cpp)
91
92VBoxDbg_GENHDRS = \
93 $(foreach mocui,$(basename $(VBoxDbg_QT_MOCUIHDRS)), $(PATH_VBoxDbg)/moc/$(mocui).moc) \
94 $(foreach moc,$(basename $(VBoxDbg_QT_MOCSRCS)), $(PATH_VBoxDbg)/moc/$(moc).moc) \
95 $(foreach ui,$(basename $(VBoxDbg_QT_UISRCS)), $(PATH_VBoxDbg)/$(ui).h)
96
97VBoxDbg_SOURCES = \
98 $(VBoxDbg_GENSRCS) \
99 VBoxDbg.cpp \
100 VBoxDbgGui.cpp \
101 VBoxDbgBase.cpp \
102 VBoxDbgConsole.cpp \
103 VBoxDbgStats.cpp \
104 DBGConsole.cpp \
105 DBGCBuiltInSymbols.cpp \
106 DBGCCmdHlp.cpp \
107 DBGCCmdWorkers.cpp \
108 DBGCCommands.cpp \
109 DBGCEmulateCodeView.cpp \
110 DBGCOps.cpp
111
112VBoxDbg_LIBS = $(LIB_VMM)
113
114# generated files we need to clean manually
115VBoxDbg_CLEAN += \
116 $(VBoxDbg_GENSRCS) \
117 $(VBoxDbg_GENHDRS)
118
119
120#
121# Install the dbghelp.dll binary.
122#
123dbghelp_INST = bin/
124dbghelp_SOURCES.x86 = win32/dbghelp.dll
125dbghelp_SOURCES.amd64 = win64/dbghelp.dll
126
127
128include $(PATH_KBUILD)/footer.kmk
129
130
131#
132# Source file generation rules
133#
134
135## Generate a rule to create a MOC source file from a header containing
136# classes that use the Q_OBJECT macro.
137# @param $mochdr the header file with Q_OBJECT
138define def_qt_gen_src_moc
139$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
140$$(mocsrc): $(mochdr)
141 $(call MSG_TOOL,moc,$(target),$(mocsrc),$(mochdr))
142 $(QUIET)$(MKDIR) -p $(basename $(mocsrc))
143 $(QUIET)$(VBOX_MOC) $(mochdr) -o $(mocsrc)
144
145endef
146
147## Generate a rule to create a MOC include file from a source containing
148# local classes that use the Q_OBJECT macro. This include is then included
149# by that source, so it must be generated before the source gets compiled.
150# @param $mocsrc the source file with Q_OBJECT
151define def_qt_gen_inc_moc
152$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
153$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
154$$(mocobj): $(mocinc)
155$$(mocinc): $(mocsrc)
156 $(call MSG_TOOL,moc,$(target),$(mocsrc),$(mocinc))
157 $(QUIET)$(MKDIR) -p $(basename $(mocinc))
158 $(QUIET)$(VBOX_MOC) -i $(mocsrc) -o $(mocinc)
159
160endef
161
162## Generate a rule to create a MOC include file from a UI header (ui.h) containing
163# local classes that use the Q_OBJECT macro. This include is then included
164# by that header, so it must be generated before the UI source gets compiled.
165# @param $mocuihdr the UI header file with Q_OBJECT
166define def_qt_gen_inc_mocuihdr
167$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
168$(eval uiobj := $(PATH_$(target)_$(uisrc))/$(notdir $(basename $(uisrc)))$(VBOX_SUFF_OBJ))
169$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
170$$(uisrc): $(mocuiinc)
171$$(mocuiinc): $(mocuihdr)
172 $(call MSG_TOOL,moc,$(target),$(mocuihdr),$(mocuiinc))
173 $(QUIET)$(MKDIR) -p $(basename $(mocuiinc))
174 $(QUIET)$(VBOX_MOC) -i $(mocuihdr) -o $(mocuiinc)
175
176endef
177
178define def_qt_gen_src_ui
179$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
180$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
181$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
182
183$$(uihdr): $(uifile) | $(call DIRDEP,$(dir $(uihdr)))
184 $(call MSG_TOOL,uic,$(target),$(uifile),$(uihdr))
185 $(QUIET)$(VBOX_UIC) $(uifile) -o $(uihdr)
186
187$$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $(call DIRDEP,$(dir $(uisrc)))
188 $(call MSG_TOOL,uic,$(target),$(uihdr),$(uisrc))
189 $(QUIET)$(VBOX_UIC) $(uifile) -i $(uihdr) -o $(uisrc)
190
191$$(mocsrc): $(uihdr) | $(call DIRDEP,$(dir $(mocsrc)))
192 $(call MSG_TOOL,uic,$(target),$(uihdr),$(mocsrc))
193 $(QUIET)$(VBOX_MOC) $(uihdr) -o $(mocsrc)
194
195endef
196
197## Generate rules for generating the Qt source for a target.
198# @param $target Target name.
199define def_qt_gen_src
200# moc srcs from hdrs with Q_OBJECT
201$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
202# moc includes from srcs with Q_OBJECT
203$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
204# moc includes from UI headers with Q_OBJECT
205$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
206# ui
207$(foreach uifile,$($(target)_QT_UISRCS) ,$(eval $(def_qt_gen_src_ui)))
208# dirs
209$(call DIRDEP,$(PATH_$(target))/ui/) $(call DIRDEP,$(PATH_$(target))/moc/):
210 $(call MSG_MKDIR,$$@)
211 $(QUIET)$(MKDIR) -p $$@
212
213endef
214
215# Generate Qt sources.
216$(foreach target,VBoxDbg,$(eval $(def_qt_gen_src)))
217
218
219$(call DIRDEP,$(PATH_VBoxDbg)/include/):
220 $(call MSG_MKDIR,$@)
221 $(QUIET)$(MKDIR) -p $@
222
223
224#
225# Translation stuff
226#
227
228VBoxDbg_TRANSLATIONS = \
229 nls/VBoxDbg_de.ts
230
231updatenls:
232 $(VBOX_LUPDATE) $(VBoxDbg_SOURCES) $(VBoxDbg_QT_MOCHDRS) $(VBoxDbg_GENHDRS) -ts $(VBoxDbg_TRANSLATIONS)
233
234
235#
236# Hand made dependencies go here
237#
238$(PATH_VBoxDbg)/gen/ui/VBoxNewVMWzd$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxNewVMWzd.h $(PATH_VBoxDbg)/ui/VBoxDiskImageMgrDlg.h
239$(PATH_VBoxDbg)/gen/ui/VBoxDiskImageMgrDlg$(VBOX_SUFF_OBJ): ui/VBoxDiskImageMgrDlg.ui $(PATH_VBoxDbg)/ui/VBoxNewHDWzd.h
240$(PATH_VBoxDbg)/gen/ui/VBoxCloseVMDlg$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxCloseVMDlg.h
241
242
243test:
244 echo $(VBoxDbg_GENSRCS) | sed -e "s/ /\n/g"
245
246testwrappers: $(WRAPPERSFILE)
247
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette