VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk@ 5131

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

FE/Qt: OS/2: Instal qt.dll when building the GUI.

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