VirtualBox

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

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

for some reason, libQtGui.so of Qt 4.4.0 does not have a dependency to Xcursor anymore

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 30.9 KB
Line 
1# $Id: Makefile.kmk 7970 2008-04-15 08:03: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 $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
459
460# All generated headers. Note: this list MUST be in sync with Qt source
461# generation rules defined somewhere below!
462VirtualBox_GENHDRS = \
463 $(foreach mocui,$(notdir $(basename $(VirtualBox_QT_MOCUIHDRS))), $(PATH_VirtualBox)/moc/$(mocui).moc) \
464 $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCSRCS))), $(PATH_VirtualBox)/moc/$(moc).moc) \
465 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS3))), $(PATH_VirtualBox)/ui/$(ui).h) \
466 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS4))), $(PATH_VirtualBox)/ui/$(ui).gen.h)
467
468# All existing .ui.h files for known .ui sources
469VirtualBox_QT_UIHDRS = \
470 $(wildcard $(addsuffix .h,$(VirtualBox_QT_UISRCS3)))
471
472# All header files
473VirtualBox_HEADERS = \
474 $(wildcard include/*.h) \
475 $(VirtualBox_GENHDRS) \
476 $(VirtualBox_QT_UIHDRS)
477
478
479VirtualBox_SOURCES = \
480 $(VirtualBox_GENSRCS) \
481 src/main.cpp \
482 src/COMDefs.cpp \
483 src/QIWidgetValidator.cpp \
484 src/QIHotKeyEdit.cpp \
485 src/QIStateIndicator.cpp \
486 src/QIStatusBar.cpp \
487 src/QIMessageBox.cpp \
488 src/QIRichLabel.cpp \
489 src/QIAbstractWizard.cpp \
490 src/QIAbstractDialog.cpp \
491 src/VBoxDefs.cpp \
492 src/VBoxGlobalSettings.cpp \
493 src/VBoxGlobal.cpp \
494 src/VBoxMediaComboBox.cpp \
495 src/VBoxProblemReporter.cpp \
496 src/VBoxSelectorWnd.cpp \
497 src/VBoxConsoleView.cpp \
498 src/VBoxConsoleWnd.cpp \
499 src/VBoxDownloaderWgt.cpp \
500 src/VBoxVMListBox.cpp \
501 src/VBoxFrameBuffer.cpp \
502 src/HappyHttp.cpp \
503 src/VBoxNetworkFramework.cpp \
504 src/VBoxAboutDlg.cpp \
505 src/VBoxCloseVMDlg.cpp \
506 src/VBoxNewVMWzd.cpp \
507 src/VBoxNewHDWzd.cpp \
508 src/VBoxVMFirstRunWzd.cpp \
509 src/VBoxRegistrationDlg.cpp \
510 src/VBoxSharedFoldersSettings.cpp \
511 src/VBoxSnapshotDetailsDlg.cpp \
512 src/VBoxVMInformationDlg.cpp \
513 src/VBoxTakeSnapshotDlg.cpp \
514 src/VBoxSnapshotsWgt.cpp \
515 src/VBoxVMLogViewer.cpp
516
517ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
518VirtualBox_SOURCES += \
519 src/linux/XKeyboard-new.cpp
520endif
521
522VirtualBox_SOURCES.win += \
523 src/win32/VirtualBox.rc
524
525VirtualBox_SOURCES.win += \
526 src/VBoxFBDDRAW.cpp
527
528VirtualBox_SOURCES.darwin = \
529 src/darwin/DarwinKeyboard.cpp \
530 src/darwin/DarwinCursor.cpp \
531 src/darwin/VBoxUtils-darwin.cpp \
532 src/VBoxFBQuartz2D.cpp
533# src/darwin/VBoxAquaStyle.cpp \
534
535ifdef VBOX_WITH_ICHAT_THEATER
536 VirtualBox_SOURCES.darwin += \
537 src/darwin/VBoxIChatTheaterWrapper.m
538endif
539
540ifneq ($(BUILD_TARGET),win)
541src/HappyHttp.cpp_CXXFLAGS += -fexceptions
542src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
543src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
544endif
545src/HappyHttp.cpp_CXXFLAGS.linux += -O2
546
547## @todo how to detect what tool is used?
548## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
549# more generic -Wno-extra
550ifdef VBOX_WITH_XPCOM
551src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
552endif
553
554VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
555VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
556VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
557VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
558VirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
559VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
560VirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
561VirtualBox_DEFS.os2 = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL QT_DLL
562VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
563VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
564VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
565#ifndef VBOX_OSE
566 VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
567#endif
568ifdef VBOX_WITH_ICHAT_THEATER
569 VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
570endif
571ifneq ($(BUILD_TYPE),release)
572 # non-release builds has some extra features.
573 VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
574 VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
575endif
576ifdef VBOX_WITH_REGISTRATION
577 VirtualBox_DEFS += VBOX_WITH_REGISTRATION
578endif
579ifdef VBOX_WITH_REGISTRATION_REQUEST
580 VirtualBox_DEFS += VBOX_WITH_REGISTRATION_REQUEST
581endif
582ifdef VBOX_WITH_ALSA
583 VirtualBox_DEFS += VBOX_WITH_ALSA
584endif
585ifdef VBOX_WITH_PULSE
586 VirtualBox_DEFS += VBOX_WITH_PULSE
587endif
588ifdef VBOX_OSE
589 VirtualBox_DEFS += VBOX_OSE
590endif
591ifdef VBOX_WITH_DEBUGGER_GUI
592 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
593endif
594
595VirtualBox_INCS = \
596 ./include \
597 $(PATH_VirtualBox)/ui \
598 $(PATH_VirtualBox)/moc \
599 $(PATH_VirtualBox)/include \
600
601
602ifeq ($(BUILD_TYPE),release)
603 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
604else
605 VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
606 ifeq ($(USERNAME),dmik)
607 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
608 else
609 VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
610 endif
611endif
612VirtualBox_LDFLAGS.os2 = -Zlinker /PM:PM -Zno-fork
613VirtualBox_LDFLAGS.darwin = -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -lz
614ifdef VBOX_WITH_ICHAT_THEATER
615 VirtualBox_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
616endif
617VirtualBox_LIBS.win = \
618 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
619 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
620 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
621VirtualBox_LIBS.os2 += $(PATH_DLL)/VBoxHlp$(VBOX_SUFF_DLL)
622ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # X11
623VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard4$(VBOX_SUFF_DLL)
624endif
625
626
627ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
628 ifeq ($(BUILD_TARGET),win)
629 VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
630 else
631 VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
632 endif
633endif
634
635WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
636WRAPPERSINCFILE = include/COMDefs.h
637WRAPPERSTEMPLATE = include/COMWrappers.xsl
638XIDLFILE = ../../Main/idl/VirtualBox.xidl
639
640
641# generated files we need to clean manually
642OTHER_CLEAN = \
643 $(VirtualBox_GENSRCS) \
644 $(VirtualBox_GENHDRS) \
645 $(WRAPPERSFILE) \
646 $(PATH_BIN)/vboxkeyboard.tar.gz
647
648
649#
650# On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
651#
652INSTALLS.darwin += VirtualBox.app
653VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
654VirtualBox.app_MODE = 644
655VirtualBox.app_SOURCES = \
656 src/darwin/PkgInfo \
657 $(PATH_TARGET)/Info.plist \
658 images/VirtualBox.icns=>Resources/virtualbox.icns
659
660$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
661 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
662 $(QUIET)$(RM) -f $@
663 $(QUIET)$(SED) \
664 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
665 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
666 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
667 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
668 $< > $@
669
670INSTALLS.darwin += VirtualBoxVM.app
671VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
672VirtualBoxVM.app_MODE = 644
673VirtualBoxVM.app_SOURCES = \
674 src/darwin/VM-PkgInfo=>PkgInfo \
675 $(PATH_TARGET)/VM-Info.plist=>Info.plist \
676 images/VirtualBox.icns=>Resources/virtualbox.icns
677VirtualBoxVM.app_SYMLINKS = \
678 MacOS=>../../../MacOS/
679
680$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
681 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
682 $(QUIET)$(RM) -f $@
683 $(QUIET)$(SED) \
684 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
685 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
686 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
687 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
688 --output $@ $<
689
690#
691# Translation installation
692#
693VirtualBox.nls_INST = $(INST_BIN)nls4/
694VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS)))
695VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT)))
696VirtualBox.nls_MODE = 644
697
698
699#
700# Testcase for the darwin keyboard routines.
701#
702ifdef VBOX_WITH_TESTCASES
703PROGRAMS.darwin += tstDarwinKeyboard4
704tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
705tstDarwinKeyboard4_INCS = include
706tstDarwinKeyboard4_SOURCES = \
707 src/darwin/tstDarwinKeyboard.cpp \
708 src/darwin/DarwinKeyboard.cpp
709tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
710tstDarwinKeyboard4_LIBS = \
711 $(LIB_RUNTIME)
712endif
713
714
715
716# Commit the magic.
717# (note: before custom rules that make usage of generated variables!).
718include $(PATH_KBUILD)/footer.kmk
719
720
721
722#
723# Qt source file generation rules
724#
725
726## @todo move QT source generation macros to kBuild
727
728## Generate a rule to create a MOC source file from a header containing
729# classes that use the Q_OBJECT macro.
730# @param $mochdr header file with Q_OBJECT
731define def_qt_gen_src_moc
732
733$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
734
735$(target)_GENSRCS_REAL += $(mocsrc)
736
737$(mocsrc): $(mochdr)
738 $$(call MSG_TOOL,moc,$(target),$(mochdr),$$@)
739 $$(QUIET)$$(MKDIR) -p $$(@D)
740 $$(QUIET)$$(VBOX_MOC4) \
741 $(addprefix -D,$($(target)_DEFS)) \
742 $(addprefix -I,$($(target)_INCS)) \
743 $(mochdr) -o $$@
744
745endef
746
747## Generate a rule to create a MOC include file from a source containing
748# local classes that use the Q_OBJECT macro. This include is then included
749# by that source, so it must be generated before the source gets compiled.
750# @param $mocsrc source file with Q_OBJECT
751define def_qt_gen_inc_moc
752
753$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(VBOX_SUFF_OBJ))
754$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
755
756$(target)_GENHDRS_REAL += $(mocinc)
757
758$(mocobj): $(mocinc)
759
760.NOTPARALLEL: $(mocinc)
761$(mocinc): $(mocsrc)
762 $$(call MSG_TOOL,moc,$(target),$(mocsrc),$$@)
763 $$(QUIET)$$(MKDIR) -p $$(@D)
764 $$(QUIET)$$(VBOX_MOC4) \
765 $(addprefix -D,$($(target)_DEFS)) \
766 $(addprefix -I,$($(target)_INCS)) \
767 -i $(mocsrc) -o $$@
768
769endef
770
771## Generate a rule to create a MOC include file from a UI header (ui.h) containing
772# local classes that use the Q_OBJECT macro. This include is then included
773# by that header, so it must be generated before the UI source gets compiled.
774# @param $mocuihdr UI header file with Q_OBJECT
775define def_qt_gen_inc_mocuihdr
776
777$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
778$(eval uiobj := $(PATH_$(target)_$$(uisrc))/$(notdir $(basename $$(uisrc)))$(VBOX_SUFF_OBJ))
779$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
780
781$(target)_GENHDRS_REAL += $(mocuiinc)
782
783.NOTPARALLEL: $(mocuiinc)
784$(uisrc): $(mocuiinc)
785$(mocuiinc): $(mocuihdr)
786 $$(call MSG_TOOL,moc,$(target),$(mocuihdr),$$@)
787 $$(QUIET)$$(MKDIR) -p $$(@D)
788 $$(QUIET)$$(VBOX_MOC4) \
789 $(addprefix -D,$($(target)_DEFS)) \
790 $(addprefix -I,$($(target)_INCS)) \
791 -i $(mocuihdr) -o $$@
792
793endef
794
795## Generate a rule to create a header and source files from an UI3
796# definition source (.ui).
797# @param $uifile UI definintion source file
798define def_qt_gen_src_ui3
799
800$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
801$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
802$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
803
804$(target)_GENSRCS_REAL += $(uisrc) $(mocsrc)
805$(target)_GENHDRS_REAL += $(uihdr)
806
807.NOTPARALLEL: $(uihdr)
808$(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
809 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
810 $$(QUIET)$$(VBOX_UIC3) $(uifile) -o $$@
811
812$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $$(call DIRDEP,$(dir $(uisrc)))
813 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
814 $$(QUIET)$$(VBOX_UIC3) -impl $(uihdr) $(uifile) -o $$@
815
816#$$(QUIET)$$(VBOX_UIC3) $(uifile) -i $(uihdr) -o $$@
817
818$(mocsrc): $(uihdr) | $$(call DIRDEP,$(dir $(mocsrc)))
819 $$(call MSG_TOOL,moc,$(target),$(uihdr),$$@)
820 $$(QUIET)$$(VBOX_MOC4) \
821 $(addprefix -D,$($(target)_DEFS)) \
822 $(addprefix -I,$($(target)_INCS)) \
823 $(uihdr) -o $$@
824
825endef
826
827## Generate a rule to create a header file from an UI4
828# definition source (.ui).
829# @param $uifile UI definintion source file
830define def_qt_gen_src_ui4
831
832$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).gen.h)
833
834$(target)_GENHDRS_REAL += $(uihdr)
835
836.NOTPARALLEL: $(uihdr)
837$(uihdr): $(uifile) | $$(call DIRDEP,$(dir $(uihdr)))
838 $$(call MSG_TOOL,uic,$(target),$(uifile),$$@)
839 $$(QUIET)$$(VBOX_UIC4) $(uifile) -o $$@
840
841# we assume that the generated header is at least included by
842# the normal header with the same name
843include/$(notdir $(basename $(uifile))).h: $(uihdr)
844
845endef
846
847## Generate a rule to create a .qm file from a NLS translation
848# source (.ts).
849# @param $tsfile Translation source file
850define def_qt_gen_nls
851
852$(eval qmfile := $(PATH_$(target))/nls/$(notdir $(basename $(tsfile))).qm)
853
854OTHER_CLEAN += $(qmfile)
855
856# Note that we use -nocompress in lrelease to avoid stripping comments and
857# other information from .qm files. If we don't do that, we get .qm files two
858# times smaller, but QTranslator::findMessage() will start searching for
859# translations in all existing contexts in case if it cannot find it in the
860# original context (which is of course not acceptable, no matter if it's a
861# special Qt "feature" or just a bug).
862
863$(qmfile): $(tsfile) | $$(call DIRDEP,$(dir $(qmfile)))
864 $$(call MSG_TOOLS,lrelease,$(target),$(tsfile),$$@)
865 $$(QUIET)$$(VBOX_LRELEASE4) -nocompress $(tsfile) -qm $$@
866
867endef
868
869## Generate rules for generating the Qt source for a target.
870# @param $target Target name.
871define def_qt_gen_src
872
873# moc srcs from hdrs with Q_OBJECT
874$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
875# moc includes from srcs with Q_OBJECT
876$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
877# moc includes from UI headers with Q_OBJECT
878$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
879# UI3 sources
880$(foreach uifile,$($(target)_QT_UISRCS3),$(eval $(def_qt_gen_src_ui3)))
881# UI4 sources
882$(foreach uifile,$($(target)_QT_UISRCS4),$(eval $(def_qt_gen_src_ui4)))
883# NLS files
884$(foreach tsfile,$($(target)_QT_TRANSLATIONS),$(eval $(def_qt_gen_nls)))
885$(foreach tsfile,$($(target)_QT_TRANSLATIONS_QT),$(eval $(def_qt_gen_nls)))
886# dirs
887$$(call DIRDEP,$(PATH_$(target))/ui/) \
888$$(call DIRDEP,$(PATH_$(target))/moc/) \
889$$(call DIRDEP,$(PATH_$(target))/nls/):
890 $$(call MSG_MKDIR,$$@)
891 $$(QUIET)$$(MKDIR) -p $$@
892
893endef
894
895# Generate Qt source rules.
896$(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
897
898
899# Generate COM Wrappers
900.NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
901
902$(WRAPPERSINCFILE): $(WRAPPERSFILE)
903
904$(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
905 $(call MSG_TOOL,xsltproc,VirtualBox,$<,$@)
906 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
907
908$(call DIRDEP,$(PATH_VirtualBox)/include/):
909 $(call MSG_MKDIR,$@)
910 $(QUIET)$(MKDIR) -p $@
911
912# this is actually necessary only for Win32 target with disabled dependencies
913define def_wrapper_deps
914$(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
915endef
916
917$(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
918
919# grep the images out of the resource file for dependency tracking
920VirtualBox_QT_IMAGES = $(shell $(SED) '/images/!d;{s/^.*\(images\/.*\)<.*$$/\1/}' VirtualBox.qrc)
921
922$(PATH_VirtualBox)/ui/vbox_image_collection.cpp: VirtualBox.qrc $(VirtualBox_QT_IMAGES)
923 $(call MSG_TOOL,rcc,VirtualBox,$<,$@)
924 $(QUIET)$(VBOX_RCC4) -o $@ $<
925
926VirtualBox_GENSRCS += $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
927
928#
929# Hand made dependencies go here.
930# Basically, here are dependencies for generated UI source files that
931# include generated headers in turn.
932#
933
934# Make all generated UI sources dependent on all generated headers (since they
935# may include them). This is safer than indifidual dependencies above but
936# currently disabled, because will cause all UI sources to be rebuilt one a
937# single one changes.
938#$(patsubst %,$(PATH_VirtualBox)/ui/%.cpp,$(notdir $(basename $(VirtualBox_QT_UISRCS3)))) : $(VirtualBox_GENHDRS)
939
940
941#
942# Custom targets
943#
944
945# Update all known NLS translation (.ts) files in the nls/ subdirectory.
946# NOTE: This target is intened to be run only by the GUI maintainer shortly
947# before a new product release. VirtualBox_xx_YY.ts is a template for new
948# languages and should never be actually translated or installed.
949updatenls: $(VirtualBox_SOURCES) $(VirtualBox_HEADERS)
950 $(call MSG_L1,lupdate all languages (nls/*.ts))
951 $(QUIET)$(VBOX_LUPDATE4) $^ -ts $(VirtualBox_QT_TRANSLATIONS) nls/VirtualBox_xx_YY.ts
952
953
954#
955# Test targets
956#
957
958test:
959 @echo ====================
960 @echo $(VirtualBox_GENSRCS) | $(SED) -e "s/ /\n/g"
961 @echo --------------------
962 @echo $(VirtualBox_GENSRCS_REAL) | $(SED) -e "s/ /\n/g"
963 @echo ====================
964 @echo $(VirtualBox_GENHDRS) | $(SED) -e "s/ /\n/g"
965 @echo --------------------
966 @echo $(VirtualBox_GENHDRS_REAL) | $(SED) -e "s/ /\n/g"
967 @echo ====================
968
969test2:
970 @echo $(OTHER_CLEAN) | $(SED) -e "s/ /\n/g"
971
972test3:
973 @echo $(VirtualBox_HEADERS) | $(SED) -e "s/ /\n/g"
974
975testwrappers: $(WRAPPERSFILE)
976
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