VirtualBox

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

Last change on this file since 4994 was 4887, checked in by vboxsync, 18 years ago

FreeBSD patches.

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

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