VirtualBox

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

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

Trying to fix the double linking of the DBGC code (VBoxDBG and VBoxVMM), by making sure it gets into VBoxVMM when it is supposed to.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.5 KB
Line 
1# $Id: Makefile.kmk 5680 2007-11-11 09:40:50Z 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#
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 = VBOXR3EXE
62tstDBGCParser_SOURCES = \
63 testcase/tstDBGCParser.cpp
64tstDBGCParser_LIBS = \
65 $(TARGET_Debugger) \
66 $(LIB_RUNTIME)
67
68
69#
70# Debugger GUI component.
71#
72VBoxDbg_TEMPLATE = VBOXQTGUI
73VBoxDbg_DEFS = IN_DBG_R3
74VBoxDbg_CXXFLAGS.linux = $(TEMPLATE_VBOXQTGUI_CXXFLAGS.linux) -O2
75VBoxDbg_CXXFLAGS.win = -wd4244
76VBoxDbg_INCS = \
77 . \
78 $(PATH_VBoxDbg)/ui \
79 $(PATH_VBoxDbg)/moc \
80 $(PATH_VBoxDbg)/include
81
82# QDesigner UI sources
83VBoxDbg_QT_UISRCS =
84
85# Headers containing definitions of classes that use the Q_OBJECT macro
86VBoxDbg_QT_MOCHDRS = \
87 VBoxDbgConsole.h \
88 VBoxDbgStats.h \
89 VBoxDbgGui.h
90
91# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
92VBoxDbg_QT_MOCUIHDRS =
93
94VBoxDbg_GENSRCS = \
95 $(foreach moc,$(notdir $(basename $(VBoxDbg_QT_MOCHDRS))), $(PATH_VBoxDbg)/moc/moc_$(moc).cpp) \
96 $(foreach ui,$(notdir $(basename $(VBoxDbg_QT_UISRCS))), $(PATH_VBoxDbg)/ui/$(ui).cpp $(PATH_VBoxDbg)/moc/moc_$(ui).cpp)
97
98VBoxDbg_GENHDRS = \
99 $(foreach mocui,$(basename $(VBoxDbg_QT_MOCUIHDRS)), $(PATH_VBoxDbg)/moc/$(mocui).moc) \
100 $(foreach moc,$(basename $(VBoxDbg_QT_MOCSRCS)), $(PATH_VBoxDbg)/moc/$(moc).moc) \
101 $(foreach ui,$(basename $(VBoxDbg_QT_UISRCS)), $(PATH_VBoxDbg)/$(ui).h)
102
103VBoxDbg_SOURCES = \
104 $(VBoxDbg_GENSRCS) \
105 VBoxDbg.cpp \
106 VBoxDbgGui.cpp \
107 VBoxDbgBase.cpp \
108 VBoxDbgConsole.cpp \
109 VBoxDbgStats.cpp
110
111VBoxDbg_LIBS = \
112 $(LIB_VMM)
113
114# generated files we need to clean manually
115VBoxDbg_CLEAN += \
116 $(VBoxDbg_GENSRCS) \
117 $(VBoxDbg_GENHDRS)
118
119
120#
121# The VBoxDBG testcase.
122#
123tstVBoxDbg_TEMPLATE = VBOXQTGUIEXE
124tstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp
125tstVBoxDbg_LIBS = \
126 $(LIB_VMM) \
127 $(LIB_RUNTIME)
128ifeq ($(BUILD_TARGET),win)
129tstVBoxDbg_LIBS += \
130 $(PATH_LIB)/VBoxDbg.lib
131else
132tstVBoxDbg_LIBS += \
133 $(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL)
134endif
135
136
137#
138# Install the dbghelp.dll binary.
139#
140dbghelp_INST = bin/
141dbghelp_SOURCES.x86 = win32/dbghelp.dll
142dbghelp_SOURCES.amd64 = win64/dbghelp.dll
143
144
145include $(PATH_KBUILD)/footer.kmk
146
147
148#
149# Source file generation rules
150#
151
152## Generate a rule to create a MOC source file from a header containing
153# classes that use the Q_OBJECT macro.
154# @param $mochdr the header file with Q_OBJECT
155define def_qt_gen_src_moc
156$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
157$$(mocsrc): $(mochdr)
158 $(call MSG_TOOL,moc,$(target),$(mocsrc),$(mochdr))
159 $(QUIET)$(MKDIR) -p $(basename $(mocsrc))
160 $(QUIET)$(VBOX_MOC) $(mochdr) -o $(mocsrc)
161
162endef
163
164## Generate a rule to create a MOC include file from a source containing
165# local classes that use the Q_OBJECT macro. This include is then included
166# by that source, so it must be generated before the source gets compiled.
167# @param $mocsrc the source file with Q_OBJECT
168define def_qt_gen_inc_moc
169$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
170$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
171$$(mocobj): $(mocinc)
172$$(mocinc): $(mocsrc)
173 $(call MSG_TOOL,moc,$(target),$(mocsrc),$(mocinc))
174 $(QUIET)$(MKDIR) -p $(basename $(mocinc))
175 $(QUIET)$(VBOX_MOC) -i $(mocsrc) -o $(mocinc)
176
177endef
178
179## Generate a rule to create a MOC include file from a UI header (ui.h) containing
180# local classes that use the Q_OBJECT macro. This include is then included
181# by that header, so it must be generated before the UI source gets compiled.
182# @param $mocuihdr the UI header file with Q_OBJECT
183define def_qt_gen_inc_mocuihdr
184$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
185$(eval uiobj := $(PATH_$(target)_$(uisrc))/$(notdir $(basename $(uisrc)))$(VBOX_SUFF_OBJ))
186$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
187$$(uisrc): $(mocuiinc)
188$$(mocuiinc): $(mocuihdr)
189 $(call MSG_TOOL,moc,$(target),$(mocuihdr),$(mocuiinc))
190 $(QUIET)$(MKDIR) -p $(basename $(mocuiinc))
191 $(QUIET)$(VBOX_MOC) -i $(mocuihdr) -o $(mocuiinc)
192
193endef
194
195define def_qt_gen_src_ui
196$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
197$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
198$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
199
200$$(uihdr): $(uifile) | $(call DIRDEP,$(dir $(uihdr)))
201 $(call MSG_TOOL,uic,$(target),$(uifile),$(uihdr))
202 $(QUIET)$(VBOX_UIC) $(uifile) -o $(uihdr)
203
204$$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $(call DIRDEP,$(dir $(uisrc)))
205 $(call MSG_TOOL,uic,$(target),$(uihdr),$(uisrc))
206 $(QUIET)$(VBOX_UIC) $(uifile) -i $(uihdr) -o $(uisrc)
207
208$$(mocsrc): $(uihdr) | $(call DIRDEP,$(dir $(mocsrc)))
209 $(call MSG_TOOL,uic,$(target),$(uihdr),$(mocsrc))
210 $(QUIET)$(VBOX_MOC) $(uihdr) -o $(mocsrc)
211
212endef
213
214## Generate rules for generating the Qt source for a target.
215# @param $target Target name.
216define def_qt_gen_src
217# moc srcs from hdrs with Q_OBJECT
218$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
219# moc includes from srcs with Q_OBJECT
220$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
221# moc includes from UI headers with Q_OBJECT
222$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
223# ui
224$(foreach uifile,$($(target)_QT_UISRCS) ,$(eval $(def_qt_gen_src_ui)))
225# dirs
226$(call DIRDEP,$(PATH_$(target))/ui/) $(call DIRDEP,$(PATH_$(target))/moc/):
227 $(call MSG_MKDIR,$$@)
228 $(QUIET)$(MKDIR) -p $$@
229
230endef
231
232# Generate Qt sources.
233$(foreach target,VBoxDbg,$(eval $(def_qt_gen_src)))
234
235
236$(call DIRDEP,$(PATH_VBoxDbg)/include/):
237 $(call MSG_MKDIR,$@)
238 $(QUIET)$(MKDIR) -p $@
239
240
241#
242# Translation stuff
243#
244
245VBoxDbg_TRANSLATIONS = \
246 nls/VBoxDbg_de.ts
247
248updatenls:
249 $(VBOX_LUPDATE) $(VBoxDbg_SOURCES) $(VBoxDbg_QT_MOCHDRS) $(VBoxDbg_GENHDRS) -ts $(VBoxDbg_TRANSLATIONS)
250
251
252#
253# Hand made dependencies go here
254#
255$(PATH_VBoxDbg)/gen/ui/VBoxNewVMWzd$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxNewVMWzd.h $(PATH_VBoxDbg)/ui/VBoxDiskImageMgrDlg.h
256$(PATH_VBoxDbg)/gen/ui/VBoxDiskImageMgrDlg$(VBOX_SUFF_OBJ): ui/VBoxDiskImageMgrDlg.ui $(PATH_VBoxDbg)/ui/VBoxNewHDWzd.h
257$(PATH_VBoxDbg)/gen/ui/VBoxCloseVMDlg$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxCloseVMDlg.h
258
259
260test:
261 echo $(VBoxDbg_GENSRCS) | sed -e "s/ /\n/g"
262
263testwrappers: $(WRAPPERSFILE)
264
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