VirtualBox

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

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

Darwin: Set the dylib version to the VBox version (helps reading crash dumps). Whitespace adjustments in the xpcom makefile.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 24.7 KB
Line 
1# $Id: Makefile.kmk 11482 2008-08-19 12:22:48Z 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 Xext
207 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
208 $(VBOX_LIBPATH_X11)
209 else ifeq ($(KBUILD_TARGET),darwin)
210 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
211 TEMPLATE_VBOXQT4GUIEXE_LIBS +=
212 TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
213 else
214 TEMPLATE_VBOXQT4GUIEXE_INCS += \
215 $(VBOX_XCURSOR_INCS)
216 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
217 $(VBOX_XCURSOR_LIBS) \
218 Xext \
219 X11 \
220 m \
221 $(LIB_PTHREAD)
222 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
223 $(VBOX_LIBPATH_X11)
224 ifeq ($(KBUILD_TARGET),freebsd)
225 TEMPLATE_VBOXQT4GUIEXE_INCS += \
226 /usr/include \
227 /usr/X11R6/include \
228 /usr/local/include
229 endif
230 ifeq ($(KBUILD_TARGET),solaris)
231 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
232 rt socket nsl
233 endif
234 endif
235 ifdef VBOX_WITH_ORIGIN
236 # Assume the Qt shared objects are in the same directory as the executable, on Solaris too.
237 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)'
238 endif
239
240endif
241
242# Add COM/XPCOM stuff
243TEMPLATE_VBOXQT4GUIEXE_LIBS += \
244 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
245ifdef VBOX_WITH_XPCOM
246 ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM.
247 TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
248 TEMPLATE_VBOXQT4GUIEXE_INCS += \
249 $(VBOX_XPCOM_INCS)
250 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
251 $(LIB_XPCOM)
252endif
253
254#
255# Template for building Qt GUI components.
256#
257TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
258TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQTGUIEXE
259TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
260ifeq ($(KBUILD_TARGET),darwin)
261 TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)) \
262 -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
263endif
264ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
265 ifneq ($(KBUILD_TARGET),win)
266 TEMPLATE_VBOXQT4GUI_DEFS = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
267 TEMPLATE_VBOXQT4GUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
268 TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
269 TEMPLATE_VBOXQT4GUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
270 endif
271endif
272
273
274#
275# The targets.
276#
277PROGRAMS += VirtualBox4
278ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
279 DLLS += VBoxKeyboard
280 ## @todo convert to install target.
281 OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
282 CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
283endif
284INSTALLS += VirtualBox4.nls
285
286
287#
288# VBoxKeyboard - keyboard library for X11.
289#
290VBoxKeyboard_TEMPLATE = VBOXR3
291VBoxKeyboard_SOURCES = \
292 src/linux/keyboard-new.c
293VBoxKeyboard_LIBS = X11
294VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
295
296
297#
298# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
299# redistributed with usable sources.
300#
301# This rule will link create a temporary symlink to src/linux/ and tar
302# up the selected files into a tarball that is installed into the
303# bin directory (probably belongs in /usr/shared/somewhere really,
304# but wtf, it's not like we're even trying to be FHS compliant).
305#
306## @todo this should be tar'ed down into the output directory and installed using an install target.
307$(PATH_BIN)/vboxkeyboard.tar.gz: \
308 $(VBoxKeyboard_SOURCES) \
309 src/linux/COPYING.LIB \
310 src/linux/keyboard.h \
311 src/linux/keyboard-layouts.h \
312 src/linux/keyboard-list.h \
313 src/linux/keyboard-tables.h \
314 src/linux/keyboard-types.h \
315 src/linux/Makefile
316 $(call MSG_TOOL,tar/gzip,,$@)
317 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard $@
318 $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/linux/ $(PATH_TARGET)/vboxkeyboard
319 $(QUIET)cd $(PATH_TARGET) \
320 && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
321 | gzip - > $@
322 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard
323
324
325#
326# Include Qt project file, we'll use FORMS and TRANSLATIONS in
327# the VirtualBox4 setup below.
328#
329SAVED_TEMPLATE := $(TEMPLATE)
330include $(PATH_SUB_CURRENT)/VBoxUI.pro
331
332
333#
334# VirtualBox4 - The GUI program.
335#
336VirtualBox4_TEMPLATE = VBOXQT4GUIEXE
337VirtualBox4_NAME = VirtualBox
338VirtualBox4_SDKS.win = WINPSDK DXSDK
339ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
340 VirtualBox4_SDKS += LIBSDL
341endif
342
343ifeq ($(KBUILD_TARGET),darwin)
344 # For the launch trick we need different inode numbers.
345 VirtualBox4_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
346
347 # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
348 ifdef VBOX_WITH_ICHAT_THEATER
349 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
350 endif
351endif # darwin
352
353VirtualBox4_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
354VirtualBox4_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
355VirtualBox4_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
356VirtualBox4_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
357VirtualBox4_DEFS.linux = VBOX_GUI_USE_SDL
358VirtualBox4_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
359VirtualBox4_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
360VirtualBox4_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
361VirtualBox4_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
362VirtualBox4_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
363#ifndef VBOX_OSE
364## @todo VBOX_WITH_HACKED_QT doesn't apply to Qt4, so why is this still here?
365 VirtualBox4_DEFS.darwin += VBOX_WITH_HACKED_QT
366#endif
367ifdef VBOX_WITH_ICHAT_THEATER
368 VirtualBox4_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
369endif
370ifneq ($(KBUILD_TYPE),release)
371 # non-release builds has some extra features.
372 VirtualBox4_DEFS.win += VBOX_GUI_USE_DDRAW
373 VirtualBox4_DEFS.linux += VBOX_GUI_USE_QIMAGE
374endif
375ifdef VBOX_WITH_REGISTRATION
376 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION
377endif
378ifdef VBOX_WITH_REGISTRATION_REQUEST
379 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION_REQUEST
380endif
381ifdef VBOX_WITH_UPDATE_REQUEST
382 VirtualBox4_DEFS += VBOX_WITH_UPDATE_REQUEST
383endif
384ifdef VBOX_WITH_ALSA
385 VirtualBox4_DEFS += VBOX_WITH_ALSA
386endif
387ifdef VBOX_WITH_PULSE
388 VirtualBox4_DEFS += VBOX_WITH_PULSE
389endif
390ifdef VBOX_WITH_E1000
391 VirtualBox4_DEFS += VBOX_WITH_E1000
392endif
393ifdef VBOX_OSE
394 VirtualBox4_DEFS += VBOX_OSE
395endif
396ifdef VBOX_WITH_DEBUGGER_GUI
397 VirtualBox4_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
398endif
399
400VirtualBox4_INCS = \
401 ./include \
402 $(PATH_VirtualBox4)/include
403
404ifeq ($(KBUILD_TYPE),release)
405 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
406else
407 VirtualBox4_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
408 ifeq ($(USERNAME),dmik)
409 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
410 else
411 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:console
412 endif
413endif
414# r=bird: what is -lz doing here? it belongs in LIBS
415VirtualBox4_LDFLAGS.darwin = -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -lz
416ifdef VBOX_WITH_ICHAT_THEATER
417 VirtualBox4_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
418endif
419VirtualBox4_LIBS.win = \
420 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
421 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
422 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
423ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
424 VirtualBox4_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
425endif
426
427ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
428 ifeq ($(KBUILD_TARGET),win)
429 VirtualBox4_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
430 else
431 VirtualBox4_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
432 endif
433endif
434
435
436# Headers containing definitions of classes that use the Q_OBJECT macro.
437VirtualBox4_QT_MOCHDRS = \
438 include/QIWidgetValidator.h \
439 include/QIHotKeyEdit.h \
440 include/QIStatusBar.h \
441 include/QIStateIndicator.h \
442 include/QIMessageBox.h \
443 include/QILabel.h \
444 include/QILabel_p.h \
445 include/QILabelSeparator.h \
446 include/QIAbstractWizard.h \
447 include/QIListView.h \
448 include/QITreeWidget.h \
449 include/QIMainDialog.h \
450 include/QIHelpButton.h \
451 include/QIDialog.h \
452 include/VBoxFilePathSelectorWidget.h \
453 include/VBoxUtils.h \
454 include/VBoxGlobalSettings.h \
455 include/VBoxGlobal.h \
456 include/VBoxVMListView.h \
457 include/VBoxMediaComboBox.h \
458 include/VBoxSelectorWnd.h \
459 include/VBoxConsoleWnd.h \
460 include/VBoxConsoleView.h \
461 include/VBoxProblemReporter.h \
462 include/VBoxDownloaderWgt.h \
463 include/VBoxNetworkFramework.h \
464 include/VBoxAboutDlg.h \
465 include/VBoxCloseVMDlg.h \
466 include/VBoxNewVMWzd.h \
467 include/VBoxNewHDWzd.h \
468 include/VBoxVMFirstRunWzd.h \
469 include/VBoxRegistrationDlg.h \
470 include/VBoxUpdateDlg.h \
471 include/VBoxSnapshotDetailsDlg.h \
472 include/VBoxVMInformationDlg.h \
473 include/VBoxTakeSnapshotDlg.h \
474 include/VBoxSnapshotsWgt.h \
475 include/VBoxVMLogViewer.h \
476 include/VBoxDiskImageManagerDlg.h \
477 include/VBoxSettingsUtils.h \
478 include/VBoxVMSettingsGeneral.h \
479 include/VBoxVMSettingsHD.h \
480 include/VBoxVMSettingsCD.h \
481 include/VBoxVMSettingsFD.h \
482 include/VBoxVMSettingsAudio.h \
483 include/VBoxVMSettingsNetwork.h \
484 include/VBoxVMSettingsSerial.h \
485 include/VBoxVMSettingsParallel.h \
486 include/VBoxVMSettingsUSB.h \
487 include/VBoxVMSettingsUSBFilterDetails.h \
488 include/VBoxVMSettingsSF.h \
489 include/VBoxVMSettingsSFDetails.h \
490 include/VBoxVMSettingsVRDP.h \
491 include/VBoxGLSettingsGeneral.h \
492 include/VBoxGLSettingsInput.h \
493 include/VBoxGLSettingsUpdate.h \
494 include/VBoxGLSettingsLanguage.h \
495 include/VBoxSettingsDialog.h \
496 include/VBoxSettingsDialogSpecific.h \
497 include/VBoxSettingsPage.h \
498 include/VBoxSettingsSelector.h
499
500# Sources containing local definitions of classes that use the Q_OBJECT macro.
501VirtualBox4_QT_MOCSRCS = \
502 src/VBoxSelectorWnd.cpp \
503 src/VBoxDiskImageManagerDlg.cpp
504ifdef VBOX_WITH_XPCOM
505 VirtualBox4_QT_MOCSRCS += \
506 src/COMDefs.cpp
507endif
508
509VirtualBox4_SOURCES = \
510 src/main.cpp \
511 src/COMDefs.cpp \
512 src/QIWidgetValidator.cpp \
513 src/QIHotKeyEdit.cpp \
514 src/QIStateIndicator.cpp \
515 src/QIStatusBar.cpp \
516 src/QIMessageBox.cpp \
517 src/QILabel.cpp \
518 src/QILabelSeparator.cpp \
519 src/QIAbstractWizard.cpp \
520 src/QIDialog.cpp \
521 src/QIDialogButtonBox.cpp \
522 src/QIListView.cpp \
523 src/QITreeWidget.cpp \
524 src/QIMainDialog.cpp \
525 src/QILineEdit.cpp \
526 src/QIHelpButton.cpp \
527 src/VBoxFilePathSelectorWidget.cpp \
528 src/VBoxDefs.cpp \
529 src/VBoxGlobalSettings.cpp \
530 src/VBoxGlobal.cpp \
531 src/VBoxMediaComboBox.cpp \
532 src/VBoxProblemReporter.cpp \
533 src/VBoxSelectorWnd.cpp \
534 src/VBoxConsoleView.cpp \
535 src/VBoxConsoleWnd.cpp \
536 src/VBoxDownloaderWgt.cpp \
537 src/VBoxVMListView.cpp \
538 src/VBoxFrameBuffer.cpp \
539 src/HappyHttp.cpp \
540 src/VBoxNetworkFramework.cpp \
541 src/VBoxAboutDlg.cpp \
542 src/VBoxCloseVMDlg.cpp \
543 src/VBoxNewVMWzd.cpp \
544 src/VBoxNewHDWzd.cpp \
545 src/VBoxVMFirstRunWzd.cpp \
546 src/VBoxRegistrationDlg.cpp \
547 src/VBoxUpdateDlg.cpp \
548 src/VBoxSnapshotDetailsDlg.cpp \
549 src/VBoxVMInformationDlg.cpp \
550 src/VBoxTakeSnapshotDlg.cpp \
551 src/VBoxSnapshotsWgt.cpp \
552 src/VBoxVMLogViewer.cpp \
553 src/VBoxDiskImageManagerDlg.cpp \
554 src/VBoxVMSettingsGeneral.cpp \
555 src/VBoxVMSettingsHD.cpp \
556 src/VBoxVMSettingsCD.cpp \
557 src/VBoxVMSettingsFD.cpp \
558 src/VBoxVMSettingsAudio.cpp \
559 src/VBoxVMSettingsNetwork.cpp \
560 src/VBoxVMSettingsSerial.cpp \
561 src/VBoxVMSettingsParallel.cpp \
562 src/VBoxVMSettingsUSB.cpp \
563 src/VBoxVMSettingsUSBFilterDetails.cpp \
564 src/VBoxVMSettingsSF.cpp \
565 src/VBoxVMSettingsSFDetails.cpp \
566 src/VBoxVMSettingsVRDP.cpp \
567 src/VBoxGLSettingsGeneral.cpp \
568 src/VBoxGLSettingsInput.cpp \
569 src/VBoxGLSettingsUpdate.cpp \
570 src/VBoxGLSettingsLanguage.cpp \
571 src/VBoxSettingsDialog.cpp \
572 src/VBoxSettingsDialogSpecific.cpp \
573 src/VBoxSettingsSelector.cpp
574
575ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
576 ifndef VBOX_OSE
577 VirtualBox4_QT_MOCHDRS += \
578 include/VBoxLicenseViewer.h
579 VirtualBox4_SOURCES += \
580 src/VBoxLicenseViewer.cpp
581 endif
582 VirtualBox4_SOURCES += \
583 src/linux/XKeyboard-new.cpp \
584 src/VBoxX11Helper.cpp
585endif
586
587VirtualBox4_SOURCES.win += \
588 src/VBoxFBDDRAW.cpp \
589 $(PATH_TARGET)/VirtualBox4.rc
590
591VirtualBox4_SOURCES.darwin = \
592 src/darwin/DarwinKeyboard.cpp \
593 src/darwin/DarwinCursor.cpp \
594 src/darwin/VBoxUtils-darwin.cpp \
595 src/VBoxFBQuartz2D.cpp
596# src/darwin/VBoxAquaStyle.cpp
597
598ifdef VBOX_WITH_ICHAT_THEATER
599 VirtualBox4_SOURCES.darwin += \
600 src/darwin/VBoxIChatTheaterWrapper.m
601endif
602
603# The Qt modules we're using.
604# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
605VirtualBox4_QT_MODULES = Core Gui
606
607# Import QDesigner UI sources and translations from VBoxUI.pro.
608# Note that the OSE about dialog is always required by lupdate/lrelease.
609ifndef VBOX_WITH_REGISTRATION
610 FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
611endif
612VirtualBox4_SOURCES := \
613 $(VirtualBox4_SOURCES) \
614 $(FORMS) \
615 ui/VBoxAboutDlg.ui
616
617# Resource files with some OSE differences.
618VirtualBox4_SOURCES += VirtualBox.qrc
619ifdef VBOX_OSE
620 VirtualBox4_SOURCES += VirtualBox_OSE.qrc
621else
622 VirtualBox4_SOURCES += VirtualBox_NonOSE.qrc
623 VirtualBox4_SOURCES += src/VBoxAboutNonOSEDlg.cpp
624 VirtualBox4_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
625endif
626VirtualBox_OSE.qrc_RCCFLAGS = -name OSE
627VirtualBox_NonOSE.qrc_RCCFLAGS = -name NonOSE
628
629
630# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
631VirtualBox4_QT_TRANSLATIONS := $(TRANSLATIONS) \
632 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS)))
633# Compress the translation units.
634VirtualBox4_LRCFLAGS = -compress
635# Where to install the translations (a separate install target, VirtualBox4-nls-inst is created).
636VirtualBox4_QT_TRANSLATIONS_INST = $(INST_BIN)nls/
637
638
639
640# Some flag hacks (should go away).
641ifneq ($(KBUILD_TARGET),win)
642 src/HappyHttp.cpp_CXXFLAGS += -fexceptions
643 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
644 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
645endif
646src/HappyHttp.cpp_CXXFLAGS.linux += -O2
647
648## @todo how to detect what tool is used?
649## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
650# more generic -Wno-extra
651# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
652ifdef VBOX_WITH_XPCOM
653 src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
654endif
655
656
657
658#
659# On Windows we'll have to generate/edit the resource file.
660# The IDI_ICON1 name is Qt specific.
661#
662$(PATH_TARGET)/VirtualBox4.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
663 $(RM) -f $@
664 $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
665
666VirtualBox4_CLEAN.win += $(PATH_TARGET)/VirtualBox4.rc
667
668
669#
670# Other stuff.
671#
672VBOX_WRAPPERS_FILE4 = $(PATH_VirtualBox4)/include/COMWrappers.h
673VirtualBox4_BLDDIRS += $(PATH_VirtualBox4)/include/
674VirtualBox4_INTERMEDIATES = $(VBOX_WRAPPERS_FILE4)
675
676VBOX_WRAPPERS_INC_FILE4 = include/COMDefs.h
677VBOX_WRAPPERS_TEMPLATE4 = include/COMWrappers.xsl
678VBOX_WRAPPERS_XIDLFILE4 = ../../Main/idl/VirtualBox.xidl
679
680
681
682# generated files we need to clean manually
683OTHER_CLEAN = \
684 $(VirtualBox4_GENSRCS) \
685 $(VirtualBox4_GENHDRS) \
686 $(VBOX_WRAPPERS_FILE4) \
687 $(PATH_BIN)/vboxkeyboard.tar.gz
688
689
690#
691# On OS X (darwin) we need to install icon resources and compulsory bundle contents.
692# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
693#
694INSTALLS.darwin += VirtualBox.app
695VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
696VirtualBox.app_MODE = 644
697VirtualBox.app_SOURCES = \
698 src/darwin/PkgInfo \
699 $(PATH_TARGET)/Info.plist \
700 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
701
702$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
703 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
704 $(QUIET)$(RM) -f $@
705 $(QUIET)$(SED) \
706 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
707 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
708 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
709 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
710 $< > $@
711
712INSTALLS.darwin += VirtualBoxVM.app
713VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
714VirtualBoxVM.app_MODE = 644
715VirtualBoxVM.app_SOURCES = \
716 src/darwin/VM-PkgInfo=>PkgInfo \
717 $(PATH_TARGET)/VM-Info.plist=>Info.plist \
718 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
719VirtualBoxVM.app_SYMLINKS = \
720 MacOS=>../../../MacOS/
721
722$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
723 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
724 $(QUIET)$(RM) -f $@
725 $(QUIET)$(SED) \
726 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
727 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
728 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
729 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
730 --output $@ $<
731
732#
733# Testcase for the darwin keyboard routines.
734#
735ifdef VBOX_WITH_TESTCASES
736PROGRAMS.darwin += tstDarwinKeyboard4
737tstDarwinKeyboard4_NAME = tstDarwinKeyboard
738tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
739tstDarwinKeyboard4_INCS = include
740tstDarwinKeyboard4_SOURCES = \
741 src/darwin/tstDarwinKeyboard.cpp \
742 src/darwin/DarwinKeyboard.cpp
743tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
744tstDarwinKeyboard4_LIBS = \
745 $(LIB_RUNTIME)
746endif
747
748
749#
750# Install the license file. Belongs in the root makefile really.
751#
752# Note: I'm doing this right here because the GUI will _not_ run
753# without that file which might be annoying for developers!
754#
755ifndef VBOX_OSE
756ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),)
757$(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
758 $(call MSG_GENERATE,,$@)
759 $(QUIET)$(CP) $< $@
760
761$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
762endif
763endif
764
765
766
767# Unset everything that was loaded from VBoxUI.pro.
768TEMPLATE := $(SAVED_TEMPLATE)
769SAVED_TEMPLATE :=
770LANGUAGE :=
771FORMS :=
772TRANSLATIONS :=
773IMAGES :=
774
775
776# Commit the magic.
777# (note: before custom rules that make usage of generated variables!).
778include $(KBUILD_PATH)/footer.kmk
779
780
781#
782# Generate the COM wrappers.
783#
784$(VBOX_WRAPPERS_INC_FILE4): $(VBOX_WRAPPERS_FILE4)
785
786$(VBOX_WRAPPERS_FILE4): $(VBOX_WRAPPERS_XIDLFILE4) $(VBOX_WRAPPERS_TEMPLATE4) | $(call DIRDEP,$(PATH_VirtualBox4)/include/)
787 $(call MSG_TOOL,xsltproc,VirtualBox4,$<,$@)
788 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_WRAPPERS_TEMPLATE4) $<
789
790# alias for generating the COM Wrappers file.
791testwrappers:: $(VBOX_WRAPPERS_FILE4)
792
793
794#
795# Update all known NLS translation (.ts) files in the nls/ subdirectory.
796#
797# NOTE: This target is intended to be run only by the GUI maintainer shortly
798# before a new product release. VirtualBox_xx_YY.ts is a template for new
799# languages and should never be actually translated or installed.
800#
801updatenls:: \
802 $(filter-out %.qrc,$(VirtualBox4_SOURCES)) \
803 $(wildcard include/*.h)
804 $(call MSG_L1,lupdate all languages (nls/*.ts))
805 $(QUIET)$(TOOL_QT4_LUPDATE) \
806 $^ \
807 -ts \
808 $(filter-out nls/qt_%.ts,$(VirtualBox4_QT_TRANSLATIONS)) \
809 nls/VirtualBox_xx_YY.ts
810
811
812
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette