VirtualBox

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

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

FE/Qt: Enabled the Registration Dialog in OSE.

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