VirtualBox

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

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

FE/Qt4: Renamed QIRichLabel to QILabel. From now QAbstractWizard uses the new global QILabel.

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