VirtualBox

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

Last change on this file since 10812 was 10742, checked in by vboxsync, 16 years ago

FE/Qt4: SF folder details (add/edit) face lift.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 24.6 KB
Line 
1# $Id: Makefile.kmk 10742 2008-07-18 10:12:28Z 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
22DEPTH = ../../../..
23include $(KBUILD_PATH)/header.kmk
24
25#
26# Globals.
27#
28VBOX_VIRTUALBOX4_SRC := $(PATH_SUB_CURRENT)
29
30VBOX_WITH_REGISTRATION := 1
31
32# Ask the user to register at Sun. If this setting is disabled the user can
33# still register using the menu if desired.
34VBOX_WITH_REGISTRATION_REQUEST := 1
35
36# Show the update notifier dialog during startup. If this setting is disabled
37# the user can still update using the menu if desired.
38VBOX_WITH_UPDATE_REQUEST := 1
39
40
41# Disable the debugger for now, this is another story.
42VBOX_WITH_DEBUGGER_GUI :=
43DEFS := $(filter-out VBOX_WITH_DEBUGGER_GUI,$(DEFS))
44
45# Guess VBOX_WITH_QT4_SUN
46ifndef VBOX_WITH_QT4_SUN
47 ifndef VBOX_OSE
48 if1of ($(KBUILD_TARGET), darwin solaris win)
49 VBOX_WITH_QT4_SUN := 1
50 endif
51 endif
52endif
53
54#
55# Handmade configuration of qt4 - very annoying, this needs to
56# be cleaned up properly later some time (not important now).
57#
58ifeq ($(VBOX_PATH_QT4),)
59 ifeq ($(KBUILD_TARGET),darwin)
60 VBOX_PATH_QT4 := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
61 ifeq ($(VBOX_PATH_QT4),)
62 ifneq ($(wildcard /Library/Frameworks/QtCore.framework),)
63 # Using the global installation (for OSE).
64 VBOX_PATH_QT4 ?= /usr
65 VBOX_PATH_QT4_FRAMEWORKS ?= /Library/Frameworks
66 endif
67 endif
68 else if1of ($(KBUILD_TARGET),win)
69 VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
70 else if1of ($(KBUILD_TARGET),solaris)
71 VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
72 ifneq ($(VBOX_PATH_QT4),)
73 VBOX_WITH_QT4_SUN = 1
74 endif
75 endif
76endif
77ifeq ($(VBOX_PATH_QT4),)
78 if1of ($(USERNAME), bird)
79 # gentoo (64-bit)
80 VBOX_PATH_QT4 ?= /usr
81 VBOX_PATH_QT4_LIB ?= /usr/lib/qt4
82 endif
83endif
84VBOX_PATH_QT4 ?= /usr
85VBOX_PATH_QT4_LIB ?= $(VBOX_PATH_QT4)/lib
86
87# Hack LD_LIBRARY_PATH for stuff in tools.
88ifdef VBOX_WITH_QT4_SUN
89 if1of ($(KBUILD_TARGET), linux)
90 export LD_LIBRARY_PATH := $(VBOX_PATH_QT4_LIB):$(LD_LIBRARY_PATH)
91 endif
92endif
93
94
95ifdef VBOX_WITH_QT4_SUN
96#
97# Install our Qt DLLs / Shared Objects / Frameworks.
98#
99## @todo move to the root Makefile.kmk, and remove qt4-bin from INSTALLS below.
100 INSTALLS += qt4-bin
101 qt4-bin_MODE = 644
102 ifeq ($(KBUILD_TARGET),darwin)
103 qt4-bin_INST = $(INST_VIRTUALBOX)Contents/Frameworks/
104 qt4-bin_SOURCES = \
105 $(VBOX_PATH_QT4)/Frameworks/QtCore.framework/Versions/4/QtCore=>QtCore.framework/Versions/4/QtCore \
106 $(VBOX_PATH_QT4)/Frameworks/QtGui.framework/Versions/4/QtGui=>QtGui.framework/Versions/4/QtGui
107 else ifeq ($(KBUILD_TARGET),win)
108 qt4-bin_INST = $(INST_BIN)
109 qt4-bin_SOURCES = \
110 $(VBOX_PATH_QT4_LIB)/VBoxQtCore4.dll \
111 $(VBOX_PATH_QT4_LIB)/VBoxQtGui4.dll
112 else
113 qt4-bin_INST = $(INST_BIN)
114 qt4-bin_SOURCES = \
115 $(VBOX_PATH_QT4_LIB)/libVBoxQtCore.so.4 \
116 $(VBOX_PATH_QT4_LIB)/libVBoxQtGui.so.4
117 endif
118endif # VBOX_WITH_QT4_SUN
119
120
121# Template copy from the qt3 stuff. Appended a "4" on the
122# relevant places.
123
124#
125# Template for building Qt GUI executables.
126#
127
128TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
129USES += qt4
130TEMPLATE_VBOXQT4GUIEXE_USES = qt4
131TEMPLATE_VBOXQT4GUIEXE_QTTOOL = QT4
132TEMPLATE_VBOXQT4GUIEXE_MOCTOOL = QT4
133TEMPLATE_VBOXQT4GUIEXE_UICTOOL = QT4
134TEMPLATE_VBOXQT4GUIEXE_RCCTOOL = QT4
135TEMPLATE_VBOXQT4GUIEXE_LRCTOOL = QT4
136TEMPLATE_VBOXQT4GUIEXE_SDKS = QT4
137ifdef VBOX_WITH_QT4_SUN
138 ifneq ($(KBUILD_TARGET),darwin) ## @todo The next darwin build should also make use the prefix just to make things more uniform.
139 TEMPLATE_VBOXQT4GUIEXE_QT_PREFIX = VBox
140 endif
141endif
142TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT QT_SHARED HAVE_CONFIG_H $(ARCH_BITS_DEFS)
143TEMPLATE_VBOXQT4GUIEXE_INCS = \
144 $(VBOX_PATH_SDK)/include
145
146ifeq ($(KBUILD_TARGET),win)
147 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
148 TEMPLATE_VBOXQT4GUIEXE_DEFS += \
149 _WIN32_WINNT=0x0500 UNICODE _UNICODE \
150 QT_DLL _CRT_SECURE_NO_DEPRECATE \
151 $(QMAKE_PRL_DEFINES)
152 ## @todo VCC70 flags?
153 ifdef VBOX_USE_VCC80
154 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
155 -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
156 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
157 else
158 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
159 -nologo -Zm200 -W3 -MD -Zi -GX
160 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
161 endif
162 TEMPLATE_VBOXQT4GUIEXE_INCS += \
163 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
164 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
165 /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
166 /DELAYLOAD:oleaut32.dll
167 TEMPLATE_VBOXQT4GUIEXE_SDKS += WINPSDK
168 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
169 $(VBOX_LIBS_QT4) \
170 $(LIB_RUNTIME) \
171 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
172 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
173 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
174 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
175 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
176 TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
177
178else # the gcc guys:
179 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
180 TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
181
182 TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
183
184 TEMPLATE_VBOXQT4GUIEXE_INCS += \
185 $(LIB_SDL_INC)
186 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
187 -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
188 -Wno-long-long -fshort-wchar -fno-strict-aliasing \
189 $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
190 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
191 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
192 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
193 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
194 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
195 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
196 $(VBOX_LIBS_QT4) \
197 $(LIB_SDL) \
198 $(LIB_RUNTIME) \
199 $(LIB_REM) \
200 $(LIB_VMM)
201
202 ifeq ($(KBUILD_TARGET),linux)
203 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
204 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
205 $(VBOX_XCURSOR_LIBS)
206 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
207 $(VBOX_LIBPATH_X11)
208 else ifeq ($(KBUILD_TARGET),darwin)
209 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
210 TEMPLATE_VBOXQT4GUIEXE_LIBS +=
211 TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
212 else
213 TEMPLATE_VBOXQT4GUIEXE_INCS += \
214 $(VBOX_XCURSOR_INCS)
215 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
216 $(VBOX_XCURSOR_LIBS) \
217 Xext \
218 X11 \
219 m \
220 $(LIB_PTHREAD)
221 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
222 $(VBOX_LIBPATH_X11)
223 ifeq ($(KBUILD_TARGET),freebsd)
224 TEMPLATE_VBOXQT4GUIEXE_INCS += \
225 /usr/include \
226 /usr/X11R6/include \
227 /usr/local/include
228 endif
229 ifeq ($(KBUILD_TARGET),solaris)
230 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
231 rt socket nsl
232 endif
233 ifdef VBOX_WITH_ORIGIN
234 # Assume the Qt shared objects are in the same directory as the executable, on Solaris too.
235 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)'
236 endif
237 endif
238
239endif
240
241# Add COM/XPCOM stuff
242TEMPLATE_VBOXQT4GUIEXE_LIBS += \
243 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
244ifdef VBOX_WITH_XPCOM
245 ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM.
246 TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
247 TEMPLATE_VBOXQT4GUIEXE_INCS += \
248 $(VBOX_XPCOM_INCS)
249 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
250 $(LIB_XPCOM)
251endif
252
253#
254# Template for building Qt GUI components.
255#
256TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
257TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQTGUIEXE
258TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
259ifeq ($(KBUILD_TARGET),darwin)
260 TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS))
261endif
262ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
263 ifneq ($(KBUILD_TARGET),win)
264 TEMPLATE_VBOXQT4GUI_DEFS = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
265 TEMPLATE_VBOXQT4GUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
266 TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
267 TEMPLATE_VBOXQT4GUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
268 endif
269endif
270
271
272#
273# The targets.
274#
275PROGRAMS += VirtualBox4
276ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
277 DLLS += VBoxKeyboard
278 ## @todo convert to install target.
279 OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
280 CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
281endif
282INSTALLS += VirtualBox4.nls
283
284
285#
286# VBoxKeyboard - keyboard library for X11.
287#
288VBoxKeyboard_TEMPLATE = VBOXR3
289VBoxKeyboard_SOURCES = \
290 src/linux/keyboard-new.c
291VBoxKeyboard_LIBS = X11
292VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
293
294
295#
296# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
297# redistributed with usable sources.
298#
299# This rule will link create a temporary symlink to src/linux/ and tar
300# up the selected files into a tarball that is installed into the
301# bin directory (probably belongs in /usr/shared/somewhere really,
302# but wtf, it's not like we're even trying to be FHS compliant).
303#
304## @todo this should be tar'ed down into the output directory and installed using an install target.
305$(PATH_BIN)/vboxkeyboard.tar.gz: \
306 $(VBoxKeyboard_SOURCES) \
307 src/linux/COPYING.LIB \
308 src/linux/keyboard.h \
309 src/linux/keyboard-layouts.h \
310 src/linux/keyboard-list.h \
311 src/linux/keyboard-tables.h \
312 src/linux/keyboard-types.h \
313 src/linux/Makefile
314 $(call MSG_TOOL,tar/gzip,,$@)
315 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard $@
316 $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/linux/ $(PATH_TARGET)/vboxkeyboard
317 $(QUIET)cd $(PATH_TARGET) \
318 && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
319 | gzip - > $@
320 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard
321
322
323#
324# Include Qt project file, we'll use FORMS and TRANSLATIONS in
325# the VirtualBox4 setup below.
326#
327SAVED_TEMPLATE := $(TEMPLATE)
328include $(PATH_SUB_CURRENT)/VBoxUI.pro
329
330
331#
332# VirtualBox4 - The GUI program.
333#
334VirtualBox4_TEMPLATE = VBOXQT4GUIEXE
335VirtualBox4_NAME = VirtualBox
336VirtualBox4_SDKS.win = WINPSDK DXSDK
337ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
338 VirtualBox4_SDKS += LIBSDL
339endif
340
341ifeq ($(KBUILD_TARGET),darwin)
342 # For the launch trick we need different inode numbers.
343 VirtualBox4_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
344
345 # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
346 ifdef VBOX_WITH_ICHAT_THEATER
347 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
348 endif
349endif # darwin
350
351VirtualBox4_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
352VirtualBox4_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
353VirtualBox4_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
354VirtualBox4_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
355VirtualBox4_DEFS.linux = VBOX_GUI_USE_SDL
356VirtualBox4_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
357VirtualBox4_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
358VirtualBox4_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
359VirtualBox4_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
360VirtualBox4_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
361#ifndef VBOX_OSE
362## @todo VBOX_WITH_HACKED_QT doesn't apply to Qt4, so why is this still here?
363 VirtualBox4_DEFS.darwin += VBOX_WITH_HACKED_QT
364#endif
365ifdef VBOX_WITH_ICHAT_THEATER
366 VirtualBox4_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
367endif
368ifneq ($(KBUILD_TYPE),release)
369 # non-release builds has some extra features.
370 VirtualBox4_DEFS.win += VBOX_GUI_USE_DDRAW
371 VirtualBox4_DEFS.linux += VBOX_GUI_USE_QIMAGE
372endif
373ifdef VBOX_WITH_REGISTRATION
374 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION
375endif
376ifdef VBOX_WITH_REGISTRATION_REQUEST
377 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION_REQUEST
378endif
379ifdef VBOX_WITH_UPDATE_REQUEST
380 VirtualBox4_DEFS += VBOX_WITH_UPDATE_REQUEST
381endif
382ifdef VBOX_WITH_ALSA
383 VirtualBox4_DEFS += VBOX_WITH_ALSA
384endif
385ifdef VBOX_WITH_PULSE
386 VirtualBox4_DEFS += VBOX_WITH_PULSE
387endif
388ifdef VBOX_WITH_E1000
389 VirtualBox4_DEFS += VBOX_WITH_E1000
390endif
391ifdef VBOX_OSE
392 VirtualBox4_DEFS += VBOX_OSE
393endif
394ifdef VBOX_WITH_DEBUGGER_GUI
395 VirtualBox4_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
396endif
397
398VirtualBox4_INCS = \
399 ./include \
400 $(PATH_VirtualBox4)/include
401
402ifeq ($(KBUILD_TYPE),release)
403 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
404else
405 VirtualBox4_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
406 ifeq ($(USERNAME),dmik)
407 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
408 else
409 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:console
410 endif
411endif
412# r=bird: what is -lz doing here? it belongs in LIBS
413VirtualBox4_LDFLAGS.darwin = -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -lz
414ifdef VBOX_WITH_ICHAT_THEATER
415 VirtualBox4_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
416endif
417VirtualBox4_LIBS.win = \
418 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
419 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
420 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
421ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
422 VirtualBox4_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
423endif
424
425ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
426 ifeq ($(KBUILD_TARGET),win)
427 VirtualBox4_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
428 else
429 VirtualBox4_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
430 endif
431endif
432
433
434# Headers containing definitions of classes that use the Q_OBJECT macro.
435VirtualBox4_QT_MOCHDRS = \
436 include/QIWidgetValidator.h \
437 include/QIHotKeyEdit.h \
438 include/QIStatusBar.h \
439 include/QIStateIndicator.h \
440 include/QIMessageBox.h \
441 include/QILabel.h \
442 include/QILabel_p.h \
443 include/QILabelSeparator.h \
444 include/QIAbstractWizard.h \
445 include/QIListView.h \
446 include/QITreeWidget.h \
447 include/QIMainDialog.h \
448 include/QIHelpButton.h \
449 include/VBoxFilePathSelectorWidget.h \
450 include/VBoxUtils.h \
451 include/VBoxGlobalSettings.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/VBoxUpdateDlg.h \
468 include/VBoxSnapshotDetailsDlg.h \
469 include/VBoxVMInformationDlg.h \
470 include/VBoxTakeSnapshotDlg.h \
471 include/VBoxSnapshotsWgt.h \
472 include/VBoxVMLogViewer.h \
473 include/VBoxDiskImageManagerDlg.h \
474 include/VBoxSettingsUtils.h \
475 include/VBoxVMSettingsGeneral.h \
476 include/VBoxVMSettingsHD.h \
477 include/VBoxVMSettingsCD.h \
478 include/VBoxVMSettingsFD.h \
479 include/VBoxVMSettingsAudio.h \
480 include/VBoxVMSettingsNetwork.h \
481 include/VBoxVMSettingsSerial.h \
482 include/VBoxVMSettingsParallel.h \
483 include/VBoxVMSettingsUSB.h \
484 include/VBoxVMSettingsUSBFilterDetails.h \
485 include/VBoxVMSettingsSF.h \
486 include/VBoxVMSettingsSFDetails.h \
487 include/VBoxVMSettingsVRDP.h \
488 include/VBoxGLSettingsGeneral.h \
489 include/VBoxGLSettingsInput.h \
490 include/VBoxGLSettingsUpdate.h \
491 include/VBoxGLSettingsLanguage.h \
492 include/VBoxSettingsDialog.h \
493 include/VBoxSettingsDialogSpecific.h \
494 include/VBoxSettingsPage.h \
495 include/VBoxSettingsSelector.h
496
497# Sources containing local definitions of classes that use the Q_OBJECT macro.
498VirtualBox4_QT_MOCSRCS = \
499 src/VBoxSelectorWnd.cpp
500ifdef VBOX_WITH_XPCOM
501 VirtualBox4_QT_MOCSRCS += \
502 src/COMDefs.cpp
503endif
504
505VirtualBox4_SOURCES = \
506 src/main.cpp \
507 src/COMDefs.cpp \
508 src/QIWidgetValidator.cpp \
509 src/QIHotKeyEdit.cpp \
510 src/QIStateIndicator.cpp \
511 src/QIStatusBar.cpp \
512 src/QIMessageBox.cpp \
513 src/QILabel.cpp \
514 src/QILabelSeparator.cpp \
515 src/QIAbstractWizard.cpp \
516 src/QIDialog.cpp \
517 src/QIDialogButtonBox.cpp \
518 src/QIListView.cpp \
519 src/QITreeWidget.cpp \
520 src/QIMainDialog.cpp \
521 src/QILineEdit.cpp \
522 src/QIHelpButton.cpp \
523 src/VBoxFilePathSelectorWidget.cpp \
524 src/VBoxDefs.cpp \
525 src/VBoxGlobalSettings.cpp \
526 src/VBoxGlobal.cpp \
527 src/VBoxMediaComboBox.cpp \
528 src/VBoxProblemReporter.cpp \
529 src/VBoxSelectorWnd.cpp \
530 src/VBoxConsoleView.cpp \
531 src/VBoxConsoleWnd.cpp \
532 src/VBoxDownloaderWgt.cpp \
533 src/VBoxVMListView.cpp \
534 src/VBoxFrameBuffer.cpp \
535 src/HappyHttp.cpp \
536 src/VBoxNetworkFramework.cpp \
537 src/VBoxAboutDlg.cpp \
538 src/VBoxCloseVMDlg.cpp \
539 src/VBoxNewVMWzd.cpp \
540 src/VBoxNewHDWzd.cpp \
541 src/VBoxVMFirstRunWzd.cpp \
542 src/VBoxRegistrationDlg.cpp \
543 src/VBoxUpdateDlg.cpp \
544 src/VBoxSnapshotDetailsDlg.cpp \
545 src/VBoxVMInformationDlg.cpp \
546 src/VBoxTakeSnapshotDlg.cpp \
547 src/VBoxSnapshotsWgt.cpp \
548 src/VBoxVMLogViewer.cpp \
549 src/VBoxDiskImageManagerDlg.cpp \
550 src/VBoxVMSettingsGeneral.cpp \
551 src/VBoxVMSettingsHD.cpp \
552 src/VBoxVMSettingsCD.cpp \
553 src/VBoxVMSettingsFD.cpp \
554 src/VBoxVMSettingsAudio.cpp \
555 src/VBoxVMSettingsNetwork.cpp \
556 src/VBoxVMSettingsSerial.cpp \
557 src/VBoxVMSettingsParallel.cpp \
558 src/VBoxVMSettingsUSB.cpp \
559 src/VBoxVMSettingsUSBFilterDetails.cpp \
560 src/VBoxVMSettingsSF.cpp \
561 src/VBoxVMSettingsSFDetails.cpp \
562 src/VBoxVMSettingsVRDP.cpp \
563 src/VBoxGLSettingsGeneral.cpp \
564 src/VBoxGLSettingsInput.cpp \
565 src/VBoxGLSettingsUpdate.cpp \
566 src/VBoxGLSettingsLanguage.cpp \
567 src/VBoxSettingsDialog.cpp \
568 src/VBoxSettingsDialogSpecific.cpp \
569 src/VBoxSettingsSelector.cpp
570
571ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
572 ifndef VBOX_OSE
573 VirtualBox4_QT_MOCHDRS += \
574 include/VBoxLicenseViewer.h
575 VirtualBox4_SOURCES += \
576 src/VBoxLicenseViewer.cpp
577 endif
578 VirtualBox4_SOURCES += \
579 src/linux/XKeyboard-new.cpp
580endif
581
582VirtualBox4_SOURCES.win += \
583 src/VBoxFBDDRAW.cpp \
584 $(PATH_TARGET)/VirtualBox4.rc
585
586VirtualBox4_SOURCES.darwin = \
587 src/darwin/DarwinKeyboard.cpp \
588 src/darwin/DarwinCursor.cpp \
589 src/darwin/VBoxUtils-darwin.cpp \
590 src/VBoxFBQuartz2D.cpp
591# src/darwin/VBoxAquaStyle.cpp
592
593ifdef VBOX_WITH_ICHAT_THEATER
594 VirtualBox4_SOURCES.darwin += \
595 src/darwin/VBoxIChatTheaterWrapper.m
596endif
597
598# The Qt modules we're using.
599# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
600VirtualBox4_QT_MODULES = Core Gui
601
602# Import QDesigner UI sources and translations from VBoxUI.pro.
603# Note that the OSE about dialog is always required by lupdate/lrelease.
604ifndef VBOX_WITH_REGISTRATION
605 FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
606endif
607VirtualBox4_SOURCES := \
608 $(VirtualBox4_SOURCES) \
609 $(FORMS) \
610 ui/VBoxAboutDlg.ui
611
612# Resource files with some OSE differences.
613VirtualBox4_SOURCES += VirtualBox.qrc
614ifdef VBOX_OSE
615 VirtualBox4_SOURCES += VirtualBox_OSE.qrc
616else
617 VirtualBox4_SOURCES += VirtualBox_NonOSE.qrc
618 VirtualBox4_SOURCES += src/VBoxAboutNonOSEDlg.cpp
619 VirtualBox4_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
620endif
621VirtualBox_OSE.qrc_RCCFLAGS = -name OSE
622VirtualBox_NonOSE.qrc_RCCFLAGS = -name NonOSE
623
624
625# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
626VirtualBox4_QT_TRANSLATIONS := $(TRANSLATIONS) \
627 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS)))
628# Compress the translation units.
629VirtualBox4_LRCFLAGS = -compress
630# Where to install the translations (a separate install target, VirtualBox4-nls-inst is created).
631VirtualBox4_QT_TRANSLATIONS_INST = $(INST_BIN)nls/
632
633
634
635# Some flag hacks (should go away).
636ifneq ($(KBUILD_TARGET),win)
637 src/HappyHttp.cpp_CXXFLAGS += -fexceptions
638 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
639 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
640endif
641src/HappyHttp.cpp_CXXFLAGS.linux += -O2
642
643## @todo how to detect what tool is used?
644## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
645# more generic -Wno-extra
646# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
647ifdef VBOX_WITH_XPCOM
648 src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
649endif
650
651
652
653#
654# On Windows we'll have to generate/edit the resource file.
655# The IDI_ICON1 name is Qt specific.
656#
657$(PATH_TARGET)/VirtualBox4.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
658 $(RM) -f $@
659 $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
660
661VirtualBox4_CLEAN.win += $(PATH_TARGET)/VirtualBox4.rc
662
663
664#
665# Other stuff.
666#
667VBOX_WRAPPERS_FILE4 = $(PATH_VirtualBox4)/include/COMWrappers.h
668VirtualBox4_BLDDIRS += $(PATH_VirtualBox4)/include/
669VirtualBox4_INTERMEDIATES = $(VBOX_WRAPPERS_FILE4)
670
671VBOX_WRAPPERS_INC_FILE4 = include/COMDefs.h
672VBOX_WRAPPERS_TEMPLATE4 = include/COMWrappers.xsl
673VBOX_WRAPPERS_XIDLFILE4 = ../../Main/idl/VirtualBox.xidl
674
675
676
677# generated files we need to clean manually
678OTHER_CLEAN = \
679 $(VirtualBox4_GENSRCS) \
680 $(VirtualBox4_GENHDRS) \
681 $(VBOX_WRAPPERS_FILE4) \
682 $(PATH_BIN)/vboxkeyboard.tar.gz
683
684
685#
686# On OS X (darwin) we need to install icon resources and compulsory bundle contents.
687# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
688#
689INSTALLS.darwin += VirtualBox.app
690VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
691VirtualBox.app_MODE = 644
692VirtualBox.app_SOURCES = \
693 src/darwin/PkgInfo \
694 $(PATH_TARGET)/Info.plist \
695 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
696
697$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
698 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
699 $(QUIET)$(RM) -f $@
700 $(QUIET)$(SED) \
701 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
702 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
703 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
704 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
705 $< > $@
706
707INSTALLS.darwin += VirtualBoxVM.app
708VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
709VirtualBoxVM.app_MODE = 644
710VirtualBoxVM.app_SOURCES = \
711 src/darwin/VM-PkgInfo=>PkgInfo \
712 $(PATH_TARGET)/VM-Info.plist=>Info.plist \
713 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
714VirtualBoxVM.app_SYMLINKS = \
715 MacOS=>../../../MacOS/
716
717$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
718 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
719 $(QUIET)$(RM) -f $@
720 $(QUIET)$(SED) \
721 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
722 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
723 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
724 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
725 --output $@ $<
726
727#
728# Testcase for the darwin keyboard routines.
729#
730ifdef VBOX_WITH_TESTCASES
731PROGRAMS.darwin += tstDarwinKeyboard4
732tstDarwinKeyboard4_NAME = tstDarwinKeyboard
733tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
734tstDarwinKeyboard4_INCS = include
735tstDarwinKeyboard4_SOURCES = \
736 src/darwin/tstDarwinKeyboard.cpp \
737 src/darwin/DarwinKeyboard.cpp
738tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
739tstDarwinKeyboard4_LIBS = \
740 $(LIB_RUNTIME)
741endif
742
743
744#
745# Install the license file. Belongs in the root makefile really.
746#
747# Note: I'm doing this right here because the GUI will _not_ run
748# without that file which might be annoying for developers!
749#
750ifndef VBOX_OSE
751ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),)
752$(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
753 $(call MSG_GENERATE,,$@)
754 $(QUIET)$(CP) $< $@
755
756$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
757endif
758endif
759
760
761
762# Unset everything that was loaded from VBoxUI.pro.
763TEMPLATE := $(SAVED_TEMPLATE)
764SAVED_TEMPLATE :=
765LANGUAGE :=
766FORMS :=
767TRANSLATIONS :=
768IMAGES :=
769
770
771# Commit the magic.
772# (note: before custom rules that make usage of generated variables!).
773include $(KBUILD_PATH)/footer.kmk
774
775
776#
777# Generate the COM wrappers.
778#
779$(VBOX_WRAPPERS_INC_FILE4): $(VBOX_WRAPPERS_FILE4)
780
781$(VBOX_WRAPPERS_FILE4): $(VBOX_WRAPPERS_XIDLFILE4) $(VBOX_WRAPPERS_TEMPLATE4) | $(call DIRDEP,$(PATH_VirtualBox4)/include/)
782 $(call MSG_TOOL,xsltproc,VirtualBox4,$<,$@)
783 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_WRAPPERS_TEMPLATE4) $<
784
785# alias for generating the COM Wrappers file.
786testwrappers:: $(VBOX_WRAPPERS_FILE4)
787
788
789#
790# Update all known NLS translation (.ts) files in the nls/ subdirectory.
791#
792# NOTE: This target is intended to be run only by the GUI maintainer shortly
793# before a new product release. VirtualBox_xx_YY.ts is a template for new
794# languages and should never be actually translated or installed.
795#
796updatenls:: \
797 $(filter-out %.qrc,$(VirtualBox4_SOURCES)) \
798 $(wildcard include/*.h)
799 $(call MSG_L1,lupdate all languages (nls/*.ts))
800 $(QUIET)$(TOOL_QT4_LUPDATE) \
801 $^ \
802 -ts \
803 $(filter-out nls/qt_%.ts,$(VirtualBox4_QT_TRANSLATIONS)) \
804 nls/VirtualBox_xx_YY.ts
805
806
807
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