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