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 |
|
---|
22 | ifdef VBOX_KBUILD_HACKING
|
---|
23 | SUB_DEPTH = ../../..
|
---|
24 | else
|
---|
25 | SUB_DEPTH = .
|
---|
26 | DEPTH = ../../..
|
---|
27 | endif
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 | #
|
---|
31 | # The targets.
|
---|
32 | #
|
---|
33 | ifdef 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
|
---|
44 | endif # VBOX_WITH_DEBUGGER
|
---|
45 | ifndef VBOX_OSE
|
---|
46 | INSTALLS.win.x86 += dbghelp
|
---|
47 | endif
|
---|
48 |
|
---|
49 |
|
---|
50 | #
|
---|
51 | # Debugger library - linked into VBoxVMM.
|
---|
52 | #
|
---|
53 | Debugger_TEMPLATE = VBOXR3
|
---|
54 | Debugger_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
|
---|
55 | Debugger_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 | #
|
---|
72 | tstDBGCParser_TEMPLATE = VBOXR3TSTEXE
|
---|
73 | tstDBGCParser_DEFS = IN_DBGF_R3 IN_CPUM_R3 IN_MM_R3 IN_PGM_R3 IN_SELM_R3
|
---|
74 | tstDBGCParser_SOURCES = \
|
---|
75 | testcase/tstDBGCParser.cpp \
|
---|
76 | testcase/tstDBGCStubs.cpp
|
---|
77 | tstDBGCParser_LIBS = \
|
---|
78 | $(TARGET_Debugger) \
|
---|
79 | $(LIB_RUNTIME)
|
---|
80 |
|
---|
81 |
|
---|
82 | #
|
---|
83 | # Debugger GUI component.
|
---|
84 | #
|
---|
85 | VBoxDbg_TEMPLATE = VBOXQTGUI
|
---|
86 | VBoxDbg_DEFS = IN_DBG_R3
|
---|
87 | VBoxDbg_CXXFLAGS.linux = $(TEMPLATE_VBOXQTGUI_CXXFLAGS.linux) -O2
|
---|
88 | VBoxDbg_INCS = \
|
---|
89 | . \
|
---|
90 | $(PATH_VBoxDbg)/ui \
|
---|
91 | $(PATH_VBoxDbg)/moc \
|
---|
92 | $(PATH_VBoxDbg)/include
|
---|
93 |
|
---|
94 | # QDesigner UI sources
|
---|
95 | VBoxDbg_QT_UISRCS =
|
---|
96 |
|
---|
97 | # Headers containing definitions of classes that use the Q_OBJECT macro
|
---|
98 | VBoxDbg_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
|
---|
104 | VBoxDbg_QT_MOCUIHDRS =
|
---|
105 |
|
---|
106 | VBoxDbg_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 |
|
---|
110 | VBoxDbg_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 |
|
---|
115 | VBoxDbg_SOURCES = \
|
---|
116 | $(VBoxDbg_GENSRCS) \
|
---|
117 | VBoxDbg.cpp \
|
---|
118 | VBoxDbgGui.cpp \
|
---|
119 | VBoxDbgBase.cpp \
|
---|
120 | VBoxDbgConsole.cpp \
|
---|
121 | VBoxDbgStats.cpp
|
---|
122 |
|
---|
123 | VBoxDbg_LDFLAGS.darwin = -install_name @executable_path/VBoxDbg.dylib
|
---|
124 |
|
---|
125 | VBoxDbg_LIBS = \
|
---|
126 | $(LIB_VMM)
|
---|
127 |
|
---|
128 | # generated files we need to clean manually
|
---|
129 | VBoxDbg_CLEAN += \
|
---|
130 | $(VBoxDbg_GENSRCS) \
|
---|
131 | $(VBoxDbg_GENHDRS)
|
---|
132 |
|
---|
133 |
|
---|
134 | #
|
---|
135 | # The VBoxDBG testcase.
|
---|
136 | #
|
---|
137 | tstVBoxDbg_TEMPLATE = VBOXQTGUIEXE
|
---|
138 | tstVBoxDbg_SOURCES = testcase/tstVBoxDbg.cpp
|
---|
139 | tstVBoxDbg_LIBS = \
|
---|
140 | $(LIB_VMM) \
|
---|
141 | $(LIB_RUNTIME)
|
---|
142 | ifeq ($(KBUILD_TARGET),win)
|
---|
143 | tstVBoxDbg_LIBS += \
|
---|
144 | $(PATH_LIB)/VBoxDbg.lib
|
---|
145 | else
|
---|
146 | tstVBoxDbg_LIBS += \
|
---|
147 | $(PATH_BIN)/VBoxDbg$(VBOX_SUFF_DLL)
|
---|
148 | endif
|
---|
149 |
|
---|
150 |
|
---|
151 | #
|
---|
152 | # Install the dbghelp.dll binary.
|
---|
153 | #
|
---|
154 | dbghelp_INST = bin/
|
---|
155 | dbghelp_SOURCES.x86 = win32/dbghelp.dll
|
---|
156 | dbghelp_SOURCES.amd64 = win64/dbghelp.dll
|
---|
157 |
|
---|
158 |
|
---|
159 | include $(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
|
---|
169 | define 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 |
|
---|
176 | endef
|
---|
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
|
---|
182 | define 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 |
|
---|
191 | endef
|
---|
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
|
---|
197 | define 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 |
|
---|
207 | endef
|
---|
208 |
|
---|
209 | define 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 |
|
---|
226 | endef
|
---|
227 |
|
---|
228 | ## Generate rules for generating the Qt source for a target.
|
---|
229 | # @param $target Target name.
|
---|
230 | define 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 |
|
---|
244 | endef
|
---|
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 |
|
---|
259 | VBoxDbg_TRANSLATIONS = \
|
---|
260 | nls/VBoxDbg_de.ts
|
---|
261 |
|
---|
262 | updatenls:
|
---|
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 |
|
---|
274 | test:
|
---|
275 | echo $(VBoxDbg_GENSRCS) | sed -e "s/ /\n/g"
|
---|
276 |
|
---|
277 | testwrappers: $(WRAPPERSFILE)
|
---|
278 |
|
---|