VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk@ 25323

Last change on this file since 25323 was 25213, checked in by vboxsync, 15 years ago

2d accel: delay loading gl dlls for win

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 26.4 KB
Line 
1# $Id: Makefile.kmk 25213 2009-12-07 15:41:35Z vboxsync $
2## @file
3# Makefile for the VirtualBox Qt GUI.
4#
5
6#
7# Copyright (C) 2006-2009 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
22SUB_DEPTH = ../../../..
23include $(KBUILD_PATH)/subheader.kmk
24
25#
26# Globals.
27#
28VBOX_VIRTUALBOX4_SRC := $(PATH_SUB_CURRENT)
29VBOX_VIRTUALBOX4_OUT_DIR := $(PATH_TARGET)/VirtualBox/misc
30
31VBOX_WITH_REGISTRATION := 1
32
33# Ask the user to register at Sun. If this setting is disabled the user can
34# still register using the menu if desired.
35VBOX_WITH_REGISTRATION_REQUEST := 1
36
37# Show the update notifier dialog during startup. If this setting is disabled
38# the user can still update using the menu if desired.
39VBOX_WITH_UPDATE_REQUEST := 1
40
41
42#
43# The targets.
44#
45ifdef VBOX_WITH_HARDENING
46PROGRAMS += VirtualBoxHardened
47DLLS += VirtualBox
48else
49PROGRAMS += VirtualBox
50endif
51
52ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
53 DLLS += VBoxKeyboard
54 ## @todo convert to install target.
55 OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
56 CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
57endif
58INSTALLS += VirtualBox.nls
59
60
61#
62# Include the language lists.
63#
64include $(PATH_SUB_CURRENT)/nls/ApprovedLanguages.kmk
65
66
67#
68# VBoxKeyboard - keyboard library for X11.
69#
70VBoxKeyboard_TEMPLATE = VBOXR3
71VBoxKeyboard_SOURCES = \
72 src/X11/keyboard-new.c
73VBoxKeyboard_LIBS = X11
74VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
75
76
77#
78# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
79# redistributed with usable sources.
80#
81# This rule will link create a temporary symlink to src/X11/ and tar
82# up the selected files into a tarball that is installed into the
83# bin directory (probably belongs in /usr/shared/somewhere really,
84# but wtf, it's not like we're even trying to be FHS compliant).
85#
86## @todo this should be tar'ed down into the output directory and installed using an install target.
87$(PATH_BIN)/vboxkeyboard.tar.gz: $(abspathex \
88 $(VBoxKeyboard_SOURCES) \
89 src/X11/COPYING.LIB \
90 src/X11/keyboard.h \
91 src/X11/keyboard-layouts.h \
92 src/X11/keyboard-list.h \
93 src/X11/keyboard-tables.h \
94 src/X11/keyboard-types.h \
95 src/X11/Makefile \
96 ,$(PATH_SUB_CURRENT)) | $(PATH_TARGET)/VBoxKeyboard/
97 $(call MSG_TOOL,tar/gzip,,$@)
98 $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard $@
99 $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/X11/ $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
100 $(QUIET)cd $(PATH_TARGET)/VBoxKeyboard \
101 && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
102 | gzip - > $@
103 $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
104
105OTHER_CLEAN += \
106 $(PATH_BIN)/vboxkeyboard.tar.gz
107
108
109#
110# Hardened VirtualBox.
111#
112VirtualBoxHardened_TEMPLATE = VBOXR3HARDENEDEXE
113VirtualBoxHardened_SOURCES = src/hardenedmain.cpp
114VirtualBoxHardened_NAME = VirtualBox
115ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
116 #VirtualBoxHardened_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
117 VirtualBoxHardened_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
118endif
119
120
121#
122# Include Qt project file, we'll use FORMS and TRANSLATIONS in
123# the VirtualBox setup below.
124#
125SAVED_TEMPLATE := $(TEMPLATE)
126include $(PATH_SUB_CURRENT)/VBoxUI.pro
127
128
129#
130# VirtualBox - The GUI program.
131#
132USES += qt4
133VirtualBox_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXQT4GUI,VBOXQT4GUIEXE)
134VirtualBox_NAME = VirtualBox
135ifndef VBOX_WITH_HARDENING # For the launch trick we need different inode numbers.
136 ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
137 #VirtualBox_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
138 VirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
139 endif
140endif
141VirtualBox_SDKS.win = WINPSDK DXSDK
142ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
143 VirtualBox_SDKS += LIBSDL
144endif
145
146ifdef VBOX_WITH_ICHAT_THEATER
147 # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
148 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
149endif
150
151VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
152VirtualBox_DEFS.debug = VBOX_CHECK_STATE # QT_FATAL_ASSERT
153VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
154ifndef VBOX_WITH_COCOA_QT
155VirtualBox_DEFS.darwin.x86= USE_HID_FOR_MODIFIERS
156endif
157VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
158VirtualBox_DEFS.linux = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
159VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
160VirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
161VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
162VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
163VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
164## @todo VBOX_WITH_HACKED_QT doesn't apply to Qt4, so why is this still here?
165VirtualBox_DEFS.darwin.x86 += VBOX_WITH_HACKED_QT
166ifdef VBOX_WITH_ICHAT_THEATER
167 VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
168endif
169ifneq ($(KBUILD_TYPE),release)
170 # non-release builds has some extra features.
171 VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
172endif
173VirtualBox_DEFS += \
174 $(if $(VBOX_WITH_REGISTRATION),VBOX_WITH_REGISTRATION) \
175 $(if $(VBOX_WITH_REGISTRATION_REQUEST),VBOX_WITH_REGISTRATION_REQUEST) \
176 $(if $(VBOX_WITH_UPDATE_REQUEST),VBOX_WITH_UPDATE_REQUEST) \
177 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA) \
178 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE) \
179 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS) \
180 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \
181 $(if $(VBOX_WITH_NETFLT)$(eq $(KBUILD_TARGET),freebsd),VBOX_WITH_NETFLT)
182ifdef VBOX_WITH_DEBUGGER_GUI
183 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI
184 if "$(KBUILD_TYPE)" != "release"
185 VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
186 endif
187endif
188ifdef VBOX_WITH_VIDEOHWACCEL
189 VirtualBox_DEFS += VBOX_WITH_VIDEOHWACCEL \
190 VBOX_GUI_USE_QGL
191else ifdef VBOX_GUI_USE_QGL
192 VirtualBox_DEFS += VBOX_GUI_USE_QGL
193endif
194ifdef VBOX_WITH_VIRTIO
195 VirtualBox_DEFS += VBOX_WITH_VIRTIO
196endif
197
198ifdef VBOX_BLEEDING_EDGE
199VirtualBox_src/VBoxConsoleWnd.cpp_DEFS += \
200 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
201VirtualBox_src/VBoxSelectorWnd.cpp_DEFS += \
202 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
203VirtualBox_src/VBoxAboutDlg.cpp_DEFS += \
204 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
205VirtualBox_src/main.cpp_DEFS += \
206 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
207endif
208
209VirtualBox_INCS = \
210 ./src \
211 ./src/globals \
212 ./src/extensions \
213 ./src/settings \
214 ./src/settings/global \
215 ./src/settings/vm \
216 ./src/wizards/newvm \
217 ./src/wizards/newhd \
218 ./src/wizards/firstrun \
219 ./src/wizards/exportappliance \
220 ./src/wizards/importappliance \
221 ./src/widgets \
222 ./src/X11 \
223 ./src/darwin \
224 $(PATH_VirtualBox)/include
225
226# Necessary for the hdd backend enumeration
227VirtualBox_LIBS = $(LIB_DDU)
228
229ifdef VBOX_WITH_VIDEOHWACCEL
230# Necessary for save state support
231VirtualBox_LIBS += $(LIB_VMM)
232endif
233ifeq ($(KBUILD_TYPE),release)
234 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
235else
236 VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
237 ifeq ($(USERNAME),dmik)
238 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
239 else
240 VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
241 endif
242endif
243
244if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
245 VirtualBox_LDFLAGS.win += /DelayLoad:QtOpenGLVBox4.dll /DelayLoad:OPENGL32.dll
246endif
247
248# r=bird: what is -lz doing here? it belongs in LIBS.
249VirtualBox_LDFLAGS.darwin = -lz \
250 -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -framework Carbon \
251 $(if $(VBOX_WITH_HARDENING),-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VirtualBox.dylib)
252VirtualBox_LDFLAGS.darwin.x86 = -framework QuickTime
253ifdef VBOX_WITH_ICHAT_THEATER
254 VirtualBox_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
255endif
256if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
257 VirtualBox_LDFLAGS.darwin += -framework OpenGL
258endif
259
260VirtualBox_LIBS.win = \
261 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
262 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
263 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
264ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
265 VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
266endif
267
268if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
269 VirtualBox_LIBS.win += $(PATH_SDK_WINPSDK_LIB)/Opengl32.lib
270 VirtualBox_LIBS.solaris += GL
271 VirtualBox_LIBS.linux += GL
272endif
273
274# Headers containing definitions of classes that use the Q_OBJECT macro.
275VirtualBox_QT_MOCHDRS = \
276 src/VBoxAboutDlg.h \
277 src/VBoxCloseVMDlg.h \
278 src/VBoxConsoleView.h \
279 src/VBoxConsoleWnd.h \
280 src/VBoxGlobalSettings.h \
281 src/VBoxMediaManagerDlg.h \
282 src/VBoxRegistrationDlg.h \
283 src/VBoxSelectorWnd.h \
284 src/VBoxSnapshotDetailsDlg.h \
285 src/VBoxSnapshotsWgt.h \
286 src/VBoxTakeSnapshotDlg.h \
287 src/VBoxUpdateDlg.h \
288 src/VBoxVMInformationDlg.h \
289 src/VBoxVMListView.h \
290 src/VBoxVMLogViewer.h \
291 src/globals/VBoxGlobal.h \
292 src/globals/VBoxProblemReporter.h \
293 src/globals/VBoxUtils.h \
294 src/extensions/QIAbstractWizard.h \
295 src/extensions/QIAdvancedSlider.h \
296 src/extensions/QIArrowButtonPress.h \
297 src/extensions/QIArrowButtonSwitch.h \
298 src/extensions/QIArrowSplitter.h \
299 src/extensions/QIDialog.h \
300 src/extensions/QIFileDialog.h \
301 src/extensions/QIHotKeyEdit.h \
302 src/extensions/QIHttp.h \
303 src/extensions/QILabel.h \
304 src/extensions/QILabelSeparator.h \
305 src/extensions/QIListView.h \
306 src/extensions/QIMainDialog.h \
307 src/extensions/QIMessageBox.h \
308 src/extensions/QIRichToolButton.h \
309 src/extensions/QISplitter.h \
310 src/extensions/QIStateIndicator.h \
311 src/extensions/QIStatusBar.h \
312 src/extensions/QIToolButton.h \
313 src/extensions/QITreeView.h \
314 src/extensions/QITreeWidget.h \
315 src/extensions/QIWidgetValidator.h \
316 src/settings/VBoxSettingsDialog.h \
317 src/settings/VBoxSettingsDialogSpecific.h \
318 src/settings/VBoxSettingsPage.h \
319 src/settings/VBoxSettingsSelector.h \
320 src/settings/global/VBoxGLSettingsGeneral.h \
321 src/settings/global/VBoxGLSettingsInput.h \
322 src/settings/global/VBoxGLSettingsUpdate.h \
323 src/settings/global/VBoxGLSettingsLanguage.h \
324 src/settings/global/VBoxGLSettingsNetwork.h \
325 src/settings/global/VBoxGLSettingsNetworkDetails.h \
326 src/settings/vm/VBoxVMSettingsGeneral.h \
327 src/settings/vm/VBoxVMSettingsSystem.h \
328 src/settings/vm/VBoxVMSettingsDisplay.h \
329 src/settings/vm/VBoxVMSettingsHD.h \
330 src/settings/vm/VBoxVMSettingsAudio.h \
331 src/settings/vm/VBoxVMSettingsNetwork.h \
332 src/settings/vm/VBoxVMSettingsSerial.h \
333 src/settings/vm/VBoxVMSettingsParallel.h \
334 src/settings/vm/VBoxVMSettingsUSB.h \
335 src/settings/vm/VBoxVMSettingsUSBFilterDetails.h \
336 src/settings/vm/VBoxVMSettingsSF.h \
337 src/settings/vm/VBoxVMSettingsSFDetails.h \
338 src/wizards/newvm/VBoxNewVMWzd.h \
339 src/wizards/newhd/VBoxNewHDWzd.h \
340 src/wizards/firstrun/VBoxVMFirstRunWzd.h \
341 src/wizards/exportappliance/VBoxExportApplianceWzd.h \
342 src/wizards/importappliance/VBoxImportApplianceWzd.h \
343 src/widgets/VBoxApplianceEditorWgt.h \
344 src/widgets/VBoxBootTable.h \
345 src/widgets/VBoxDownloaderWgt.h \
346 src/widgets/VBoxExportApplianceWgt.h \
347 src/widgets/VBoxFilePathSelectorWidget.h \
348 src/widgets/VBoxImportApplianceWgt.h \
349 src/widgets/VBoxLineTextEdit.h \
350 src/widgets/VBoxMediaComboBox.h \
351 src/widgets/VBoxMiniToolBar.h \
352 src/widgets/VBoxOSTypeSelectorButton.h \
353 src/widgets/VBoxOSTypeSelectorWidget.h \
354 src/widgets/VBoxProgressDialog.h \
355 src/widgets/VBoxSpecialControls.h \
356 src/widgets/VBoxWarningPane.h
357
358# Sources containing local definitions of classes that use the Q_OBJECT macro.
359VirtualBox_QT_MOCSRCS = \
360 src/VBoxSelectorWnd.cpp \
361 src/VBoxConsoleWnd.cpp \
362 src/VBoxMediaManagerDlg.cpp
363ifdef VBOX_WITH_XPCOM
364 VirtualBox_QT_MOCSRCS += \
365 src/globals/COMDefs.cpp
366endif
367ifeq ($(KBUILD_TARGET),win)
368VirtualBox_QT_MOCSRCS += \
369 src/extensions/QIFileDialog.cpp
370endif
371
372VirtualBox_SOURCES = \
373 src/main.cpp \
374 src/VBoxAboutDlg.cpp \
375 src/VBoxCloseVMDlg.cpp \
376 src/VBoxConsoleView.cpp \
377 src/VBoxConsoleWnd.cpp \
378 src/VBoxFrameBuffer.cpp \
379 src/VBoxGlobalSettings.cpp \
380 src/VBoxHelpActions.cpp \
381 src/VBoxMediaManagerDlg.cpp \
382 src/VBoxMedium.cpp \
383 src/VBoxRegistrationDlg.cpp \
384 src/VBoxSelectorWnd.cpp \
385 src/VBoxSnapshotDetailsDlg.cpp \
386 src/VBoxSnapshotsWgt.cpp \
387 src/VBoxTakeSnapshotDlg.cpp \
388 src/VBoxUpdateDlg.cpp \
389 src/VBoxVMInformationDlg.cpp \
390 src/VBoxVMListView.cpp \
391 src/VBoxVMLogViewer.cpp \
392 src/globals/COMDefs.cpp \
393 src/globals/VBoxDefs.cpp \
394 src/globals/VBoxGlobal.cpp \
395 src/globals/VBoxProblemReporter.cpp \
396 src/extensions/QIAbstractWizard.cpp \
397 src/extensions/QIAdvancedSlider.cpp \
398 src/extensions/QIArrowButtonPress.cpp \
399 src/extensions/QIArrowButtonSwitch.cpp \
400 src/extensions/QIArrowSplitter.cpp \
401 src/extensions/QIDialog.cpp \
402 src/extensions/QIDialogButtonBox.cpp \
403 src/extensions/QIFileDialog.cpp \
404 src/extensions/QIHotKeyEdit.cpp \
405 src/extensions/QILabel.cpp \
406 src/extensions/QILabelSeparator.cpp \
407 src/extensions/QILineEdit.cpp \
408 src/extensions/QIListView.cpp \
409 src/extensions/QIMainDialog.cpp \
410 src/extensions/QIMessageBox.cpp \
411 src/extensions/QIRichToolButton.cpp \
412 src/extensions/QISplitter.cpp \
413 src/extensions/QIStateIndicator.cpp \
414 src/extensions/QIStatusBar.cpp \
415 src/extensions/QITreeView.cpp \
416 src/extensions/QITreeWidget.cpp \
417 src/extensions/QIWidgetValidator.cpp \
418 src/settings/VBoxSettingsDialog.cpp \
419 src/settings/VBoxSettingsDialogSpecific.cpp \
420 src/settings/VBoxSettingsSelector.cpp \
421 src/settings/global/VBoxGLSettingsGeneral.cpp \
422 src/settings/global/VBoxGLSettingsInput.cpp \
423 src/settings/global/VBoxGLSettingsUpdate.cpp \
424 src/settings/global/VBoxGLSettingsLanguage.cpp \
425 src/settings/global/VBoxGLSettingsNetwork.cpp \
426 src/settings/global/VBoxGLSettingsNetworkDetails.cpp \
427 src/settings/vm/VBoxVMSettingsGeneral.cpp \
428 src/settings/vm/VBoxVMSettingsSystem.cpp \
429 src/settings/vm/VBoxVMSettingsDisplay.cpp \
430 src/settings/vm/VBoxVMSettingsHD.cpp \
431 src/settings/vm/VBoxVMSettingsAudio.cpp \
432 src/settings/vm/VBoxVMSettingsNetwork.cpp \
433 src/settings/vm/VBoxVMSettingsSerial.cpp \
434 src/settings/vm/VBoxVMSettingsParallel.cpp \
435 src/settings/vm/VBoxVMSettingsUSB.cpp \
436 src/settings/vm/VBoxVMSettingsUSBFilterDetails.cpp \
437 src/settings/vm/VBoxVMSettingsSF.cpp \
438 src/settings/vm/VBoxVMSettingsSFDetails.cpp \
439 src/wizards/newvm/VBoxNewVMWzd.cpp \
440 src/wizards/newhd/VBoxNewHDWzd.cpp \
441 src/wizards/firstrun/VBoxVMFirstRunWzd.cpp \
442 src/wizards/exportappliance/VBoxExportApplianceWzd.cpp \
443 src/wizards/importappliance/VBoxImportApplianceWzd.cpp \
444 src/widgets/VBoxApplianceEditorWgt.cpp \
445 src/widgets/VBoxBootTable.cpp \
446 src/widgets/VBoxDownloaderWgt.cpp \
447 src/widgets/VBoxExportApplianceWgt.cpp \
448 src/widgets/VBoxFilePathSelectorWidget.cpp \
449 src/widgets/VBoxGuestRAMSlider.cpp \
450 src/widgets/VBoxImportApplianceWgt.cpp \
451 src/widgets/VBoxLineTextEdit.cpp \
452 src/widgets/VBoxMediaComboBox.cpp \
453 src/widgets/VBoxMiniToolBar.cpp \
454 src/widgets/VBoxOSTypeSelectorButton.cpp \
455 src/widgets/VBoxOSTypeSelectorWidget.cpp \
456 src/widgets/VBoxProgressDialog.cpp \
457 src/widgets/VBoxSpecialControls.cpp \
458 src/widgets/VBoxWarningPane.cpp
459
460ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
461 ifndef VBOX_OSE
462 VirtualBox_QT_MOCHDRS += \
463 src/VBoxLicenseViewer.h
464 VirtualBox_SOURCES += \
465 src/VBoxLicenseViewer.cpp
466 else
467 VirtualBox_VBOX_EXTRA_NLS_SOURCES += \
468 src/VBoxLicenseViewer.h \
469 src/VBoxLicenseViewer.cpp
470 endif
471 VirtualBox_SOURCES += \
472 src/X11/XKeyboard-new.cpp \
473 src/X11/VBoxX11Helper.cpp
474else
475 VirtualBox_VBOX_EXTRA_NLS_SOURCES += \
476 src/VBoxLicenseViewer.h \
477 src/VBoxLicenseViewer.cpp
478endif
479
480VirtualBox_SOURCES.win += \
481 src/VBoxFBDDRAW.cpp \
482 src/win/VirtualBox.rc
483
484VirtualBox_SOURCES.darwin = \
485 src/darwin/DarwinKeyboard.cpp \
486 src/darwin/VBoxUtils-darwin.cpp \
487 src/darwin/AbstractDockIconPreview.cpp \
488 src/VBoxFBQuartz2D.cpp
489
490ifdef VBOX_WITH_ICHAT_THEATER
491 VirtualBox_SOURCES.darwin += \
492 src/darwin/VBoxIChatTheaterWrapper.m
493endif
494
495ifdef VBOX_WITH_COCOA_QT
496 VirtualBox_DEFS += VBOX_DARWIN_USE_NATIVE_CONTROLS
497 VirtualBox_SOURCES.darwin += \
498 src/darwin/VBoxCocoaApplication.m \
499 src/darwin/VBoxUtils-darwin-cocoa.mm \
500 src/darwin/VBoxCocoaSpecialControls.mm \
501 src/darwin/CocoaDockIconPreview.mm
502 VirtualBox_QT_MOCHDRS.darwin = \
503 src/darwin/VBoxCocoaSpecialControls.h
504else
505 VirtualBox_SOURCES.darwin += \
506 src/darwin/VBoxUtils-darwin-carbon.cpp \
507 src/darwin/CarbonDockIconPreview.cpp
508endif
509
510if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
511 VirtualBox_SOURCES += \
512 src/VBoxFBQGL.cpp \
513 src/VBoxFBOverlay.cpp \
514 src/VBoxGLSupportInfo.cpp
515endif
516# The Qt modules we're using.
517# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
518VirtualBox_QT_MODULES = Core Gui Network
519
520if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
521VirtualBox_QT_MODULES += OpenGL
522endif
523
524# Import QDesigner UI sources and translations from VBoxUI.pro.
525ifndef VBOX_WITH_REGISTRATION
526 FORMS := $(filter-out src/VBoxRegistrationDlg.ui,$(FORMS))
527endif
528$(eval VirtualBox_SOURCES += $(FORMS))
529
530# Resource files with some OSE differences (VirtualBoxBrand.qrc is created further down).
531VirtualBox_SOURCES += VirtualBox1.qrc
532VirtualBox1.qrc_RCCFLAGS = -name BASIC1
533VirtualBox_SOURCES += VirtualBox2.qrc
534VirtualBox2.qrc_RCCFLAGS = -name BASIC2
535VirtualBox_SOURCES += $(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc
536$(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc_RCCFLAGS = -name BRAND
537if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
538VirtualBox_SOURCES += VirtualBoxShaders.qrc
539VirtualBoxShaders.qrc_RCCFLAGS = -name SHADERS
540endif
541
542# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
543VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS) \
544 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS)))
545# Compress the translation units.
546VirtualBox_LRCFLAGS = -silent
547# Where to install the translations (a separate install target, VirtualBox-nls-inst is created).
548VirtualBox_QT_TRANSLATIONS_INST = $(INST_BIN)nls/
549
550
551## @todo how to detect what tool is used?
552## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
553# more generic -Wno-extra
554# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
555ifdef VBOX_WITH_XPCOM
556 VirtualBox_src/globals/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
557endif
558
559
560#
561# Generate the COM wrappers.
562#
563## @todo This needs some cleaning up perhaps...
564## @todo kBuild: Non-existing +| targets should be tried remade or what?
565VirtualBox_BLDDIRS += $(PATH_VirtualBox)/include
566VirtualBox_INTERMEDIATES += $(PATH_VirtualBox)/include/COMWrappers.h
567VirtualBox_CLEAN += \
568 $(PATH_VirtualBox)/include/COMWrappers \
569 $(PATH_VirtualBox)/include/COMWrappers.tmp \
570 $(PATH_VirtualBox)/include/COMWrappers.h \
571 $(PATH_VirtualBox)/include/COMWrappers.cpp
572VirtualBox_SOURCES += $(PATH_VirtualBox)/include/COMWrappers.cpp
573
574$$(PATH_VirtualBox)/include/COMWrappers \
575+| $$(PATH_VirtualBox)/include/COMWrappers.h \
576+| $$(PATH_VirtualBox)/include/COMWrappers.cpp: \
577 $(VBOX_XIDL_FILE) \
578 $(VBOX_VIRTUALBOX4_SRC)/src/globals/COMWrappers.xsl \
579 | $$(dir $$@)
580 $(call MSG_GENERATE,VirtualBox,$<,$@)
581 $(QUIET)$(RM) -f $@ [email protected] [email protected] [email protected]
582 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_VIRTUALBOX4_SRC)/src/globals/COMWrappers.xsl $<
583
584 $(QUIET)$(SED) -e '1,/\/\/ wrapper definitions/ !d' \
585 --output [email protected] $@
586 $(QUIET)$(CP) --changed [email protected] [email protected]
587
588 $(QUIET)$(APPEND) -t -n [email protected] \
589 '/*' \
590 ' * DO NOT EDIT! This is a generated file, see COMWrappers.h for details.' \
591 ' */' \
592 '' \
593 '#include "VBoxGlobal.h"' \
594 ''
595 $(QUIET)$(SED) -e '/\/\/ wrapper definitions/,9999999 !d' \
596 -e 's/^inline //' \
597 --append [email protected] $@
598 $(QUIET)$(CP) --changed [email protected] [email protected]
599 $(QUIET)$(RM) -f [email protected]
600
601
602# alias for generating the COM Wrappers file.
603testwrappers:: $$(PATH_VirtualBox)/include/COMWrappers.h
604
605
606#
607# Generate qrc file with branded icons.
608#
609VirtualBox_BLDDIRS += $(VBOX_VIRTUALBOX4_OUT_DIR)
610VirtualBox_CLEAN += $(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc
611if "$(KBUILD_HOST)" == "win" ## @todo remove when kBuild ticket #52 has been fixed and deployed.
612 VBOX_DRIVE_HACK := $(firstword $(subst :, ,$(PATH_ROOT))):
613else
614 VBOX_DRIVE_HACK :=
615endif
616$(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc: \
617 $(VBOX_VIRTUALBOX4_SRC)/VirtualBoxBrand.qrc \
618 | $$(dir $$@)
619 $(call MSG_GENERATE,VirtualBox,$<,$@)
620 $(QUIET)$(SED) \
621 -e 's;@VBOX_ABOUT_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_ABOUT_PNG));g' \
622 -e 's;@VBOX_ABOUT_16PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_ABOUT_16PX_PNG));g' \
623 -e 's;@VBOX_VBOX_16PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_16PX_PNG));g' \
624 -e 's;@VBOX_VBOX_20PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_20PX_PNG));g' \
625 -e 's;@VBOX_VBOX_32PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_32PX_PNG));g' \
626 -e 's;@VBOX_VBOX_40PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_40PX_PNG));g' \
627 -e 's;@VBOX_VBOX_48PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_48PX_PNG));g' \
628 -e 's;@VBOX_VBOX_64PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_64PX_PNG));g' \
629 -e 's;@VBOX_CUBE_42PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_CUBE_42PX_PNG));g' \
630 --output $@ \
631 $<
632
633
634ifeq ($(KBUILD_TARGET),win)
635#
636# On Windows we'll have to generate/edit part of the resource file.
637# The IDI_ICON1 name is Qt specific.
638#
639src/win/VirtualBox.rc_INCS = $(PATH_VirtualBox)
640src/win/VirtualBox.rc_DEPS = $(PATH_VirtualBox)/VirtualBox-icon.rc
641src/win/VirtualBox.rc_CLEAN = $(PATH_VirtualBox)/VirtualBox-icon.rc
642
643$$(PATH_VirtualBox)/VirtualBox-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
644 $(APPEND) -t $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
645
646endif # win
647
648
649ifeq ($(KBUILD_TARGET),darwin)
650#
651# Create directories for each approved language or the application
652# menu won't be translated.
653#
654INSTALLS += VirtualBox.lproj
655VirtualBox.lproj_INST = $(INST_VIRTUALBOX)Contents/Resources/
656VirtualBox.lproj_MODE = 755
657VirtualBox.lproj_DIRS := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
658
659#
660# On OS X (darwin) we need to install icon resources and compulsory bundle contents.
661# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
662#
663INSTALLS += VirtualBox.app
664VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
665VirtualBox.app_MODE = 644
666VirtualBox.app_SOURCES = \
667 src/darwin/PkgInfo \
668 $(PATH_VirtualBox.app)/Info.plist \
669 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
670
671$$(PATH_VirtualBox.app)/Info.plist: $(PATH_SUB_CURRENT)/src/darwin/Info.plist $(VBOX_VERSION_MK) | $$(@D)/
672 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
673 $(QUIET)$(RM) -f $@
674 $(QUIET)$(SED) \
675 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
676 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
677 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
678 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
679 $< > $@
680
681INSTALLS += VirtualBoxVM.app
682VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
683VirtualBoxVM.app_MODE = 644
684VirtualBoxVM.app_SOURCES = \
685 src/darwin/VM-PkgInfo=>PkgInfo \
686 $(PATH_VirtualBoxVM.app)/VM-Info.plist=>Info.plist
687VirtualBoxVM.app_SYMLINKS = \
688 MacOS=>../../../MacOS/ \
689 Resources=>../../../Resources/
690
691$$(PATH_VirtualBoxVM.app)/VM-Info.plist: $(PATH_SUB_CURRENT)/src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $$(@D)/
692 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
693 $(QUIET)$(RM) -f $@
694 $(QUIET)$(SED) \
695 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
696 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
697 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
698 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
699 --output $@ $<
700endif # darwin
701
702#
703# App for testing GL support
704#
705if defined(VBOX_WITH_VIDEOHWACCEL)
706 if1of ($(KBUILD_TARGET), win linux)
707 LIBRARIES += VBoxOGL2D
708 VBoxOGL2D_TEMPLATE = VBOXR3STATIC
709 VBoxOGL2D_USES = qt4
710# VBoxOGL2D_QTTOOL = QT4
711# VBoxOGL2D_MOCTOOL = QT4
712# VBoxOGL2D_UICTOOL = QT4
713# VBoxOGL2D_RCCTOOL = QT4
714# VBoxOGL2D_LRCTOOL = QT4
715 VBoxOGL2D_SDKS = QT4
716 VBoxOGL2D_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT QT_SHARED HAVE_CONFIG_H $(ARCH_BITS_DEFS) VBOX_WITH_VIDEOHWACCEL VBOX_GUI_USE_QGL
717 VBoxOGL2D_QT_MODULES += OpenGL
718 VBoxOGL2D_SOURCES = \
719 src/VBoxGLSupportInfo.cpp
720 VBoxOGL2D_INCS = include
721 endif
722endif
723
724#
725# Testcase for the darwin keyboard routines.
726#
727ifdef VBOX_WITH_TESTCASES
728PROGRAMS.darwin += tstDarwinKeyboard
729tstDarwinKeyboard_NAME = tstDarwinKeyboard
730tstDarwinKeyboard_TEMPLATE = VBOXR3TSTEXE
731tstDarwinKeyboard_DEFS.x86 = USE_HID_FOR_MODIFIERS
732tstDarwinKeyboard_INCS = include
733tstDarwinKeyboard_SOURCES = \
734 src/darwin/tstDarwinKeyboard.cpp \
735 src/darwin/DarwinKeyboard.cpp
736tstDarwinKeyboard_SOURCES.amd64 = \
737 src/darwin/VBoxCocoaApplication.m
738tstDarwinKeyboard_LDFLAGS = -framework IOKit -framework Carbon -framework AppKit
739tstDarwinKeyboard_LIBS = \
740 $(LIB_RUNTIME)
741endif
742
743
744# Unset everything that was loaded from VBoxUI.pro.
745TEMPLATE := $(SAVED_TEMPLATE)
746SAVED_TEMPLATE :=
747LANGUAGE :=
748FORMS :=
749TRANSLATIONS :=
750IMAGES :=
751
752
753# Commit the magic.
754# (note: before custom rules that make usage of generated variables!).
755include $(KBUILD_PATH)/subfooter.kmk
756
757#
758# Update all known NLS translation (.ts) files in the nls/ subdirectory.
759#
760# NOTE: This target is intended to be run only by the GUI maintainer shortly
761# before a new product release. VirtualBox_xx_YY.ts is a template for new
762# languages and should never be actually translated or installed.
763#
764updatenls:: makeallnls nls/VirtualBox_en.ts
765
766makeallnls:: \
767 $(filter-out %.qrc,$(VirtualBox_SOURCES) $(VirtualBox_VBOX_EXTRA_NLS_SOURCES)) \
768 $(wildcard include/*.h)
769 $(call MSG_L1,lupdate all languages (nls/*.ts))
770 $(QUIET)$(TOOL_QT4_LUPDATE) \
771 $^ \
772 -ts \
773 $(filter-out nls/VirtualBox_en.ts,$(filter-out nls/qt_%.ts,$(VirtualBox_QT_TRANSLATIONS))) \
774 nls/VirtualBox_xx_YY.ts
775
776# Create the English translation file. This is something special cause it will
777# contain the plural forms only.
778nls/VirtualBox_en.ts: \
779 $(filter-out %.qrc,$(VirtualBox_SOURCES) $(VirtualBox_VBOX_EXTRA_NLS_SOURCES)) \
780 $(wildcard include/*.h)
781 $(call MSG_L1,lupdate $@)
782 $(QUIET)$(TOOL_QT4_LUPDATE) \
783 $^ \
784 -ts \
785 $@
786 $(QUIET)$(SED) -n -i -e \
787 '/<context>/,/<\/context>/!p;/<context>/h;/<name>/H;/<message numerus="yes">/,/<\/message>/H;/<\/context>/{H;x;/<message/p}' \
788 $@
789
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