VirtualBox

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

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

The Big Sun Rebranding Header Change

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 31.9 KB
Line 
1# $Id: Makefile.kmk 8155 2008-04-18 15:16:47Z 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 $(PATH_KBUILD)/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 ($(BUILD_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.
87#VBOX_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 ($(BUILD_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 ($(BUILD_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 ($(BUILD_TARGET),linux)
181 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
182 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
183 $(VBOX_XCURSOR_LIBS)
184 else ifeq ($(BUILD_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 ($(BUILD_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 ($(BUILD_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 ($(BUILD_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,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
240 ifneq ($(BUILD_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/VBoxAboutDlg.ui,$(VirtualBox_QT_UISRCS3))
261VirtualBox_QT_UISRCS4 += ui/VBoxAboutDlg.ui
262
263VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxCloseVMDlg.ui,$(VirtualBox_QT_UISRCS3))
264VirtualBox_QT_UISRCS4 += ui/VBoxCloseVMDlg.ui
265
266VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxNewVMWzd.ui,$(VirtualBox_QT_UISRCS3))
267VirtualBox_QT_UISRCS4 += ui/VBoxNewVMWzd.ui
268
269VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxNewHDWzd.ui,$(VirtualBox_QT_UISRCS3))
270VirtualBox_QT_UISRCS4 += ui/VBoxNewHDWzd.ui
271
272VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxVMFirstRunWzd.ui,$(VirtualBox_QT_UISRCS3))
273VirtualBox_QT_UISRCS4 += ui/VBoxVMFirstRunWzd.ui
274
275VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxRegistrationDlg.ui,$(VirtualBox_QT_UISRCS3))
276VirtualBox_QT_UISRCS4 += ui/VBoxRegistrationDlg.ui
277
278VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxSharedFoldersSettings.ui,$(VirtualBox_QT_UISRCS3))
279VirtualBox_QT_UISRCS4 += ui/VBoxSharedFoldersSettings.ui
280
281VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxSnapshotDetailsDlg.ui,$(VirtualBox_QT_UISRCS3))
282VirtualBox_QT_UISRCS4 += ui/VBoxSnapshotDetailsDlg.ui
283
284VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxVMInformationDlg.ui,$(VirtualBox_QT_UISRCS3))
285VirtualBox_QT_UISRCS4 += ui/VBoxVMInformationDlg.ui
286
287VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxTakeSnapshotDlg.ui,$(VirtualBox_QT_UISRCS3))
288VirtualBox_QT_UISRCS4 += ui/VBoxTakeSnapshotDlg.ui
289
290VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxSnapshotsWgt.ui,$(VirtualBox_QT_UISRCS3))
291VirtualBox_QT_UISRCS4 += ui/VBoxSnapshotsWgt.ui
292
293VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxVMLogViewer.ui,$(VirtualBox_QT_UISRCS3))
294VirtualBox_QT_UISRCS4 += ui/VBoxVMLogViewer.ui
295
296
297#
298# The targets.
299#
300PROGRAMS = VirtualBox
301ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(BUILD_TARGET)),) # X11
302DLLS = VBoxKeyboard4
303OTHERS = $(PATH_BIN)/vboxkeyboard4.tar.gz
304endif
305INSTALLS = VirtualBox.nls
306
307ifeq ($(BUILD_TARGET),os2)
308 DLLS += VBoxHlp
309 ifneq ($(strip $(VBOX_DLL_QT)),)
310 INSTALLS += qt.dll
311 qt.dll_INST = $(INST_BIN)
312 qt.dll_SOURCES += \
313 $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
314 endif
315endif
316
317
318#
319# VBoxHlp - helper DLL for OS/2.
320#
321VBoxHlp_ASTOOL = NASM
322VBoxHlp_ASFLAGS = -f obj
323VBoxHlp_DEFS = IN_RING3 IN_VBOXHLP
324VBoxHlp_CXXFLAGS = -fno-exceptions
325VBoxHlp_LDFLAGS = -nostdlib -los2
326VBoxHlp_LDFLAGS += -Zlinker option -Zlinker manyautodata
327VBoxHlp_SOURCES = \
328 src/os2/VBoxHlp.asm \
329 src/os2/VBoxHlp.cpp
330
331
332#
333# VBoxKeyboard - keyboard library for X11.
334#
335VBoxKeyboard4_TEMPLATE = VBOXR3
336VBoxKeyboard4_SOURCES = \
337 src/linux/keyboard-new.c
338VBoxKeyboard4_TARSOURCES = \
339 $(VBoxKeyboard4_SOURCES) \
340 src/linux/COPYING.LIB \
341 src/linux/keyboard.h \
342 src/linux/keyboard-layouts.h \
343 src/linux/keyboard-list.h \
344 src/linux/keyboard-tables.h \
345 src/linux/Makefile
346VBoxKeyboard4_LIBS = X11
347VBoxKeyboard4_LIBPATH = $(VBOX_LIBPATH_X11)
348
349
350#
351# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
352# redistributed with usable sources.
353#
354SOURCE_DIRECTORY = vboxkeyboard4
355DIRECTORY_PREFIX = src/linux/
356
357$(PATH_TARGET)/$(SOURCE_DIRECTORY):
358 $(MKDIR) -p $(@D)
359 $(LN_SYMLINK) $(abspath $(PATH_CURRENT))/$(DIRECTORY_PREFIX) $@
360
361$(PATH_BIN)/vboxkeyboard4.tar.gz: $(VBoxKeyboard4_TARSOURCES) $(PATH_TARGET)/$(SOURCE_DIRECTORY)
362 $(call MSG_TOOL,tar/gzip,,$@)
363 $(QUIET)cd $(PATH_TARGET) && tar -chf - $(addprefix $(SOURCE_DIRECTORY)/,$(subst $(DIRECTORY_PREFIX),,$(VBoxKeyboard4_TARSOURCES))) | gzip - > $@
364
365
366#
367# VirtualBox - The GUI program.
368#
369VirtualBox_TEMPLATE = VBOXQT4GUIEXE
370VirtualBox_NAME = VirtualBox4
371VirtualBox_SDKS.win = WINPSDK DXSDK
372#ifeq ($(filter-out freebsd linux netbsd openbsd os2 solaris,$(BUILD_TARGET)),) - later
373ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(BUILD_TARGET)),) # X11 + os2
374VirtualBox_SDKS += LIBSDL
375endif
376
377ifeq ($(BUILD_TARGET),darwin)
378# For the launch trick we need different inode numbers.
379VirtualBox_INST = $(INST_BIN)VirtualBox4 $(INST_BIN)VirtualBoxVM4
380
381 # For testing iChat Theater stuff change
382 # the sdk path
383 ifdef VBOX_WITH_ICHAT_THEATER
384 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
385 endif
386
387endif
388
389ifndef VBOX_OSE
390ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # linux only, yea, right.
391# Note: I'm doing this right here because the GUI will _not_ run
392# without that file which might be annoying for developers!
393$(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
394 $(call MSG_GENERATE,,$@)
395 $(QUIET)$(CP) $< $@
396
397$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
398endif
399endif
400
401# Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart
402VirtualBox_QT_TRANSLATIONS_QT := \
403 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\
404 $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS)))
405
406# QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
407
408# Headers containing definitions of classes that use the Q_OBJECT macro
409VirtualBox_QT_MOCHDRS = \
410 include/QIWidgetValidator.h \
411 include/QIHotKeyEdit.h \
412 include/QIStatusBar.h \
413 include/QIStateIndicator.h \
414 include/QIMessageBox.h \
415 include/QIRichLabel.h \
416 include/QIAbstractWizard.h \
417 include/QIAbstractDialog.h \
418 include/VBoxGlobalSettings.h \
419 include/VBoxUtils.h \
420 include/VBoxGlobal.h \
421 include/VBoxVMListBox.h \
422 include/VBoxMediaComboBox.h \
423 include/VBoxSelectorWnd.h \
424 include/VBoxConsoleWnd.h \
425 include/VBoxConsoleView.h \
426 include/VBoxProblemReporter.h \
427 include/VBoxDownloaderWgt.h \
428 include/VBoxNetworkFramework.h \
429 include/VBoxAboutDlg.h \
430 include/VBoxCloseVMDlg.h \
431 include/VBoxNewVMWzd.h \
432 include/VBoxNewHDWzd.h \
433 include/VBoxVMFirstRunWzd.h \
434 include/VBoxRegistrationDlg.h \
435 include/VBoxSharedFoldersSettings.h \
436 include/VBoxSnapshotDetailsDlg.h \
437 include/VBoxVMInformationDlg.h \
438 include/VBoxTakeSnapshotDlg.h \
439 include/VBoxSnapshotsWgt.h \
440 include/VBoxVMLogViewer.h
441
442# Sources containing local definitions of classes that use the Q_OBJECT macro
443VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
444ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
445VirtualBox_QT_MOCSRCS += src/VBoxGlobal.cpp
446endif
447ifdef VBOX_WITH_XPCOM
448VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
449endif
450
451# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
452VirtualBox_QT_MOCUIHDRS = \
453 ui/VBoxVMSettingsDlg.ui.h \
454 ui/VBoxVMLogViewer.ui.h
455
456
457# All generated sources. Note: this list MUST be in sync with Qt source
458# generation rules defined somewhere below!
459VirtualBox_GENSRCS = \
460 $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
461 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS3))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp)
462
463# All generated headers. Note: this list MUST be in sync with Qt source
464# generation rules defined somewhere below!
465VirtualBox_GENHDRS = \
466 $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
467 $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
468 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS3))), $(PATH_VirtualBox)/ui/$(ui).h) \
469 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS4))), $(PATH_VirtualBox)/ui/$(ui).gen.h)
470
471# All existing .ui.h files for known .ui sources
472VirtualBox_QT_UIHDRS = \
473 $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS3)))
474
475# All header files
476VirtualBox_HEADERS = \
477 $(wildcard include/*.h) \
478 $(VirtualBox_GENHDRS) \
479 $(VirtualBox_QT_UIHDRS)
480
481
482VirtualBox_SOURCES = \
483 $(VirtualBox_GENSRCS) \
484 src/main.cpp \
485 src/COMDefs.cpp \
486 src/QIWidgetValidator.cpp \
487 src/QIHotKeyEdit.cpp \
488 src/QIStateIndicator.cpp \
489 src/QIStatusBar.cpp \
490 src/QIMessageBox.cpp \
491 src/QIRichLabel.cpp \
492 src/QIAbstractWizard.cpp \
493 src/QIAbstractDialog.cpp \
494 src/VBoxDefs.cpp \
495 src/VBoxGlobalSettings.cpp \
496 src/VBoxGlobal.cpp \
497 src/VBoxMediaComboBox.cpp \
498 src/VBoxProblemReporter.cpp \
499 src/VBoxSelectorWnd.cpp \
500 src/VBoxConsoleView.cpp \
501 src/VBoxConsoleWnd.cpp \
502 src/VBoxDownloaderWgt.cpp \
503 src/VBoxVMListBox.cpp \
504 src/VBoxFrameBuffer.cpp \
505 src/HappyHttp.cpp \
506 src/VBoxNetworkFramework.cpp \
507 src/VBoxAboutDlg.cpp \
508 src/VBoxCloseVMDlg.cpp \
509 src/VBoxNewVMWzd.cpp \
510 src/VBoxNewHDWzd.cpp \
511 src/VBoxVMFirstRunWzd.cpp \
512 src/VBoxRegistrationDlg.cpp \
513 src/VBoxSharedFoldersSettings.cpp \
514 src/VBoxSnapshotDetailsDlg.cpp \
515 src/VBoxVMInformationDlg.cpp \
516 src/VBoxTakeSnapshotDlg.cpp \
517 src/VBoxSnapshotsWgt.cpp \
518 src/VBoxVMLogViewer.cpp
519
520ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
521VirtualBox_SOURCES += \
522 src/linux/XKeyboard-new.cpp
523endif
524
525VirtualBox_SOURCES.win += \
526 src/win32/VirtualBox.rc
527
528VirtualBox_SOURCES.win += \
529 src/VBoxFBDDRAW.cpp
530
531VirtualBox_SOURCES.darwin = \
532 src/darwin/DarwinKeyboard.cpp \
533 src/darwin/DarwinCursor.cpp \
534 src/darwin/VBoxUtils-darwin.cpp \
535 src/VBoxFBQuartz2D.cpp
536# src/darwin/VBoxAquaStyle.cpp \
537
538ifdef VBOX_WITH_ICHAT_THEATER
539 VirtualBox_SOURCES.darwin += \
540 src/darwin/VBoxIChatTheaterWrapper.m
541endif
542
543ifneq ($(BUILD_TARGET),win)
544src/HappyHttp.cpp_CXXFLAGS += -fexceptions
545src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
546src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
547endif
548src/HappyHttp.cpp_CXXFLAGS.linux += -O2
549
550## @todo how to detect what tool is used?
551## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
552# more generic -Wno-extra
553ifdef VBOX_WITH_XPCOM
554src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
555endif
556
557VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
558VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
559VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
560VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
561VirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
562VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
563VirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
564VirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL
565VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
566VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
567VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
568#ifndef VBOX_OSE
569 VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
570#endif
571ifdef VBOX_WITH_ICHAT_THEATER
572 VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
573endif
574ifneq ($(BUILD_TYPE),release)
575 # non-release builds has some extra features.
576 VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
577 VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
578endif
579ifdef VBOX_WITH_REGISTRATION
580 VirtualBox_DEFS += VBOX_WITH_REGISTRATION
581endif
582ifdef VBOX_WITH_REGISTRATION_REQUEST
583 VirtualBox_DEFS += VBOX_WITH_REGISTRATION_REQUEST
584endif
585ifdef VBOX_WITH_ALSA
586 VirtualBox_DEFS += VBOX_WITH_ALSA
587endif
588ifdef VBOX_WITH_PULSE
589 VirtualBox_DEFS += VBOX_WITH_PULSE
590endif
591ifdef VBOX_OSE
592 VirtualBox_DEFS += VBOX_OSE
593endif
594ifdef VBOX_WITH_DEBUGGER_GUI
595 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
596endif
597
598VirtualBox_INCS = \
599 ./include \
600 $(PATH_VirtualBox)/ui \
601 $(PATH_VirtualBox)/moc \
602 $(PATH_VirtualBox)/include \
603
604
605ifeq ($(BUILD_TYPE),release)
606 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
607else
608 VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
609 ifeq ($(USERNAME),dmik)
610 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
611 else
612 VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
613 endif
614endif
615VirtualBox_LDFLAGS.os2 = -Zlinker /PM:PM -Zno-fork
616VirtualBox_LDFLAGS.darwin = -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -lz
617ifdef VBOX_WITH_ICHAT_THEATER
618 VirtualBox_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
619endif
620VirtualBox_LIBS.win = \
621 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
622 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
623 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
624VirtualBox_LIBS.os2 += $(PATH_DLL)/VBoxHlp$(VBOX_SUFF_DLL)
625ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
626VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard4$(VBOX_SUFF_DLL)
627endif
628
629
630ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
631 ifeq ($(BUILD_TARGET),win)
632 VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
633 else
634 VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
635 endif
636endif
637
638WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
639WRAPPERSINCFILE = include/COMDefs.h
640WRAPPERSTEMPLATE = include/COMWrappers.xsl
641XIDLFILE = ../../Main/idl/VirtualBox.xidl
642
643
644# generated files we need to clean manually
645OTHER_CLEAN = \
646 $(VirtualBox_GENSRCS) \
647 $(VirtualBox_GENHDRS) \
648 $(WRAPPERSFILE) \
649 $(PATH_BIN)/vboxkeyboard.tar.gz
650
651
652#
653# On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
654#
655INSTALLS.darwin += VirtualBox.app
656VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
657VirtualBox.app_MODE = 644
658VirtualBox.app_SOURCES = \
659 src/darwin/PkgInfo \
660 $(PATH_TARGET)/Info.plist \
661 images/VirtualBox.icns=>Resources/virtualbox.icns
662
663$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
664 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
665 $(QUIET)$(RM) -f $@
666 $(QUIET)$(SED) \
667 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
668 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
669 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
670 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
671 $< > $@
672
673INSTALLS.darwin += VirtualBoxVM.app
674VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
675VirtualBoxVM.app_MODE = 644
676VirtualBoxVM.app_SOURCES = \
677 src/darwin/VM-PkgInfo=>PkgInfo \
678 $(PATH_TARGET)/VM-Info.plist=>Info.plist \
679 images/VirtualBox.icns=>Resources/virtualbox.icns
680VirtualBoxVM.app_SYMLINKS = \
681 MacOS=>../../../MacOS/
682
683$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
684 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
685 $(QUIET)$(RM) -f $@
686 $(QUIET)$(SED) \
687 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
688 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
689 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
690 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
691 --output $@ $<
692
693#
694# Translation installation
695#
696VirtualBox.nls_INST = $(INST_BIN)nls4/
697VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS)))
698VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT)))
699VirtualBox.nls_MODE = 644
700
701
702#
703# Testcase for the darwin keyboard routines.
704#
705ifdef VBOX_WITH_TESTCASES
706PROGRAMS.darwin += tstDarwinKeyboard4
707tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
708tstDarwinKeyboard4_INCS = include
709tstDarwinKeyboard4_SOURCES = \
710 src/darwin/tstDarwinKeyboard.cpp \
711 src/darwin/DarwinKeyboard.cpp
712tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
713tstDarwinKeyboard4_LIBS = \
714 $(LIB_RUNTIME)
715endif
716
717# grep the images out of the resource file for dependency tracking
718VirtualBox_QT_RC += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox.qrc)
719VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application.cpp
720
721# We have different about dialogs in OSE and PUEL. Therefor two independent
722# resource files exists.
723ifdef VBOX_OSE
724VirtualBox_QT_RC_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBoxOSE.qrc)
725VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_ose.cpp
726VirtualBox_QT_UISRCS += ui/VBoxAboutDlg.ui
727else
728VirtualBox_QT_RC_NON_OSE += $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBoxNonOSE.qrc)
729VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/qrc_application_non_ose.cpp
730VirtualBox_SOURCES += src/VBoxAboutNonOSEDlg.cpp
731endif
732
733# Commit the magic.
734# (note: before custom rules that make usage of generated variables!).
735include $(PATH_KBUILD)/footer.kmk
736
737
738#
739# Qt source file generation rules
740#
741
742## @todo move QT source generation macros to kBuild
743
744## Generate a rule to create a MOC source file from a header containing
745# classes that use the Q_OBJECT macro.
746# @param $mochdr header file with Q_OBJECT
747define def_qt_gen_src_moc
748
749$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
750
751$(target)_GENSRCS_REAL += $(mocsrc)
752
753$(mocsrc): $(mochdr)
754 $$(call MSG_TOOL,moc,$(target),$(mochdr),$$@)
755 $$(QUIET)$$(MKDIR) -p $$(@D)
756 $$(QUIET)$$(VBOX_MOC4) \
757 $(addprefix -D,$($(target)_DEFS)) \
758 $(addprefix -I,$($(target)_INCS)) \
759 $(mochdr) -o $$@
760
761endef
762
763## Generate a rule to create a MOC include file from a source containing
764# local classes that use the Q_OBJECT macro. This include is then included
765# by that source, so it must be generated before the source gets compiled.
766# @param $mocsrc source file with Q_OBJECT
767define def_qt_gen_inc_moc
768
769$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
770$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
771
772$(target)_GENHDRS_REAL += $(mocinc)
773
774$(mocobj): $(mocinc)
775
776.NOTPARALLEL: $(mocinc)
777$(mocinc): $(mocsrc)
778 $$(call MSG_TOOL,moc,$(target),$(mocsrc),$$@)
779 $$(QUIET)$$(MKDIR) -p $$(@D)
780 $$(QUIET)$$(VBOX_MOC4) \
781 $(addprefix -D,$($(target)_DEFS)) \
782 $(addprefix -I,$($(target)_INCS)) \
783 -i $(mocsrc) -o $$@
784
785endef
786
787## Generate a rule to create a MOC include file from a UI header (ui.h) containing
788# local classes that use the Q_OBJECT macro. This include is then included
789# by that header, so it must be generated before the UI source gets compiled.
790# @param $mocuihdr UI header file with Q_OBJECT
791define def_qt_gen_inc_mocuihdr
792
793$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
794$(eval uiobj := $(PATH_$(target)_$$(uisrc))/$(notdir $(basename $$(uisrc)))$(VBOX_SUFF_OBJ))
795$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
796
797$(target)_GENHDRS_REAL += $(mocuiinc)
798
799.NOTPARALLEL: $(mocuiinc)
800$(uisrc): $(mocuiinc)
801$(mocuiinc): $(mocuihdr)
802 $$(call MSG_TOOL,moc,$(target),$(mocuihdr),$$@)
803 $$(QUIET)$$(MKDIR) -p $$(@D)
804 $$(QUIET)$$(VBOX_MOC4) \
805 $(addprefix -D,$($(target)_DEFS)) \
806 $(addprefix -I,$($(target)_INCS)) \
807 -i $(mocuihdr) -o $$@
808
809endef
810
811## Generate a rule to create a header and source files from an UI3
812# definition source (.ui).
813# @param $uifile UI definintion source file
814define def_qt_gen_src_ui3
815
816$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
817$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
818$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
819
820$(target)_GENSRCS_REAL += $(uisrc) $(mocsrc)
821$(target)_GENHDRS_REAL += $(uihdr)
822
823.NOTPARALLEL: $(uihdr)
824$(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
825 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
826 $$(QUIET)$$(VBOX_UIC3) $(uifile) -o $$@
827
828$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $$(call DIRDEP,$(dir $(uisrc)))
829 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
830 $$(QUIET)$$(VBOX_UIC3) -impl $(uihdr) $(uifile) -o $$@
831
832#$$(QUIET)$$(VBOX_UIC3) $(uifile) -i $(uihdr) -o $$@
833
834$(mocsrc): $(uihdr) | $$(call DIRDEP,$(dir $(mocsrc)))
835 $$(call MSG_TOOL,moc,$(target),$(uihdr),$$@)
836 $$(QUIET)$$(VBOX_MOC4) \
837 $(addprefix -D,$($(target)_DEFS)) \
838 $(addprefix -I,$($(target)_INCS)) \
839 $(uihdr) -o $$@
840
841endef
842
843## Generate a rule to create a header file from an UI4
844# definition source (.ui).
845# @param $uifile UI definintion source file
846define def_qt_gen_src_ui4
847
848$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).gen.h)
849
850$(target)_GENHDRS_REAL += $(uihdr)
851
852.NOTPARALLEL: $(uihdr)
853$(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
854 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
855 $$(QUIET)$$(VBOX_UIC4) $(uifile) -o $$@
856
857# we assume that the generated header is at least included by
858# the normal header with the same name
859include/$(notdir $(basename $(uifile))).h: $(uihdr)
860
861endef
862
863## Generate a rule to create a .qm file from a NLS translation
864# source (.ts).
865# @param $tsfile Translation source file
866define def_qt_gen_nls
867
868$(eval qmfile := $(PATH_$(target))/nls/$(notdir $(basename $(tsfile))).qm)
869
870OTHER_CLEAN += $(qmfile)
871
872# Note that we use -nocompress in lrelease to avoid stripping comments and
873# other information from .qm files. If we don't do that, we get .qm files two
874# times smaller, but QTranslator::findMessage() will start searching for
875# translations in all existing contexts in case if it cannot find it in the
876# original context (which is of course not acceptable, no matter if it's a
877# special Qt "feature" or just a bug).
878
879$(qmfile): $(tsfile) | $$(call DIRDEP,$(dir $(qmfile)))
880 $$(call MSG_TOOLS,lrelease,$(target),$(tsfile),$$@)
881 $$(QUIET)$$(VBOX_LRELEASE4) -nocompress $(tsfile) -qm $$@
882
883endef
884
885## Generate rules for generating the Qt source for a target.
886# @param $target Target name.
887define def_qt_gen_src
888
889# moc srcs from hdrs with Q_OBJECT
890$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
891# moc includes from srcs with Q_OBJECT
892$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
893# moc includes from UI headers with Q_OBJECT
894$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
895# UI3 sources
896$(foreach uifile,$($(target)_QT_UISRCS3),$(eval $(def_qt_gen_src_ui3)))
897# UI4 sources
898$(foreach uifile,$($(target)_QT_UISRCS4),$(eval $(def_qt_gen_src_ui4)))
899# NLS files
900$(foreach tsfile,$($(target)_QT_TRANSLATIONS),$(eval $(def_qt_gen_nls)))
901$(foreach tsfile,$($(target)_QT_TRANSLATIONS_QT),$(eval $(def_qt_gen_nls)))
902# dirs
903$$(call DIRDEP,$(PATH_$(target))/ui/) \
904$$(call DIRDEP,$(PATH_$(target))/moc/) \
905$$(call DIRDEP,$(PATH_$(target))/nls/):
906 $$(call MSG_MKDIR,$$@)
907 $$(QUIET)$$(MKDIR) -p $$@
908
909endef
910
911# Generate Qt source rules.
912$(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
913
914
915# Generate COM Wrappers
916.NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
917
918$(WRAPPERSINCFILE): $(WRAPPERSFILE)
919
920$(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
921 $(call MSG_TOOL,xsltproc,VirtualBox,$<,$@)
922 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
923
924$(call DIRDEP,$(PATH_VirtualBox)/include/):
925 $(call MSG_MKDIR,$@)
926 $(QUIET)$(MKDIR) -p $@
927
928# this is actually necessary only for Win32 target with disabled dependencies
929define def_wrapper_deps
930$(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
931endef
932
933$(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
934
935# rules for resources file creation
936$(PATH_VirtualBox)/ui/qrc_application.cpp: VirtualBox.qrc $(VirtualBox_QT_RC)
937 $(call MSG_TOOL,rcc,VirtualBox,$<,$@)
938 $(QUIET)$(VBOX_RCC4) -o $@ $<
939
940$(PATH_VirtualBox)/ui/qrc_application_ose.cpp: VirtualBoxOSE.qrc $(VirtualBox_QT_RC_OSE)
941 $(call MSG_TOOL,rcc,VirtualBox,$<,$@)
942 $(QUIET)$(VBOX_RCC4) -name "OSE" -o $@ $<
943
944$(PATH_VirtualBox)/ui/qrc_application_non_ose.cpp: VirtualBoxNonOSE.qrc $(VirtualBox_QT_RC_NON_OSE)
945 $(call MSG_TOOL,rcc,VirtualBox,$<,$@)
946 $(QUIET)$(VBOX_RCC4) -name "NonOSE" -o $@ $<
947
948#
949# Hand made dependencies go here.
950# Basically, here are dependencies for generated UI source files that
951# include generated headers in turn.
952#
953
954# Make all generated UI sources dependent on all generated headers (since they
955# may include them). This is safer than indifidual dependencies above but
956# currently disabled, because will cause all UI sources to be rebuilt one a
957# single one changes.
958#$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS3)))) : $(VirtualBox_GENHDRS)
959
960
961#
962# Custom targets
963#
964
965# Update all known NLS translation (.ts) files in the nls/ subdirectory.
966# NOTE: This target is intened to be run only by the GUI maintainer shortly
967# before a new product release. VirtualBox_xx_YY.ts is a template for new
968# languages and should never be actually translated or installed.
969updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
970 $(call MSG_L1,lupdate all languages (nls/*.ts))
971 $(QUIET)$(VBOX_LUPDATE4) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
972
973
974#
975# Test targets
976#
977
978test:
979 @echo ====================
980 @echo $(VirtualBox_GENSRCS) | $(SED) -e "s/ /\n/g"
981 @echo --------------------
982 @echo $(VirtualBox_GENSRCS_REAL) | $(SED) -e "s/ /\n/g"
983 @echo ====================
984 @echo $(VirtualBox_GENHDRS) | $(SED) -e "s/ /\n/g"
985 @echo --------------------
986 @echo $(VirtualBox_GENHDRS_REAL) | $(SED) -e "s/ /\n/g"
987 @echo ====================
988
989test2:
990 @echo $(OTHER_CLEAN) | $(SED) -e "s/ /\n/g"
991
992test3:
993 @echo $(VirtualBox_HEADERS) | $(SED) -e "s/ /\n/g"
994
995testwrappers: $(WRAPPERSFILE)
996
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