1 | # $Id: Makefile.kmk 2529 2007-05-08 08:47:31Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the VirtualBox Qt GUI.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006 InnoTek Systemberatung 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 | # If you received this file as part of a commercial VirtualBox
|
---|
18 | # distribution, then only the terms of your commercial VirtualBox
|
---|
19 | # license agreement apply instead of the previous paragraph.
|
---|
20 | #
|
---|
21 |
|
---|
22 | ifeq ($(BUILD_TARGET),linux)
|
---|
23 | XKEYBOARD_NEW := 1
|
---|
24 | endif
|
---|
25 |
|
---|
26 | # include qmake project file
|
---|
27 | include VBoxUI.pro
|
---|
28 |
|
---|
29 | # Import QDesigner UI sources
|
---|
30 | VirtualBox_QT_UISRCS := $(FORMS)
|
---|
31 | # Import translation sources
|
---|
32 | VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
|
---|
33 | # Import images
|
---|
34 | VirtualBox_QT_IMAGES := $(IMAGES)
|
---|
35 |
|
---|
36 | # reset things to avoid possible conflicts with kBuild
|
---|
37 | TEMPLATE :=
|
---|
38 | LANGUAGE :=
|
---|
39 | FORMS :=
|
---|
40 | TRANSLATIONS :=
|
---|
41 | IMAGES :=
|
---|
42 |
|
---|
43 | DEPTH = ../../../..
|
---|
44 | include $(PATH_KBUILD)/header.kmk
|
---|
45 |
|
---|
46 | PROGRAMS = VirtualBox
|
---|
47 |
|
---|
48 | INSTALLS = VirtualBox.nls
|
---|
49 |
|
---|
50 | VirtualBox_TEMPLATE = VBOXQTGUIEXE
|
---|
51 | VirtualBox_SDKS.win = WINPSDK DXSDK
|
---|
52 | VirtualBox_SDKS.linux = LIBSDL
|
---|
53 |
|
---|
54 | ifeq ($(BUILD_TARGET),darwin)
|
---|
55 | # For the launch trick we need different inode numbers.
|
---|
56 | VirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
|
---|
57 | endif
|
---|
58 |
|
---|
59 | # Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
|
---|
60 | VirtualBox_QT_TRANSLATIONS_QT := \
|
---|
61 | $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\
|
---|
62 | $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
|
---|
63 |
|
---|
64 | # QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
|
---|
65 |
|
---|
66 | # Headers containing definitions of classes that use the Q_OBJECT macro
|
---|
67 | VirtualBox_QT_MOCHDRS = \
|
---|
68 | include/QIWidgetValidator.h \
|
---|
69 | include/QIHotKeyEdit.h \
|
---|
70 | include/QIStatusBar.h \
|
---|
71 | include/QIStateIndicator.h \
|
---|
72 | include/QIMessageBox.h \
|
---|
73 | include/QIRichLabel.h \
|
---|
74 | include/VBoxGlobalSettings.h \
|
---|
75 | include/VBoxUtils.h \
|
---|
76 | include/VBoxGlobal.h \
|
---|
77 | include/VBoxVMListBox.h \
|
---|
78 | include/VBoxMediaComboBox.h \
|
---|
79 | include/VBoxSelectorWnd.h \
|
---|
80 | include/VBoxConsoleWnd.h \
|
---|
81 | include/VBoxConsoleView.h \
|
---|
82 | include/VBoxProblemReporter.h
|
---|
83 |
|
---|
84 | # Sources containing local definitions of classes that use the Q_OBJECT macro
|
---|
85 | VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
|
---|
86 | ifneq ($(BUILD_TARGET),win)
|
---|
87 | VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
|
---|
88 | endif
|
---|
89 |
|
---|
90 | # UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
|
---|
91 | VirtualBox_QT_MOCUIHDRS = \
|
---|
92 | ui/VBoxVMSettingsDlg.ui.h \
|
---|
93 | ui/VBoxSharedFoldersSettings.ui.h
|
---|
94 | ifeq ($(BUILD_TARGET),win)
|
---|
95 | VirtualBox_QT_MOCUIHDRS += ui/VBoxVMNetworkSettings.ui.h
|
---|
96 | endif
|
---|
97 |
|
---|
98 |
|
---|
99 | # All generated sources. Note: this list MUST be in sync with Qt source
|
---|
100 | # generation rules defined somewhere below!
|
---|
101 | VirtualBox_GENSRCS = \
|
---|
102 | $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
|
---|
103 | $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
|
---|
104 | $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
|
---|
105 |
|
---|
106 | # All generated headers. Note: this list MUST be in sync with Qt source
|
---|
107 | # generation rules defined somewhere below!
|
---|
108 | VirtualBox_GENHDRS = \
|
---|
109 | $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
|
---|
110 | $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
|
---|
111 | $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).h)
|
---|
112 |
|
---|
113 | # All existing .ui.h files for known .ui sources
|
---|
114 | VirtualBox_QT_UIHDRS = \
|
---|
115 | $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS)))
|
---|
116 |
|
---|
117 | # All header files
|
---|
118 | VirtualBox_HEADERS = \
|
---|
119 | $(wildcard include/*.h) \
|
---|
120 | $(VirtualBox_GENHDRS) \
|
---|
121 | $(VirtualBox_QT_UIHDRS)
|
---|
122 |
|
---|
123 |
|
---|
124 | VirtualBox_SOURCES = \
|
---|
125 | $(VirtualBox_GENSRCS) \
|
---|
126 | src/main.cpp \
|
---|
127 | src/COMDefs.cpp \
|
---|
128 | src/QIWidgetValidator.cpp \
|
---|
129 | src/QIHotKeyEdit.cpp \
|
---|
130 | src/QIStateIndicator.cpp \
|
---|
131 | src/QIStatusBar.cpp \
|
---|
132 | src/QIMessageBox.cpp \
|
---|
133 | src/QIRichLabel.cpp \
|
---|
134 | src/VBoxGlobalSettings.cpp \
|
---|
135 | src/VBoxGlobal.cpp \
|
---|
136 | src/VBoxMediaComboBox.cpp \
|
---|
137 | src/VBoxProblemReporter.cpp \
|
---|
138 | src/VBoxSelectorWnd.cpp \
|
---|
139 | src/VBoxConsoleView.cpp \
|
---|
140 | src/VBoxConsoleWnd.cpp \
|
---|
141 | src/VBoxVMListBox.cpp \
|
---|
142 | src/VBoxFrameBuffer.cpp
|
---|
143 |
|
---|
144 | VirtualBox_SOURCES.win += \
|
---|
145 | src/win32/VirtualBox.rc
|
---|
146 |
|
---|
147 | VirtualBox_SOURCES.win += \
|
---|
148 | src/VBoxFBDDRAW.cpp
|
---|
149 |
|
---|
150 | VirtualBox_SOURCES.linux = \
|
---|
151 | src/linux/XKeyboard.cpp \
|
---|
152 | src/linux/keyboard.c \
|
---|
153 | src/linux/XKeyboardNew.cpp
|
---|
154 |
|
---|
155 | VirtualBox_SOURCES.darwin = \
|
---|
156 | src/darwin/DarwinKeyboard.cpp \
|
---|
157 | src/darwin/DarwinCursor.cpp \
|
---|
158 | src/darwin/VBoxAquaStyle.cpp \
|
---|
159 | src/darwin/VBoxUtils-darwin.cpp
|
---|
160 |
|
---|
161 | ## @todo how to detect what tool is used?
|
---|
162 | ## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
|
---|
163 | # more generic -Wno-extra
|
---|
164 | ifneq ($(BUILD_TARGET),win)
|
---|
165 | src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
|
---|
166 | endif
|
---|
167 |
|
---|
168 | VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
|
---|
169 | VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
|
---|
170 | VirtualBox_DEFS.darwin = VBOX_GUI_USE_QIMAGE
|
---|
171 | VirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
|
---|
172 | VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
|
---|
173 | #ifndef VBOX_OSE
|
---|
174 | VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
|
---|
175 | #endif
|
---|
176 | ifneq ($(BUILD_TYPE),release)
|
---|
177 | # non-release builds has some extra features.
|
---|
178 | VirtualBox_DEFS += VBOX_GUI_USE_REFRESH_TIMER VBOX_WITH_DEBUGGER_GUI_MENU
|
---|
179 | VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
|
---|
180 | VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
|
---|
181 | endif
|
---|
182 | ifdef VBOX_WITH_ALSA
|
---|
183 | VirtualBox_DEFS += VBOX_WITH_ALSA
|
---|
184 | endif
|
---|
185 | ifdef VBOX_OSE
|
---|
186 | VirtualBox_DEFS += VBOX_OSE
|
---|
187 | endif
|
---|
188 |
|
---|
189 | VirtualBox_INCS = \
|
---|
190 | ./include \
|
---|
191 | $(PATH_VirtualBox)/ui \
|
---|
192 | $(PATH_VirtualBox)/moc \
|
---|
193 | $(PATH_VirtualBox)/include \
|
---|
194 |
|
---|
195 |
|
---|
196 | ifeq ($(BUILD_TYPE),release)
|
---|
197 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
|
---|
198 | else
|
---|
199 | VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
|
---|
200 | ifeq ($(USERNAME),dmik)
|
---|
201 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
|
---|
202 | else
|
---|
203 | VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
|
---|
204 | endif
|
---|
205 | endif
|
---|
206 | VirtualBox_LDFLAGS.darwin = -framework IOKit
|
---|
207 | VirtualBox_LIBS.win = \
|
---|
208 | $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
|
---|
209 | $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
|
---|
210 | $(PATH_SDK_DXSDK_LIB)/dxguid.lib
|
---|
211 |
|
---|
212 | ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
213 | ifeq ($(BUILD_TARGET),win)
|
---|
214 | VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
|
---|
215 | else
|
---|
216 | VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
|
---|
217 | endif
|
---|
218 | endif
|
---|
219 |
|
---|
220 | WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
|
---|
221 | WRAPPERSINCFILE = include/COMDefs.h
|
---|
222 | WRAPPERSTEMPLATE = include/COMWrappers.xsl
|
---|
223 | XIDLFILE = ../../Main/idl/VirtualBox.xidl
|
---|
224 |
|
---|
225 |
|
---|
226 | # generated files we need to clean manually
|
---|
227 | OTHER_CLEAN = \
|
---|
228 | $(VirtualBox_GENSRCS) \
|
---|
229 | $(VirtualBox_GENHDRS) \
|
---|
230 | $(WRAPPERSFILE)
|
---|
231 |
|
---|
232 |
|
---|
233 | #
|
---|
234 | # On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
|
---|
235 | #
|
---|
236 | INSTALLS.darwin += VirtualBox.app
|
---|
237 | VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
|
---|
238 | VirtualBox.app_MODE = 644
|
---|
239 | VirtualBox.app_SOURCES = \
|
---|
240 | src/darwin/PkgInfo \
|
---|
241 | $(PATH_TARGET)/Info.plist \
|
---|
242 | images/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
243 |
|
---|
244 | $(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
|
---|
245 | $(call MSG_GENERATE,VirtualBox.app,$<,$@)
|
---|
246 | $(QUIET)$(RM) -f $@
|
---|
247 | $(QUIET)$(SED) \
|
---|
248 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
249 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
250 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
251 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
252 | $< > $@
|
---|
253 |
|
---|
254 | INSTALLS.darwin += VirtualBoxVM.app
|
---|
255 | VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
|
---|
256 | VirtualBoxVM.app_MODE = 644
|
---|
257 | VirtualBoxVM.app_SOURCES = \
|
---|
258 | src/darwin/VM-PkgInfo=>PkgInfo \
|
---|
259 | $(PATH_TARGET)/VM-Info.plist=>Info.plist \
|
---|
260 | images/VirtualBox.icns=>Resources/virtualbox.icns
|
---|
261 | VirtualBoxVM.app_SYMLINKS = \
|
---|
262 | MacOS=>../../../MacOS/
|
---|
263 |
|
---|
264 | $(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
|
---|
265 | $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
|
---|
266 | $(QUIET)$(RM) -f $@
|
---|
267 | $(QUIET)$(SED) \
|
---|
268 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
269 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
270 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
271 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
272 | $< > $@
|
---|
273 |
|
---|
274 | #
|
---|
275 | # Translation installation
|
---|
276 | #
|
---|
277 |
|
---|
278 | VirtualBox.nls_INST = $(INST_BIN)nls/
|
---|
279 | VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS)))
|
---|
280 | VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT)))
|
---|
281 | VirtualBox.nls_MODE = 644
|
---|
282 |
|
---|
283 |
|
---|
284 | #
|
---|
285 | # Testcase for the darwin keyboard routines.
|
---|
286 | #
|
---|
287 | ifdef VBOX_WITH_TESTCASES
|
---|
288 | PROGRAMS.darwin += tstDarwinKeyboard
|
---|
289 | tstDarwinKeyboard_TEMPLATE = VBOXR3TSTEXE
|
---|
290 | tstDarwinKeyboard_INCS = include
|
---|
291 | tstDarwinKeyboard_SOURCES = \
|
---|
292 | src/darwin/tstDarwinKeyboard.cpp \
|
---|
293 | src/darwin/DarwinKeyboard.cpp
|
---|
294 | tstDarwinKeyboard_LDFLAGS = -framework IOKit -framework Carbon
|
---|
295 | tstDarwinKeyboard_LIBS = \
|
---|
296 | $(LIB_RUNTIME)
|
---|
297 | endif
|
---|
298 |
|
---|
299 |
|
---|
300 |
|
---|
301 | # Commit the magic.
|
---|
302 | # (note: before custom rules that make usage of generated variables!).
|
---|
303 | include $(PATH_KBUILD)/footer.kmk
|
---|
304 |
|
---|
305 |
|
---|
306 |
|
---|
307 | #
|
---|
308 | # Qt source file generation rules
|
---|
309 | #
|
---|
310 |
|
---|
311 | ## @todo move QT source generation macros to kBuild
|
---|
312 |
|
---|
313 | ## Generate a rule to create a MOC source file from a header containing
|
---|
314 | # classes that use the Q_OBJECT macro.
|
---|
315 | # @param $mochdr header file with Q_OBJECT
|
---|
316 | define def_qt_gen_src_moc
|
---|
317 |
|
---|
318 | $(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
|
---|
319 |
|
---|
320 | $(target)_GENSRCS_REAL += $(mocsrc)
|
---|
321 |
|
---|
322 | $(mocsrc): $(mochdr)
|
---|
323 | $$(call MSG_TOOL,moc,$(target),$(mochdr),$$@)
|
---|
324 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
325 | $$(QUIET)$$(VBOX_MOC) $(mochdr) -o $$@
|
---|
326 |
|
---|
327 | endef
|
---|
328 |
|
---|
329 | ## Generate a rule to create a MOC include file from a source containing
|
---|
330 | # local classes that use the Q_OBJECT macro. This include is then included
|
---|
331 | # by that source, so it must be generated before the source gets compiled.
|
---|
332 | # @param $mocsrc source file with Q_OBJECT
|
---|
333 | define def_qt_gen_inc_moc
|
---|
334 |
|
---|
335 | $(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(SUFF_OBJ))
|
---|
336 | $(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
|
---|
337 |
|
---|
338 | $(target)_GENHDRS_REAL += $(mocinc)
|
---|
339 |
|
---|
340 | $(mocobj): $(mocinc)
|
---|
341 |
|
---|
342 | .NOTPARALLEL: $(mocinc)
|
---|
343 | $(mocinc): $(mocsrc)
|
---|
344 | $$(call MSG_TOOL,moc,$(target),$(mocsrc),$$@)
|
---|
345 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
346 | $$(QUIET)$$(VBOX_MOC) -i $(mocsrc) -o $$@
|
---|
347 |
|
---|
348 | endef
|
---|
349 |
|
---|
350 | ## Generate a rule to create a MOC include file from a UI header (ui.h) containing
|
---|
351 | # local classes that use the Q_OBJECT macro. This include is then included
|
---|
352 | # by that header, so it must be generated before the UI source gets compiled.
|
---|
353 | # @param $mocuihdr UI header file with Q_OBJECT
|
---|
354 | define def_qt_gen_inc_mocuihdr
|
---|
355 |
|
---|
356 | $(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
|
---|
357 | $(eval uiobj := $(PATH_$(target)_$$(uisrc))/$(notdir $(basename $$(uisrc)))$(SUFF_OBJ))
|
---|
358 | $(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
|
---|
359 |
|
---|
360 | $(target)_GENHDRS_REAL += $(mocuiinc)
|
---|
361 |
|
---|
362 | .NOTPARALLEL: $(mocuiinc)
|
---|
363 | $(uisrc): $(mocuiinc)
|
---|
364 | $(mocuiinc): $(mocuihdr)
|
---|
365 | $$(call MSG_TOOL,moc,$(target),$(mocuihdr),$$@)
|
---|
366 | $$(QUIET)$$(MKDIR) -p $$(@D)
|
---|
367 | $$(QUIET)$$(VBOX_MOC) -i $(mocuihdr) -o $$@
|
---|
368 |
|
---|
369 | endef
|
---|
370 |
|
---|
371 | ## Generate a rule to create a header and source files from an UI
|
---|
372 | # definition source (.ui).
|
---|
373 | # @param $uifile UI definintion source file
|
---|
374 | define def_qt_gen_src_ui
|
---|
375 |
|
---|
376 | $(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
|
---|
377 | $(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
|
---|
378 | $(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
|
---|
379 |
|
---|
380 | $(target)_GENSRCS_REAL += $(uisrc) $(mocsrc)
|
---|
381 | $(target)_GENHDRS_REAL += $(uihdr)
|
---|
382 |
|
---|
383 | .NOTPARALLEL: $(uihdr)
|
---|
384 | $(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
|
---|
385 | $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
|
---|
386 | $$(QUIET)$$(VBOX_UIC) $(uifile) -o $$@
|
---|
387 |
|
---|
388 | $(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $$(call DIRDEP,$(dir $(uisrc)))
|
---|
389 | $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
|
---|
390 | $$(QUIET)$$(VBOX_UIC) $(uifile) -i $(uihdr) -o $$@
|
---|
391 |
|
---|
392 | $(mocsrc): $(uihdr) | $$(call DIRDEP,$(dir $(mocsrc)))
|
---|
393 | $$(call MSG_TOOL,moc,$(target),$(uihdr),$$@)
|
---|
394 | $$(QUIET)$$(VBOX_MOC) $(uihdr) -o $$@
|
---|
395 |
|
---|
396 | endef
|
---|
397 |
|
---|
398 | ## Generate a rule to create a .qm file from a NLS translation
|
---|
399 | # source (.ts).
|
---|
400 | # @param $tsfile Translation source file
|
---|
401 | define def_qt_gen_nls
|
---|
402 |
|
---|
403 | $(eval qmfile := $(PATH_$(target))/nls/$(notdir $(basename $(tsfile))).qm)
|
---|
404 |
|
---|
405 | OTHER_CLEAN += $(qmfile)
|
---|
406 |
|
---|
407 | $(qmfile): $(tsfile) | $$(call DIRDEP,$(dir $(qmfile)))
|
---|
408 | $$(call MSG_TOOLS,lrelease,$(target),$(tsfile),$$@)
|
---|
409 | $$(QUIET)$$(VBOX_LRELEASE) $(tsfile) -qm $$@
|
---|
410 |
|
---|
411 | endef
|
---|
412 |
|
---|
413 | ## Generate rules for generating the Qt source for a target.
|
---|
414 | # @param $target Target name.
|
---|
415 | define def_qt_gen_src
|
---|
416 |
|
---|
417 | # moc srcs from hdrs with Q_OBJECT
|
---|
418 | $(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
|
---|
419 | # moc includes from srcs with Q_OBJECT
|
---|
420 | $(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
|
---|
421 | # moc includes from UI headers with Q_OBJECT
|
---|
422 | $(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
|
---|
423 | # UI sources
|
---|
424 | $(foreach uifile,$($(target)_QT_UISRCS),$(eval $(def_qt_gen_src_ui)))
|
---|
425 | # NLS files
|
---|
426 | $(foreach tsfile,$($(target)_QT_TRANSLATIONS),$(eval $(def_qt_gen_nls)))
|
---|
427 | $(foreach tsfile,$($(target)_QT_TRANSLATIONS_QT),$(eval $(def_qt_gen_nls)))
|
---|
428 | # dirs
|
---|
429 | $$(call DIRDEP,$(PATH_$(target))/ui/) \
|
---|
430 | $$(call DIRDEP,$(PATH_$(target))/moc/) \
|
---|
431 | $$(call DIRDEP,$(PATH_$(target))/nls/):
|
---|
432 | $$(call MSG_MKDIR,$$@)
|
---|
433 | $$(QUIET)$$(MKDIR) -p $$@
|
---|
434 |
|
---|
435 | endef
|
---|
436 |
|
---|
437 | # Generate Qt source rules.
|
---|
438 | $(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
|
---|
439 |
|
---|
440 |
|
---|
441 | # Generate COM Wrappers
|
---|
442 | .NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
|
---|
443 |
|
---|
444 | $(WRAPPERSINCFILE): $(WRAPPERSFILE)
|
---|
445 |
|
---|
446 | $(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
|
---|
447 | $(call MSG_TOOL,xsltproc,VirtualBox,$<,$@)
|
---|
448 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
|
---|
449 |
|
---|
450 | $(call DIRDEP,$(PATH_VirtualBox)/include/):
|
---|
451 | $(call MSG_MKDIR,$@)
|
---|
452 | $(QUIET)$(MKDIR) -p $@
|
---|
453 |
|
---|
454 | # this is actually necessary only for Win32 target with disabled dependencies
|
---|
455 | define def_wrapper_deps
|
---|
456 | $(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
|
---|
457 | endef
|
---|
458 |
|
---|
459 | $(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
|
---|
460 |
|
---|
461 | # static images imported from VBoxUI.pro as VirtualBox_QT_IMAGES
|
---|
462 |
|
---|
463 | $(PATH_VirtualBox)/ui/vbox_image_collection.txt: VBoxUI.pro $(VirtualBox_QT_IMAGES)
|
---|
464 | @echo " \
|
---|
465 | $(VirtualBox_QT_IMAGES) \
|
---|
466 | " > $@
|
---|
467 |
|
---|
468 | $(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $(PATH_VirtualBox)/ui/vbox_image_collection.txt
|
---|
469 | $(call MSG_TOOL,uic,VirtualBox,$<,$@)
|
---|
470 | $(QUIET)$(VBOX_UIC) -o $@ -embed VBoxGUI -f $<
|
---|
471 |
|
---|
472 | VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
|
---|
473 | OTHER_CLEAN += $(PATH_VirtualBox)/ui/vbox_image_collection.txt
|
---|
474 |
|
---|
475 |
|
---|
476 | #
|
---|
477 | # Hand made dependencies go here.
|
---|
478 | # Basically, here are dependencies for generated UI source files that
|
---|
479 | # include generated headers in turn.
|
---|
480 | #
|
---|
481 |
|
---|
482 | $(PATH_VirtualBox)/ui/VBoxDiskImageManagerDlg.cpp: \
|
---|
483 | $(PATH_VirtualBox)/ui/VBoxNewHDWzd.h
|
---|
484 |
|
---|
485 | # Make all generated UI sources dependent on all generated headers (since they
|
---|
486 | # may include them). This is safer than indifidual dependencies above but
|
---|
487 | # currently disabled, because will cause all UI sources to be rebuilt one a
|
---|
488 | # single one changes.
|
---|
489 | #$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS)))) : $(VirtualBox_GENHDRS)
|
---|
490 |
|
---|
491 |
|
---|
492 | #
|
---|
493 | # Custom targets
|
---|
494 | #
|
---|
495 |
|
---|
496 | # Update all known NLS translation (.ts) files in the nls/ subdirectory.
|
---|
497 | # NOTE: This target is intened to be run only by the GUI maintainer shortly
|
---|
498 | # before a new product release. VirtualBox_xx_YY.ts is a template for new
|
---|
499 | # languages and should never be actually translated or installed.
|
---|
500 | updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
|
---|
501 | $(call MSG_L1,lupdate all languages (nls/*.ts))
|
---|
502 | $(QUIET)$(VBOX_LUPDATE) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
|
---|
503 |
|
---|
504 |
|
---|
505 | #
|
---|
506 | # Test targets
|
---|
507 | #
|
---|
508 |
|
---|
509 | test:
|
---|
510 | @echo ====================
|
---|
511 | @echo $(VirtualBox_GENSRCS) | $(SED) -e "s/ /\n/g"
|
---|
512 | @echo --------------------
|
---|
513 | @echo $(VirtualBox_GENSRCS_REAL) | $(SED) -e "s/ /\n/g"
|
---|
514 | @echo ====================
|
---|
515 | @echo $(VirtualBox_GENHDRS) | $(SED) -e "s/ /\n/g"
|
---|
516 | @echo --------------------
|
---|
517 | @echo $(VirtualBox_GENHDRS_REAL) | $(SED) -e "s/ /\n/g"
|
---|
518 | @echo ====================
|
---|
519 |
|
---|
520 | test2:
|
---|
521 | @echo $(OTHER_CLEAN) | $(SED) -e "s/ /\n/g"
|
---|
522 |
|
---|
523 | test3:
|
---|
524 | @echo $(VirtualBox_HEADERS) | $(SED) -e "s/ /\n/g"
|
---|
525 |
|
---|
526 | testwrappers: $(WRAPPERSFILE)
|
---|
527 |
|
---|