VirtualBox

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

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

build fix (darwin).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.6 KB
Line 
1# $Id: Makefile.kmk 8153 2008-04-18 14:29: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 (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_LDFLAGS.darwin = -install_name @executable_path/VBoxDbg.dylib
113
114VBoxDbg_LIBS = \
115 $(LIB_VMM)
116
117# generated files we need to clean manually
118VBoxDbg_CLEAN += \
119 $(VBoxDbg_GENSRCS) \
120 $(VBoxDbg_GENHDRS)
121
122
123#
124# The VBoxDBG testcase.
125#
126tstVBoxDbg_TEMPLATE = VBOXQTGUIEXE
127tstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp
128tstVBoxDbg_LIBS = \
129 $(LIB_VMM) \
130 $(LIB_RUNTIME)
131ifeq ($(BUILD_TARGET),win)
132tstVBoxDbg_LIBS += \
133 $(PATH_LIB)/VBoxDbg.lib
134else
135tstVBoxDbg_LIBS += \
136 $(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL)
137endif
138
139
140#
141# Install the dbghelp.dll binary.
142#
143dbghelp_INST = bin/
144dbghelp_SOURCES.x86 = win32/dbghelp.dll
145dbghelp_SOURCES.amd64 = win64/dbghelp.dll
146
147
148include $(PATH_KBUILD)/footer.kmk
149
150
151#
152# Source file generation rules
153#
154
155## Generate a rule to create a MOC source file from a header containing
156# classes that use the Q_OBJECT macro.
157# @param $mochdr the header file with Q_OBJECT
158define def_qt_gen_src_moc
159$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
160$$(mocsrc): $(mochdr)
161 $(call MSG_TOOL,moc,$(target),$(mocsrc),$(mochdr))
162 $(QUIET)$(MKDIR) -p $(basename $(mocsrc))
163 $(QUIET)$(VBOX_MOC) $(mochdr) -o $(mocsrc)
164
165endef
166
167## Generate a rule to create a MOC include file from a source containing
168# local classes that use the Q_OBJECT macro. This include is then included
169# by that source, so it must be generated before the source gets compiled.
170# @param $mocsrc the source file with Q_OBJECT
171define def_qt_gen_inc_moc
172$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
173$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
174$$(mocobj): $(mocinc)
175$$(mocinc): $(mocsrc)
176 $(call MSG_TOOL,moc,$(target),$(mocsrc),$(mocinc))
177 $(QUIET)$(MKDIR) -p $(basename $(mocinc))
178 $(QUIET)$(VBOX_MOC) -i $(mocsrc) -o $(mocinc)
179
180endef
181
182## Generate a rule to create a MOC include file from a UI header (ui.h) containing
183# local classes that use the Q_OBJECT macro. This include is then included
184# by that header, so it must be generated before the UI source gets compiled.
185# @param $mocuihdr the UI header file with Q_OBJECT
186define def_qt_gen_inc_mocuihdr
187$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
188$(eval uiobj := $(PATH_$(target)_$(uisrc))/$(notdir $(basename $(uisrc)))$(VBOX_SUFF_OBJ))
189$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
190$$(uisrc): $(mocuiinc)
191$$(mocuiinc): $(mocuihdr)
192 $(call MSG_TOOL,moc,$(target),$(mocuihdr),$(mocuiinc))
193 $(QUIET)$(MKDIR) -p $(basename $(mocuiinc))
194 $(QUIET)$(VBOX_MOC) -i $(mocuihdr) -o $(mocuiinc)
195
196endef
197
198define def_qt_gen_src_ui
199$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
200$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
201$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
202
203$$(uihdr): $(uifile) | $(call DIRDEP,$(dir $(uihdr)))
204 $(call MSG_TOOL,uic,$(target),$(uifile),$(uihdr))
205 $(QUIET)$(VBOX_UIC) $(uifile) -o $(uihdr)
206
207$$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $(call DIRDEP,$(dir $(uisrc)))
208 $(call MSG_TOOL,uic,$(target),$(uihdr),$(uisrc))
209 $(QUIET)$(VBOX_UIC) $(uifile) -i $(uihdr) -o $(uisrc)
210
211$$(mocsrc): $(uihdr) | $(call DIRDEP,$(dir $(mocsrc)))
212 $(call MSG_TOOL,uic,$(target),$(uihdr),$(mocsrc))
213 $(QUIET)$(VBOX_MOC) $(uihdr) -o $(mocsrc)
214
215endef
216
217## Generate rules for generating the Qt source for a target.
218# @param $target Target name.
219define def_qt_gen_src
220# moc srcs from hdrs with Q_OBJECT
221$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
222# moc includes from srcs with Q_OBJECT
223$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
224# moc includes from UI headers with Q_OBJECT
225$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
226# ui
227$(foreach uifile,$($(target)_QT_UISRCS) ,$(eval $(def_qt_gen_src_ui)))
228# dirs
229$(call DIRDEP,$(PATH_$(target))/ui/) $(call DIRDEP,$(PATH_$(target))/moc/):
230 $(call MSG_MKDIR,$$@)
231 $(QUIET)$(MKDIR) -p $$@
232
233endef
234
235# Generate Qt sources.
236$(foreach target,VBoxDbg,$(eval $(def_qt_gen_src)))
237
238
239$(call DIRDEP,$(PATH_VBoxDbg)/include/):
240 $(call MSG_MKDIR,$@)
241 $(QUIET)$(MKDIR) -p $@
242
243
244#
245# Translation stuff
246#
247
248VBoxDbg_TRANSLATIONS = \
249 nls/VBoxDbg_de.ts
250
251updatenls:
252 $(VBOX_LUPDATE) $(VBoxDbg_SOURCES) $(VBoxDbg_QT_MOCHDRS) $(VBoxDbg_GENHDRS) -ts $(VBoxDbg_TRANSLATIONS)
253
254
255#
256# Hand made dependencies go here
257#
258$(PATH_VBoxDbg)/gen/ui/VBoxNewVMWzd$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxNewVMWzd.h $(PATH_VBoxDbg)/ui/VBoxDiskImageMgrDlg.h
259$(PATH_VBoxDbg)/gen/ui/VBoxDiskImageMgrDlg$(VBOX_SUFF_OBJ): ui/VBoxDiskImageMgrDlg.ui $(PATH_VBoxDbg)/ui/VBoxNewHDWzd.h
260$(PATH_VBoxDbg)/gen/ui/VBoxCloseVMDlg$(VBOX_SUFF_OBJ): $(PATH_VBoxDbg)/ui/VBoxCloseVMDlg.h
261
262
263test:
264 echo $(VBoxDbg_GENSRCS) | sed -e "s/ /\n/g"
265
266testwrappers: $(WRAPPERSFILE)
267
Note: See TracBrowser for help on using the repository browser.

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