VirtualBox

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

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

The Giant CDDL Dual-License Header Change.

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