VirtualBox

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

Last change on this file since 11497 was 10052, checked in by vboxsync, 16 years ago

VBOX_KBUILD_HACKING

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