VirtualBox

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

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

VBoxKeyboard depends on X11

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