VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk@ 8109

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

FE/Qt4: Backported r29617,r29634 (New non OSE about dialog). Splited up the resource files for Non-OSE & OSE use.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 31.8 KB
Line 
1# $Id: Makefile.kmk 7995 2008-04-15 14:12: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 (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_UISRCS3 := $(FORMS)
23# Import translation sources
24VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS)
25
26# reset things to avoid possible conflicts with kBuild
27TEMPLATE :=
28LANGUAGE :=
29FORMS :=
30TRANSLATIONS :=
31IMAGES :=
32
33VBOX_WITH_REGISTRATION := 1
34VBOX_WITH_REGISTRATION_REQUEST := 1
35
36DEPTH = ../../../..
37include $(PATH_KBUILD)/header.kmk
38
39# Disable the debugger for now, this is another story.
40VBOX_WITH_DEBUGGER_GUI :=
41DEFS := $(filter-out VBOX_WITH_DEBUGGER_GUI,$(DEFS))
42
43#
44# Handmade configuration of qt4 - very annoying, this needs to
45# be cleaned up properly later some time (not important now).
46#
47ifndef VBOX_PATH_QT4
48 if1of ($(USERNAME), bird)
49 # gentoo (64-bit)
50 VBOX_PATH_QT4 ?= /usr
51 VBOX_PATH_QT4_BIN ?= /usr/bin
52 VBOX_PATH_QT4_INCLUDE ?= /usr/include/qt4
53 VBOX_PATH_QT4_LIB ?= /usr/lib/qt4
54 VBOX_PATH_QT4_LIB64 ?= /usr/lib/qt4
55 VBOX_PATH_QT4_SHARE ?= /usr/share/qt4
56 endif
57endif
58VBOX_PATH_QT4 ?= /usr
59VBOX_PATH_QT4_BIN ?= $(VBOX_PATH_QT4)/bin
60VBOX_PATH_QT4_INCLUDE ?= $(VBOX_PATH_QT4)/include
61VBOX_PATH_QT4_LIB ?= $(VBOX_PATH_QT4)/lib
62VBOX_PATH_QT4_LIB64 ?= $(VBOX_PATH_QT4)/lib64
63VBOX_PATH_QT4_SHARE ?= $(VBOX_PATH_QT4)
64
65VBOX_MODULE_QT4 = QtCore QtGui QtNetwork Qt3Support
66VBOX_DEFS_QT4 = QT_CORE_LIB QT_GUI_LIB QT_NETWORK_LIB QT_QT3SUPPORT_LIB
67
68ifeq ($(BUILD_TARGET),darwin)
69 VBOX_MODULE_QT4 += QtSql QtXml
70 VBOX_DEFS_QT4 = QT_SQL_LIB QT_XML_LIB
71 VBOX_INCS_QT4 = $(foreach mod, $(VBOX_MODULE_QT4), $(join $(join /Library/Frameworks/, $(mod)), .framework/Headers))
72 VBOX_LIBS_QT4 =
73else
74 VBOX_INCS_QT4 = \
75 $(VBOX_PATH_QT4_SHARE)/mkspecs/linux-g++ \
76 $(addprefix $(VBOX_PATH_QT4_INCLUDE)/, $(VBOX_MODULE_QT4) Qt) \
77 $(VBOX_PATH_QT4_INCLUDE)
78 VBOX_LIBS_QT4 = $(VBOX_MODULE_QT4)
79endif
80
81# Warn about all what you know about porting qt3->qt4.
82# Disable this if you like to see something on your screen.
83#VBOX_DEFS_QT4 += QT3_SUPPORT_WARNINGS
84# Some default defs
85VBOX_DEFS_QT4 += QT3_SUPPORT QT_SHARED HAVE_CONFIG_H QT_NO_DEBUG
86
87VBOX_UIC3 ?= $(VBOX_PATH_QT4_BIN)/uic3
88VBOX_UIC4 ?= $(VBOX_PATH_QT4_BIN)/uic
89VBOX_MOC4 ?= $(VBOX_PATH_QT4_BIN)/moc
90VBOX_RCC4 ?= $(VBOX_PATH_QT4_BIN)/rcc
91VBOX_LUPDATE4 ?= $(VBOX_PATH_QT4_BIN)/lupdate
92VBOX_LRELEASE4 ?= $(VBOX_PATH_QT4_BIN)/lrelease
93
94# Template copy from the qt3 stuff. Appended a "4" on the
95# relevant places.
96
97#
98# Template for building Qt GUI executables.
99#
100
101TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
102TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS) $(VBOX_DEFS_QT4)
103TEMPLATE_VBOXQT4GUIEXE_INCS = \
104 $(VBOX_PATH_SDK)/include \
105 $(VBOX_INCS_QT4)
106
107ifeq ($(BUILD_TARGET),win)
108 # drag in library configuration (we need QMAKE_PRL_DEFINES)
109 ifneq ($(LIB_QT_PRL),)
110 include $(LIB_QT_PRL)
111 endif
112 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
113 TEMPLATE_VBOXQT4GUIEXE_DEFS += \
114 _WIN32_WINNT=0x0500 UNICODE _UNICODE \
115 QT_DLL _CRT_SECURE_NO_DEPRECATE \
116 $(QMAKE_PRL_DEFINES)
117 ## @todo VCC70 flags?
118 ifdef VBOX_USE_VCC80
119 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
120 -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
121 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
122 else
123 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
124 -nologo -Zm200 -W3 -MD -Zi -GX
125 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
126 endif
127 TEMPLATE_VBOXQT4GUIEXE_INCS += \
128 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
129 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
130 /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
131 /DELAYLOAD:oleaut32.dll
132 TEMPLATE_VBOXQT4GUIEXE_SDKS = WINPSDK
133 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
134 $(LIB_QT) \
135 $(LIB_QTMAIN) \
136 $(LIB_RUNTIME) \
137 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
138 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
139 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
140 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
141 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
142 TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
143
144else # the gcc guys:
145 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
146 TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
147
148 TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
149
150 TEMPLATE_VBOXQT4GUIEXE_INCS += \
151 $(LIB_SDL_INC)
152 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
153 -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
154 -Wno-long-long -fshort-wchar -fno-strict-aliasing \
155 $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
156 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
157 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
158 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
159 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
160 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
161 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
162 $(VBOX_LIBS_QT4) \
163 $(LIB_SDL) \
164 $(LIB_RUNTIME) \
165 $(LIB_REM) \
166 $(LIB_VMM)
167
168 ifeq ($(BUILD_TARGET_ARCH),amd64)
169 TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
170 $(VBOX_PATH_QT4_LIB64) $(VBOX_PATH_QT4_LIB)
171 else
172 TEMPLATE_VBOXQT4GUIEXE_LIBPATH = \
173 $(VBOX_PATH_QT4_LIB)
174 endif
175
176 ifeq ($(BUILD_TARGET),linux)
177 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
178 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
179 $(VBOX_XCURSOR_LIBS)
180 else ifeq ($(BUILD_TARGET),darwin)
181 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(foreach mod, $(VBOX_MODULE_QT4), -framework $(mod)) \
182 -framework Carbon -framework QuickTime -bind_at_load
183 TEMPLATE_VBOXQT4GUIEXE_LIBS +=
184 TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
185 else ifeq ($(BUILD_TARGET),os2)
186 # drag in library configuration (we need QMAKE_PRL_DEFINES)
187 ifneq ($(LIB_QT_PRL),)
188 include $(LIB_QT_PRL)
189 endif
190 TEMPLATE_VBOXQT4GUIEXE_DEFS += $(QMAKE_PRL_DEFINES)
191 TEMPLATE_VBOXQT4GUIEXE_LIBS +=
192 TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
193 else
194 TEMPLATE_VBOXQT4GUIEXE_INCS += \
195 $(VBOX_XCURSOR_INCS)
196 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
197 $(VBOX_XCURSOR_LIBS) \
198 Xext \
199 X11 \
200 m \
201 $(LIB_PTHREAD)
202 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
203 $(VBOX_LIBPATH_X11)
204 ifeq ($(BUILD_TARGET),freebsd)
205 TEMPLATE_VBOXQT4GUIEXE_INCS += \
206 /usr/include \
207 /usr/X11R6/include \
208 /usr/local/include
209 endif
210 endif
211
212endif
213
214# Add COM/XPCOM stuff
215TEMPLATE_VBOXQT4GUIEXE_LIBS += \
216 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
217ifdef VBOX_WITH_XPCOM
218 ## @todo may be worth creating the VBOX_XPCOM SDK def
219 TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
220 TEMPLATE_VBOXQT4GUIEXE_INCS += \
221 $(VBOX_XPCOM_INCS)
222 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
223 $(LIB_XPCOM)
224endif
225
226#
227# Template for building Qt GUI components.
228#
229TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
230TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQTGUIEXE
231TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
232ifeq ($(BUILD_TARGET),darwin)
233 TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS))
234endif
235ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
236 ifneq ($(BUILD_TARGET),win)
237 TEMPLATE_VBOXQT4GUI_DEFS = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
238 TEMPLATE_VBOXQT4GUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
239 TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
240 TEMPLATE_VBOXQT4GUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
241 endif
242endif
243
244
245#
246# exclude inappropriate UI content
247#
248ifndef VBOX_WITH_REGISTRATION
249VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS3))
250endif
251
252
253#
254# filter ported UI content
255#
256VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxAboutDlg.ui,$(VirtualBox_QT_UISRCS3))
257VirtualBox_QT_UISRCS4 += ui/VBoxAboutDlg.ui
258
259VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxCloseVMDlg.ui,$(VirtualBox_QT_UISRCS3))
260VirtualBox_QT_UISRCS4 += ui/VBoxCloseVMDlg.ui
261
262VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxNewVMWzd.ui,$(VirtualBox_QT_UISRCS3))
263VirtualBox_QT_UISRCS4 += ui/VBoxNewVMWzd.ui
264
265VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxNewHDWzd.ui,$(VirtualBox_QT_UISRCS3))
266VirtualBox_QT_UISRCS4 += ui/VBoxNewHDWzd.ui
267
268VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxVMFirstRunWzd.ui,$(VirtualBox_QT_UISRCS3))
269VirtualBox_QT_UISRCS4 += ui/VBoxVMFirstRunWzd.ui
270
271VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS3))
272VirtualBox_QT_UISRCS4 += ui/VBoxRegistrationDlg.ui
273
274VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxSharedFoldersSettings.ui,$(VirtualBox_QT_UISRCS3))
275VirtualBox_QT_UISRCS4 += ui/VBoxSharedFoldersSettings.ui
276
277VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxSnapshotDetailsDlg.ui,$(VirtualBox_QT_UISRCS3))
278VirtualBox_QT_UISRCS4 += ui/VBoxSnapshotDetailsDlg.ui
279
280VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxVMInformationDlg.ui,$(VirtualBox_QT_UISRCS3))
281VirtualBox_QT_UISRCS4 += ui/VBoxVMInformationDlg.ui
282
283VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxTakeSnapshotDlg.ui,$(VirtualBox_QT_UISRCS3))
284VirtualBox_QT_UISRCS4 += ui/VBoxTakeSnapshotDlg.ui
285
286VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxSnapshotsWgt.ui,$(VirtualBox_QT_UISRCS3))
287VirtualBox_QT_UISRCS4 += ui/VBoxSnapshotsWgt.ui
288
289VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxVMLogViewer.ui,$(VirtualBox_QT_UISRCS3))
290VirtualBox_QT_UISRCS4 += ui/VBoxVMLogViewer.ui
291
292
293#
294# The targets.
295#
296PROGRAMS = VirtualBox
297ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(BUILD_TARGET)),) # X11
298DLLS = VBoxKeyboard4
299OTHERS = $(PATH_BIN)/vboxkeyboard4.tar.gz
300endif
301INSTALLS = VirtualBox.nls
302
303ifeq ($(BUILD_TARGET),os2)
304 DLLS += VBoxHlp
305 ifneq ($(strip $(VBOX_DLL_QT)),)
306 INSTALLS += qt.dll
307 qt.dll_INST = $(INST_BIN)
308 qt.dll_SOURCES += \
309 $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
310 endif
311endif
312
313
314#
315# VBoxHlp - helper DLL for OS/2.
316#
317VBoxHlp_ASTOOL = NASM
318VBoxHlp_ASFLAGS = -f obj
319VBoxHlp_DEFS = IN_RING3 IN_VBOXHLP
320VBoxHlp_CXXFLAGS = -fno-exceptions
321VBoxHlp_LDFLAGS = -nostdlib -los2
322VBoxHlp_LDFLAGS += -Zlinker option -Zlinker manyautodata
323VBoxHlp_SOURCES = \
324 src/os2/VBoxHlp.asm \
325 src/os2/VBoxHlp.cpp
326
327
328#
329# VBoxKeyboard - keyboard library for X11.
330#
331VBoxKeyboard4_TEMPLATE = VBOXR3
332VBoxKeyboard4_SOURCES = \
333 src/linux/keyboard-new.c
334VBoxKeyboard4_TARSOURCES = \
335 $(VBoxKeyboard4_SOURCES) \
336 src/linux/COPYING.LIB \
337 src/linux/keyboard.h \
338 src/linux/keyboard-layouts.h \
339 src/linux/keyboard-list.h \
340 src/linux/keyboard-tables.h \
341 src/linux/Makefile
342VBoxKeyboard4_LIBS = X11
343VBoxKeyboard4_LIBPATH = $(VBOX_LIBPATH_X11)
344
345
346#
347# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
348# redistributed with usable sources.
349#
350SOURCE_DIRECTORY = vboxkeyboard4
351DIRECTORY_PREFIX = src/linux/
352
353$(PATH_TARGET)/$(SOURCE_DIRECTORY):
354 $(MKDIR) -p $(@D)
355 $(LN_SYMLINK) $(abspath $(PATH_CURRENT))/$(DIRECTORY_PREFIX) $@
356
357$(PATH_BIN)/vboxkeyboard4.tar.gz: $(VBoxKeyboard4_TARSOURCES) $(PATH_TARGET)/$(SOURCE_DIRECTORY)
358 $(call MSG_TOOL,tar/gzip,,$@)
359 $(QUIET)cd $(PATH_TARGET) && tar -chf - $(addprefix $(SOURCE_DIRECTORY)/,$(subst $(DIRECTORY_PREFIX),,$(VBoxKeyboard4_TARSOURCES))) | gzip - > $@
360
361
362#
363# VirtualBox - The GUI program.
364#
365VirtualBox_TEMPLATE = VBOXQT4GUIEXE
366VirtualBox_NAME = VirtualBox4
367VirtualBox_SDKS.win = WINPSDK DXSDK
368#ifeq ($(filter-out freebsd linux netbsd openbsd os2 solaris,$(BUILD_TARGET)),) - later
369ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(BUILD_TARGET)),) # X11 + os2
370VirtualBox_SDKS += LIBSDL
371endif
372
373ifeq ($(BUILD_TARGET),darwin)
374# For the launch trick we need different inode numbers.
375VirtualBox_INST = $(INST_BIN)VirtualBox4 $(INST_BIN)VirtualBoxVM4
376
377 # For testing iChat Theater stuff change
378 # the sdk path
379 ifdef VBOX_WITH_ICHAT_THEATER
380 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
381 endif
382
383endif
384
385ifndef VBOX_OSE
386ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # linux only, yea, right.
387# Note: I'm doing this right here because the GUI will _not_ run
388# without that file which might be annoying for developers!
389$(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
390 $(call MSG_GENERATE,,$@)
391 $(QUIET)$(CP) $< $@
392
393$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
394endif
395endif
396
397# Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
398VirtualBox_QT_TRANSLATIONS_QT := \
399 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\
400 $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
401
402# QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
403
404# Headers containing definitions of classes that use the Q_OBJECT macro
405VirtualBox_QT_MOCHDRS = \
406 include/QIWidgetValidator.h \
407 include/QIHotKeyEdit.h \
408 include/QIStatusBar.h \
409 include/QIStateIndicator.h \
410 include/QIMessageBox.h \
411 include/QIRichLabel.h \
412 include/QIAbstractWizard.h \
413 include/QIAbstractDialog.h \
414 include/VBoxGlobalSettings.h \
415 include/VBoxUtils.h \
416 include/VBoxGlobal.h \
417 include/VBoxVMListBox.h \
418 include/VBoxMediaComboBox.h \
419 include/VBoxSelectorWnd.h \
420 include/VBoxConsoleWnd.h \
421 include/VBoxConsoleView.h \
422 include/VBoxProblemReporter.h \
423 include/VBoxDownloaderWgt.h \
424 include/VBoxNetworkFramework.h \
425 include/VBoxAboutDlg.h \
426 include/VBoxCloseVMDlg.h \
427 include/VBoxNewVMWzd.h \
428 include/VBoxNewHDWzd.h \
429 include/VBoxVMFirstRunWzd.h \
430 include/VBoxRegistrationDlg.h \
431 include/VBoxSharedFoldersSettings.h \
432 include/VBoxSnapshotDetailsDlg.h \
433 include/VBoxVMInformationDlg.h \
434 include/VBoxTakeSnapshotDlg.h \
435 include/VBoxSnapshotsWgt.h \
436 include/VBoxVMLogViewer.h
437
438# Sources containing local definitions of classes that use the Q_OBJECT macro
439VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
440ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
441VirtualBox_QT_MOCSRCS += src/VBoxGlobal.cpp
442endif
443ifdef VBOX_WITH_XPCOM
444VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
445endif
446
447# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
448VirtualBox_QT_MOCUIHDRS = \
449 ui/VBoxVMSettingsDlg.ui.h \
450 ui/VBoxVMLogViewer.ui.h
451
452
453# All generated sources. Note: this list MUST be in sync with Qt source
454# generation rules defined somewhere below!
455VirtualBox_GENSRCS = \
456 $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
457 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS3))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp)
458
459# All generated headers. Note: this list MUST be in sync with Qt source
460# generation rules defined somewhere below!
461VirtualBox_GENHDRS = \
462 $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
463 $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
464 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS3))), $(PATH_VirtualBox)/ui/$(ui).h) \
465 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS4))), $(PATH_VirtualBox)/ui/$(ui).gen.h)
466
467# All existing .ui.h files for known .ui sources
468VirtualBox_QT_UIHDRS = \
469 $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS3)))
470
471# All header files
472VirtualBox_HEADERS = \
473 $(wildcard include/*.h) \
474 $(VirtualBox_GENHDRS) \
475 $(VirtualBox_QT_UIHDRS)
476
477
478VirtualBox_SOURCES = \
479 $(VirtualBox_GENSRCS) \
480 src/main.cpp \
481 src/COMDefs.cpp \
482 src/QIWidgetValidator.cpp \
483 src/QIHotKeyEdit.cpp \
484 src/QIStateIndicator.cpp \
485 src/QIStatusBar.cpp \
486 src/QIMessageBox.cpp \
487 src/QIRichLabel.cpp \
488 src/QIAbstractWizard.cpp \
489 src/QIAbstractDialog.cpp \
490 src/VBoxDefs.cpp \
491 src/VBoxGlobalSettings.cpp \
492 src/VBoxGlobal.cpp \
493 src/VBoxMediaComboBox.cpp \
494 src/VBoxProblemReporter.cpp \
495 src/VBoxSelectorWnd.cpp \
496 src/VBoxConsoleView.cpp \
497 src/VBoxConsoleWnd.cpp \
498 src/VBoxDownloaderWgt.cpp \
499 src/VBoxVMListBox.cpp \
500 src/VBoxFrameBuffer.cpp \
501 src/HappyHttp.cpp \
502 src/VBoxNetworkFramework.cpp \
503 src/VBoxAboutDlg.cpp \
504 src/VBoxCloseVMDlg.cpp \
505 src/VBoxNewVMWzd.cpp \
506 src/VBoxNewHDWzd.cpp \
507 src/VBoxVMFirstRunWzd.cpp \
508 src/VBoxRegistrationDlg.cpp \
509 src/VBoxSharedFoldersSettings.cpp \
510 src/VBoxSnapshotDetailsDlg.cpp \
511 src/VBoxVMInformationDlg.cpp \
512 src/VBoxTakeSnapshotDlg.cpp \
513 src/VBoxSnapshotsWgt.cpp \
514 src/VBoxVMLogViewer.cpp
515
516ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
517VirtualBox_SOURCES += \
518 src/linux/XKeyboard-new.cpp
519endif
520
521VirtualBox_SOURCES.win += \
522 src/win32/VirtualBox.rc
523
524VirtualBox_SOURCES.win += \
525 src/VBoxFBDDRAW.cpp
526
527VirtualBox_SOURCES.darwin = \
528 src/darwin/DarwinKeyboard.cpp \
529 src/darwin/DarwinCursor.cpp \
530 src/darwin/VBoxUtils-darwin.cpp \
531 src/VBoxFBQuartz2D.cpp
532# src/darwin/VBoxAquaStyle.cpp \
533
534ifdef VBOX_WITH_ICHAT_THEATER
535 VirtualBox_SOURCES.darwin += \
536 src/darwin/VBoxIChatTheaterWrapper.m
537endif
538
539ifneq ($(BUILD_TARGET),win)
540src/HappyHttp.cpp_CXXFLAGS += -fexceptions
541src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
542src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
543endif
544src/HappyHttp.cpp_CXXFLAGS.linux += -O2
545
546## @todo how to detect what tool is used?
547## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
548# more generic -Wno-extra
549ifdef VBOX_WITH_XPCOM
550src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
551endif
552
553VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
554VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
555VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
556VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
557VirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
558VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
559VirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
560VirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL
561VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
562VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
563VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
564#ifndef VBOX_OSE
565 VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
566#endif
567ifdef VBOX_WITH_ICHAT_THEATER
568 VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
569endif
570ifneq ($(BUILD_TYPE),release)
571 # non-release builds has some extra features.
572 VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
573 VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
574endif
575ifdef VBOX_WITH_REGISTRATION
576 VirtualBox_DEFS += VBOX_WITH_REGISTRATION
577endif
578ifdef VBOX_WITH_REGISTRATION_REQUEST
579 VirtualBox_DEFS += VBOX_WITH_REGISTRATION_REQUEST
580endif
581ifdef VBOX_WITH_ALSA
582 VirtualBox_DEFS += VBOX_WITH_ALSA
583endif
584ifdef VBOX_WITH_PULSE
585 VirtualBox_DEFS += VBOX_WITH_PULSE
586endif
587ifdef VBOX_OSE
588 VirtualBox_DEFS += VBOX_OSE
589endif
590ifdef VBOX_WITH_DEBUGGER_GUI
591 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
592endif
593
594VirtualBox_INCS = \
595 ./include \
596 $(PATH_VirtualBox)/ui \
597 $(PATH_VirtualBox)/moc \
598 $(PATH_VirtualBox)/include \
599
600
601ifeq ($(BUILD_TYPE),release)
602 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
603else
604 VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
605 ifeq ($(USERNAME),dmik)
606 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
607 else
608 VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
609 endif
610endif
611VirtualBox_LDFLAGS.os2 = -Zlinker /PM:PM -Zno-fork
612VirtualBox_LDFLAGS.darwin = -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -lz
613ifdef VBOX_WITH_ICHAT_THEATER
614 VirtualBox_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
615endif
616VirtualBox_LIBS.win = \
617 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
618 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
619 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
620VirtualBox_LIBS.os2 += $(PATH_DLL)/VBoxHlp$(VBOX_SUFF_DLL)
621ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
622VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard4$(VBOX_SUFF_DLL)
623endif
624
625
626ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
627 ifeq ($(BUILD_TARGET),win)
628 VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
629 else
630 VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
631 endif
632endif
633
634WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
635WRAPPERSINCFILE = include/COMDefs.h
636WRAPPERSTEMPLATE = include/COMWrappers.xsl
637XIDLFILE = ../../Main/idl/VirtualBox.xidl
638
639
640# generated files we need to clean manually
641OTHER_CLEAN = \
642 $(VirtualBox_GENSRCS) \
643 $(VirtualBox_GENHDRS) \
644 $(WRAPPERSFILE) \
645 $(PATH_BIN)/vboxkeyboard.tar.gz
646
647
648#
649# On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
650#
651INSTALLS.darwin += VirtualBox.app
652VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
653VirtualBox.app_MODE = 644
654VirtualBox.app_SOURCES = \
655 src/darwin/PkgInfo \
656 $(PATH_TARGET)/Info.plist \
657 images/VirtualBox.icns=>Resources/virtualbox.icns
658
659$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
660 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
661 $(QUIET)$(RM) -f $@
662 $(QUIET)$(SED) \
663 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
664 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
665 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
666 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
667 $< > $@
668
669INSTALLS.darwin += VirtualBoxVM.app
670VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
671VirtualBoxVM.app_MODE = 644
672VirtualBoxVM.app_SOURCES = \
673 src/darwin/VM-PkgInfo=>PkgInfo \
674 $(PATH_TARGET)/VM-Info.plist=>Info.plist \
675 images/VirtualBox.icns=>Resources/virtualbox.icns
676VirtualBoxVM.app_SYMLINKS = \
677 MacOS=>../../../MacOS/
678
679$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
680 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
681 $(QUIET)$(RM) -f $@
682 $(QUIET)$(SED) \
683 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
684 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
685 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
686 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
687 --output $@ $<
688
689#
690# Translation installation
691#
692VirtualBox.nls_INST = $(INST_BIN)nls4/
693VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS)))
694VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT)))
695VirtualBox.nls_MODE = 644
696
697
698#
699# Testcase for the darwin keyboard routines.
700#
701ifdef VBOX_WITH_TESTCASES
702PROGRAMS.darwin += tstDarwinKeyboard4
703tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
704tstDarwinKeyboard4_INCS = include
705tstDarwinKeyboard4_SOURCES = \
706 src/darwin/tstDarwinKeyboard.cpp \
707 src/darwin/DarwinKeyboard.cpp
708tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
709tstDarwinKeyboard4_LIBS = \
710 $(LIB_RUNTIME)
711endif
712
713# grep the images out of the resource file for dependency tracking
714VirtualBox_QT_RC += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox.qrc)
715VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application.cpp
716
717# We have different about dialogs in OSE and PUEL. Therefor two independent
718# resource files exists.
719ifdef VBOX_OSE
720VirtualBox_QT_RC_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBoxOSE.qrc)
721VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_ose.cpp
722VirtualBox_QT_UISRCS += ui/VBoxAboutDlg.ui
723else
724VirtualBox_QT_RC_NON_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBoxNonOSE.qrc)
725VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_non_ose.cpp
726VirtualBox_SOURCES += src/VBoxAboutNonOSEDlg.cpp
727endif
728
729# Commit the magic.
730# (note: before custom rules that make usage of generated variables!).
731include $(PATH_KBUILD)/footer.kmk
732
733
734#
735# Qt source file generation rules
736#
737
738## @todo move QT source generation macros to kBuild
739
740## Generate a rule to create a MOC source file from a header containing
741# classes that use the Q_OBJECT macro.
742# @param $mochdr header file with Q_OBJECT
743define def_qt_gen_src_moc
744
745$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
746
747$(target)_GENSRCS_REAL += $(mocsrc)
748
749$(mocsrc): $(mochdr)
750 $$(call MSG_TOOL,moc,$(target),$(mochdr),$$@)
751 $$(QUIET)$$(MKDIR) -p $$(@D)
752 $$(QUIET)$$(VBOX_MOC4) \
753 $(addprefix -D,$($(target)_DEFS)) \
754 $(addprefix -I,$($(target)_INCS)) \
755 $(mochdr) -o $$@
756
757endef
758
759## Generate a rule to create a MOC include file from a source containing
760# local classes that use the Q_OBJECT macro. This include is then included
761# by that source, so it must be generated before the source gets compiled.
762# @param $mocsrc source file with Q_OBJECT
763define def_qt_gen_inc_moc
764
765$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
766$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
767
768$(target)_GENHDRS_REAL += $(mocinc)
769
770$(mocobj): $(mocinc)
771
772.NOTPARALLEL: $(mocinc)
773$(mocinc): $(mocsrc)
774 $$(call MSG_TOOL,moc,$(target),$(mocsrc),$$@)
775 $$(QUIET)$$(MKDIR) -p $$(@D)
776 $$(QUIET)$$(VBOX_MOC4) \
777 $(addprefix -D,$($(target)_DEFS)) \
778 $(addprefix -I,$($(target)_INCS)) \
779 -i $(mocsrc) -o $$@
780
781endef
782
783## Generate a rule to create a MOC include file from a UI header (ui.h) containing
784# local classes that use the Q_OBJECT macro. This include is then included
785# by that header, so it must be generated before the UI source gets compiled.
786# @param $mocuihdr UI header file with Q_OBJECT
787define def_qt_gen_inc_mocuihdr
788
789$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
790$(eval uiobj := $(PATH_$(target)_$$(uisrc))/$(notdir $(basename $$(uisrc)))$(VBOX_SUFF_OBJ))
791$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
792
793$(target)_GENHDRS_REAL += $(mocuiinc)
794
795.NOTPARALLEL: $(mocuiinc)
796$(uisrc): $(mocuiinc)
797$(mocuiinc): $(mocuihdr)
798 $$(call MSG_TOOL,moc,$(target),$(mocuihdr),$$@)
799 $$(QUIET)$$(MKDIR) -p $$(@D)
800 $$(QUIET)$$(VBOX_MOC4) \
801 $(addprefix -D,$($(target)_DEFS)) \
802 $(addprefix -I,$($(target)_INCS)) \
803 -i $(mocuihdr) -o $$@
804
805endef
806
807## Generate a rule to create a header and source files from an UI3
808# definition source (.ui).
809# @param $uifile UI definintion source file
810define def_qt_gen_src_ui3
811
812$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
813$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
814$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
815
816$(target)_GENSRCS_REAL += $(uisrc) $(mocsrc)
817$(target)_GENHDRS_REAL += $(uihdr)
818
819.NOTPARALLEL: $(uihdr)
820$(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
821 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
822 $$(QUIET)$$(VBOX_UIC3) $(uifile) -o $$@
823
824$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $$(call DIRDEP,$(dir $(uisrc)))
825 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
826 $$(QUIET)$$(VBOX_UIC3) -impl $(uihdr) $(uifile) -o $$@
827
828#$$(QUIET)$$(VBOX_UIC3) $(uifile) -i $(uihdr) -o $$@
829
830$(mocsrc): $(uihdr) | $$(call DIRDEP,$(dir $(mocsrc)))
831 $$(call MSG_TOOL,moc,$(target),$(uihdr),$$@)
832 $$(QUIET)$$(VBOX_MOC4) \
833 $(addprefix -D,$($(target)_DEFS)) \
834 $(addprefix -I,$($(target)_INCS)) \
835 $(uihdr) -o $$@
836
837endef
838
839## Generate a rule to create a header file from an UI4
840# definition source (.ui).
841# @param $uifile UI definintion source file
842define def_qt_gen_src_ui4
843
844$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).gen.h)
845
846$(target)_GENHDRS_REAL += $(uihdr)
847
848.NOTPARALLEL: $(uihdr)
849$(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
850 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
851 $$(QUIET)$$(VBOX_UIC4) $(uifile) -o $$@
852
853# we assume that the generated header is at least included by
854# the normal header with the same name
855include/$(notdir $(basename $(uifile))).h: $(uihdr)
856
857endef
858
859## Generate a rule to create a .qm file from a NLS translation
860# source (.ts).
861# @param $tsfile Translation source file
862define def_qt_gen_nls
863
864$(eval qmfile := $(PATH_$(target))/nls/$(notdir $(basename $(tsfile))).qm)
865
866OTHER_CLEAN += $(qmfile)
867
868# Note that we use -nocompress in lrelease to avoid stripping comments and
869# other information from .qm files. If we don't do that, we get .qm files two
870# times smaller, but QTranslator::findMessage() will start searching for
871# translations in all existing contexts in case if it cannot find it in the
872# original context (which is of course not acceptable, no matter if it's a
873# special Qt "feature" or just a bug).
874
875$(qmfile): $(tsfile) | $$(call DIRDEP,$(dir $(qmfile)))
876 $$(call MSG_TOOLS,lrelease,$(target),$(tsfile),$$@)
877 $$(QUIET)$$(VBOX_LRELEASE4) -nocompress $(tsfile) -qm $$@
878
879endef
880
881## Generate rules for generating the Qt source for a target.
882# @param $target Target name.
883define def_qt_gen_src
884
885# moc srcs from hdrs with Q_OBJECT
886$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
887# moc includes from srcs with Q_OBJECT
888$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
889# moc includes from UI headers with Q_OBJECT
890$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
891# UI3 sources
892$(foreach uifile,$($(target)_QT_UISRCS3),$(eval $(def_qt_gen_src_ui3)))
893# UI4 sources
894$(foreach uifile,$($(target)_QT_UISRCS4),$(eval $(def_qt_gen_src_ui4)))
895# NLS files
896$(foreach tsfile,$($(target)_QT_TRANSLATIONS),$(eval $(def_qt_gen_nls)))
897$(foreach tsfile,$($(target)_QT_TRANSLATIONS_QT),$(eval $(def_qt_gen_nls)))
898# dirs
899$$(call DIRDEP,$(PATH_$(target))/ui/) \
900$$(call DIRDEP,$(PATH_$(target))/moc/) \
901$$(call DIRDEP,$(PATH_$(target))/nls/):
902 $$(call MSG_MKDIR,$$@)
903 $$(QUIET)$$(MKDIR) -p $$@
904
905endef
906
907# Generate Qt source rules.
908$(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
909
910
911# Generate COM Wrappers
912.NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
913
914$(WRAPPERSINCFILE): $(WRAPPERSFILE)
915
916$(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
917 $(call MSG_TOOL,xsltproc,VirtualBox,$<,$@)
918 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
919
920$(call DIRDEP,$(PATH_VirtualBox)/include/):
921 $(call MSG_MKDIR,$@)
922 $(QUIET)$(MKDIR) -p $@
923
924# this is actually necessary only for Win32 target with disabled dependencies
925define def_wrapper_deps
926$(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
927endef
928
929$(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
930
931# rules for resources file creation
932$(PATH_VirtualBox)/ui/qrc_application.cpp: VirtualBox.qrc $(VirtualBox_QT_RC)
933 $(call MSG_TOOL,rcc,VirtualBox,$<,$@)
934 $(QUIET)$(VBOX_RCC4) -o $@ $<
935
936$(PATH_VirtualBox)/ui/qrc_application_ose.cpp: VirtualBoxOSE.qrc $(VirtualBox_QT_RC_OSE)
937 $(call MSG_TOOL,rcc,VirtualBox,$<,$@)
938 $(QUIET)$(VBOX_RCC4) -name "OSE" -o $@ $<
939
940$(PATH_VirtualBox)/ui/qrc_application_non_ose.cpp: VirtualBoxNonOSE.qrc $(VirtualBox_QT_RC_NON_OSE)
941 $(call MSG_TOOL,rcc,VirtualBox,$<,$@)
942 $(QUIET)$(VBOX_RCC4) -name "NonOSE" -o $@ $<
943
944#
945# Hand made dependencies go here.
946# Basically, here are dependencies for generated UI source files that
947# include generated headers in turn.
948#
949
950# Make all generated UI sources dependent on all generated headers (since they
951# may include them). This is safer than indifidual dependencies above but
952# currently disabled, because will cause all UI sources to be rebuilt one a
953# single one changes.
954#$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS3)))) : $(VirtualBox_GENHDRS)
955
956
957#
958# Custom targets
959#
960
961# Update all known NLS translation (.ts) files in the nls/ subdirectory.
962# NOTE: This target is intened to be run only by the GUI maintainer shortly
963# before a new product release. VirtualBox_xx_YY.ts is a template for new
964# languages and should never be actually translated or installed.
965updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
966 $(call MSG_L1,lupdate all languages (nls/*.ts))
967 $(QUIET)$(VBOX_LUPDATE4) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
968
969
970#
971# Test targets
972#
973
974test:
975 @echo ====================
976 @echo $(VirtualBox_GENSRCS) | $(SED) -e "s/ /\n/g"
977 @echo --------------------
978 @echo $(VirtualBox_GENSRCS_REAL) | $(SED) -e "s/ /\n/g"
979 @echo ====================
980 @echo $(VirtualBox_GENHDRS) | $(SED) -e "s/ /\n/g"
981 @echo --------------------
982 @echo $(VirtualBox_GENHDRS_REAL) | $(SED) -e "s/ /\n/g"
983 @echo ====================
984
985test2:
986 @echo $(OTHER_CLEAN) | $(SED) -e "s/ /\n/g"
987
988test3:
989 @echo $(VirtualBox_HEADERS) | $(SED) -e "s/ /\n/g"
990
991testwrappers: $(WRAPPERSFILE)
992
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