VirtualBox

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

最後變更 在這個檔案從6056是 6056,由 vboxsync 提交於 17 年 前

first version of a PulseAudio driver backend for Linux (still no pcm_in)

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette