VirtualBox

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

Last change on this file since 22833 was 22823, checked in by vboxsync, 15 years ago

replaced VBOX_SVN_REV by RTBldCfgRevision[Str]()

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 22.1 KB
Line 
1# $Id: Makefile.kmk 22823 2009-09-07 19:52:08Z 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
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
194
195ifdef VBOX_BLEEDING_EDGE
196VirtualBox_src/VBoxConsoleWnd.cpp_DEFS += \
197 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
198VirtualBox_src/VBoxSelectorWnd.cpp_DEFS += \
199 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
200VirtualBox_src/VBoxAboutDlg.cpp_DEFS += \
201 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
202VirtualBox_src/main.cpp_DEFS += \
203 VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
204endif
205
206VirtualBox_INCS = \
207 ./include \
208 $(PATH_VirtualBox)/include
209
210# Necessary for the hdd backend enumeration
211VirtualBox_LIBS = $(LIB_DDU)
212
213ifdef VBOX_WITH_VIDEOHWACCEL
214# Necessary for save state support
215VirtualBox_LIBS += $(LIB_VMM)
216endif
217ifeq ($(KBUILD_TYPE),release)
218 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
219else
220 VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
221 ifeq ($(USERNAME),dmik)
222 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
223 else
224 VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
225 endif
226endif
227# r=bird: what is -lz doing here? it belongs in LIBS.
228VirtualBox_LDFLAGS.darwin = -lz \
229 -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -framework Carbon \
230 $(if $(VBOX_WITH_HARDENING),-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VirtualBox.dylib)
231VirtualBox_LDFLAGS.darwin.x86 = -framework QuickTime
232ifdef VBOX_WITH_ICHAT_THEATER
233 VirtualBox_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
234endif
235if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
236 VirtualBox_LDFLAGS.darwin += -framework OpenGL
237endif
238
239VirtualBox_LIBS.win = \
240 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
241 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
242 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
243ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
244 VirtualBox_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
245endif
246
247if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
248 VirtualBox_LIBS.win += $(PATH_SDK_WINPSDK_LIB)/Opengl32.lib
249 VirtualBox_LIBS.solaris += GL
250endif
251
252# Headers containing definitions of classes that use the Q_OBJECT macro.
253VirtualBox_QT_MOCHDRS = \
254 include/QIHttp.h \
255 include/QIWidgetValidator.h \
256 include/QIHotKeyEdit.h \
257 include/QIStatusBar.h \
258 include/QIStateIndicator.h \
259 include/QIMessageBox.h \
260 include/QILabel.h \
261 include/QILabel_p.h \
262 include/QILabelSeparator.h \
263 include/QIAbstractWizard.h \
264 include/QIListView.h \
265 include/QITreeWidget.h \
266 include/QIMainDialog.h \
267 include/QIHelpButton.h \
268 include/QIDialog.h \
269 include/QIFileDialog.h \
270 include/QIAdvancedSlider.h \
271 include/VBoxFilePathSelectorWidget.h \
272 include/VBoxOSTypeSelectorButton.h \
273 include/VBoxOSTypeSelectorWidget.h \
274 include/VBoxLineTextEdit.h \
275 include/VBoxUtils.h \
276 include/VBoxGlobalSettings.h \
277 include/VBoxGlobal.h \
278 include/VBoxVMListView.h \
279 include/VBoxMediaComboBox.h \
280 include/VBoxSelectorWnd.h \
281 include/VBoxConsoleWnd.h \
282 include/VBoxConsoleView.h \
283 include/VBoxMiniToolBar.h \
284 include/VBoxProblemReporter.h \
285 include/VBoxProgressDialog.h \
286 include/VBoxDownloaderWgt.h \
287 include/VBoxAboutDlg.h \
288 include/VBoxCloseVMDlg.h \
289 include/VBoxNewVMWzd.h \
290 include/VBoxNewHDWzd.h \
291 include/VBoxVMFirstRunWzd.h \
292 include/VBoxRegistrationDlg.h \
293 include/VBoxUpdateDlg.h \
294 include/VBoxSnapshotDetailsDlg.h \
295 include/VBoxVMInformationDlg.h \
296 include/VBoxTakeSnapshotDlg.h \
297 include/VBoxSnapshotsWgt.h \
298 include/VBoxVMLogViewer.h \
299 include/VBoxMediaManagerDlg.h \
300 include/VBoxSettingsUtils.h \
301 include/VBoxVMSettingsGeneral.h \
302 include/VBoxVMSettingsSystem.h \
303 include/VBoxVMSettingsDisplay.h \
304 include/VBoxVMSettingsHD.h \
305 include/VBoxVMSettingsCD.h \
306 include/VBoxVMSettingsFD.h \
307 include/VBoxVMSettingsAudio.h \
308 include/VBoxVMSettingsNetwork.h \
309 include/VBoxVMSettingsNetworkDetails.h \
310 include/VBoxVMSettingsSerial.h \
311 include/VBoxVMSettingsParallel.h \
312 include/VBoxVMSettingsUSB.h \
313 include/VBoxVMSettingsUSBFilterDetails.h \
314 include/VBoxVMSettingsSF.h \
315 include/VBoxVMSettingsSFDetails.h \
316 include/VBoxGLSettingsGeneral.h \
317 include/VBoxGLSettingsInput.h \
318 include/VBoxGLSettingsUpdate.h \
319 include/VBoxGLSettingsLanguage.h \
320 include/VBoxGLSettingsNetwork.h \
321 include/VBoxGLSettingsNetworkDetails.h \
322 include/VBoxSettingsDialog.h \
323 include/VBoxSettingsDialogSpecific.h \
324 include/VBoxSettingsPage.h \
325 include/VBoxSettingsSelector.h \
326 include/VBoxApplianceEditorWgt.h \
327 include/VBoxImportApplianceWgt.h \
328 include/VBoxImportApplianceWzd.h \
329 include/VBoxExportApplianceWgt.h \
330 include/VBoxExportApplianceWzd.h
331
332# Sources containing local definitions of classes that use the Q_OBJECT macro.
333VirtualBox_QT_MOCSRCS = \
334 src/QIMessageBox.cpp \
335 src/VBoxSelectorWnd.cpp \
336 src/VBoxConsoleWnd.cpp \
337 src/VBoxMediaManagerDlg.cpp
338ifdef VBOX_WITH_XPCOM
339 VirtualBox_QT_MOCSRCS += \
340 src/COMDefs.cpp
341endif
342ifeq ($(KBUILD_TARGET),win)
343VirtualBox_QT_MOCSRCS += \
344 src/QIFileDialog.cpp
345endif
346
347VirtualBox_SOURCES = \
348 src/main.cpp \
349 src/COMDefs.cpp \
350 src/QIWidgetValidator.cpp \
351 src/QIHotKeyEdit.cpp \
352 src/QIStateIndicator.cpp \
353 src/QIStatusBar.cpp \
354 src/QIMessageBox.cpp \
355 src/QILabel.cpp \
356 src/QILabelSeparator.cpp \
357 src/QIAbstractWizard.cpp \
358 src/QIDialog.cpp \
359 src/QIFileDialog.cpp \
360 src/QIAdvancedSlider.cpp \
361 src/QIDialogButtonBox.cpp \
362 src/QIListView.cpp \
363 src/QITreeWidget.cpp \
364 src/QIMainDialog.cpp \
365 src/QILineEdit.cpp \
366 src/QIHelpButton.cpp \
367 src/VBoxGuestRAMSlider.cpp \
368 src/VBoxFilePathSelectorWidget.cpp \
369 src/VBoxOSTypeSelectorButton.cpp \
370 src/VBoxOSTypeSelectorWidget.cpp \
371 src/VBoxLineTextEdit.cpp \
372 src/VBoxDefs.cpp \
373 src/VBoxGlobalSettings.cpp \
374 src/VBoxGlobal.cpp \
375 src/VBoxMediaComboBox.cpp \
376 src/VBoxProblemReporter.cpp \
377 src/VBoxProgressDialog.cpp \
378 src/VBoxHelpActions.cpp \
379 src/VBoxSelectorWnd.cpp \
380 src/VBoxConsoleView.cpp \
381 src/VBoxConsoleWnd.cpp \
382 src/VBoxMiniToolBar.cpp \
383 src/VBoxDownloaderWgt.cpp \
384 src/VBoxVMListView.cpp \
385 src/VBoxFrameBuffer.cpp \
386 src/VBoxAboutDlg.cpp \
387 src/VBoxCloseVMDlg.cpp \
388 src/VBoxNewVMWzd.cpp \
389 src/VBoxNewHDWzd.cpp \
390 src/VBoxVMFirstRunWzd.cpp \
391 src/VBoxRegistrationDlg.cpp \
392 src/VBoxUpdateDlg.cpp \
393 src/VBoxSnapshotDetailsDlg.cpp \
394 src/VBoxVMInformationDlg.cpp \
395 src/VBoxTakeSnapshotDlg.cpp \
396 src/VBoxSnapshotsWgt.cpp \
397 src/VBoxVMLogViewer.cpp \
398 src/VBoxVMSettingsGeneral.cpp \
399 src/VBoxVMSettingsSystem.cpp \
400 src/VBoxVMSettingsDisplay.cpp \
401 src/VBoxVMSettingsHD.cpp \
402 src/VBoxVMSettingsCD.cpp \
403 src/VBoxVMSettingsFD.cpp \
404 src/VBoxVMSettingsAudio.cpp \
405 src/VBoxVMSettingsNetwork.cpp \
406 src/VBoxVMSettingsNetworkDetails.cpp \
407 src/VBoxVMSettingsSerial.cpp \
408 src/VBoxVMSettingsParallel.cpp \
409 src/VBoxVMSettingsUSB.cpp \
410 src/VBoxVMSettingsUSBFilterDetails.cpp \
411 src/VBoxVMSettingsSF.cpp \
412 src/VBoxVMSettingsSFDetails.cpp \
413 src/VBoxGLSettingsGeneral.cpp \
414 src/VBoxGLSettingsInput.cpp \
415 src/VBoxGLSettingsUpdate.cpp \
416 src/VBoxGLSettingsLanguage.cpp \
417 src/VBoxGLSettingsNetwork.cpp \
418 src/VBoxGLSettingsNetworkDetails.cpp \
419 src/VBoxSettingsDialog.cpp \
420 src/VBoxSettingsDialogSpecific.cpp \
421 src/VBoxSettingsSelector.cpp \
422 src/VBoxMediaManagerDlg.cpp \
423 src/VBoxMedium.cpp \
424 src/VBoxApplianceEditorWgt.cpp \
425 src/VBoxImportApplianceWgt.cpp \
426 src/VBoxImportApplianceWzd.cpp \
427 src/VBoxExportApplianceWgt.cpp \
428 src/VBoxExportApplianceWzd.cpp
429
430ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
431 ifndef VBOX_OSE
432 VirtualBox_QT_MOCHDRS += \
433 include/VBoxLicenseViewer.h
434 VirtualBox_SOURCES += \
435 src/VBoxLicenseViewer.cpp
436 else
437 VirtualBox_VBOX_EXTRA_NLS_SOURCES += \
438 include/VBoxLicenseViewer.h \
439 src/VBoxLicenseViewer.cpp
440 endif
441 VirtualBox_SOURCES += \
442 src/X11/XKeyboard-new.cpp \
443 src/VBoxX11Helper.cpp
444else
445 VirtualBox_VBOX_EXTRA_NLS_SOURCES += \
446 include/VBoxLicenseViewer.h \
447 src/VBoxLicenseViewer.cpp
448endif
449
450VirtualBox_SOURCES.win += \
451 src/VBoxFBDDRAW.cpp \
452 src/win/VirtualBox.rc
453
454VirtualBox_SOURCES.darwin = \
455 src/darwin/DarwinKeyboard.cpp \
456 src/darwin/VBoxUtils-darwin.cpp \
457 src/darwin/VBoxDockIconPreview.cpp \
458 src/VBoxFBQuartz2D.cpp
459
460ifdef VBOX_WITH_ICHAT_THEATER
461 VirtualBox_SOURCES.darwin += \
462 src/darwin/VBoxIChatTheaterWrapper.m
463endif
464
465ifdef VBOX_WITH_COCOA_QT
466 VirtualBox_SOURCES.darwin += \
467 src/darwin/VBoxCocoaApplication.m \
468 src/darwin/VBoxUtils-darwin-cocoa.m \
469 src/darwin/VBoxDockIconPreview-cocoa.m
470else
471 VirtualBox_SOURCES.darwin += \
472 src/darwin/VBoxUtils-darwin-carbon.cpp
473endif
474
475if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
476 VirtualBox_SOURCES += \
477 src/VBoxFBQGL.cpp \
478 src/VBoxFBOverlay.cpp
479endif
480# The Qt modules we're using.
481# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
482VirtualBox_QT_MODULES = Core Gui Network
483
484if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
485VirtualBox_QT_MODULES += OpenGL
486endif
487
488# Import QDesigner UI sources and translations from VBoxUI.pro.
489ifndef VBOX_WITH_REGISTRATION
490 FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
491endif
492$(eval VirtualBox_SOURCES += $(FORMS))
493
494# Resource files with some OSE differences (VirtualBoxBrand.qrc is created further down).
495VirtualBox_SOURCES += VirtualBox.qrc
496VirtualBox_SOURCES += $(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc
497$(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc_RCCFLAGS = -name BRAND
498if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
499VirtualBox_SOURCES += VirtualBoxShaders.qrc
500VirtualBoxShaders.qrc_RCCFLAGS = -name SHADERS
501endif
502
503# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
504VirtualBox_QT_TRANSLATIONS := $(TRANSLATIONS) \
505 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS)))
506# Compress the translation units.
507VirtualBox_LRCFLAGS = -silent
508# Where to install the translations (a separate install target, VirtualBox-nls-inst is created).
509VirtualBox_QT_TRANSLATIONS_INST = $(INST_BIN)nls/
510
511
512## @todo how to detect what tool is used?
513## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
514# more generic -Wno-extra
515# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
516ifdef VBOX_WITH_XPCOM
517 VirtualBox_src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
518endif
519
520
521#
522# Generate the COM wrappers.
523#
524VirtualBox_BLDDIRS += $(PATH_VirtualBox)/include
525VirtualBox_INTERMEDIATES += $(PATH_VirtualBox)/include/COMWrappers.h
526VirtualBox_CLEAN += $(PATH_VirtualBox)/include/COMWrappers.h
527
528$$(PATH_VirtualBox)/include/COMWrappers.h: \
529 $(VBOX_XIDL_FILE) \
530 $(VBOX_VIRTUALBOX4_SRC)/include/COMWrappers.xsl \
531 | $$(dir $$@)
532 $(call MSG_GENERATE,VirtualBox,$<,$@)
533 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_VIRTUALBOX4_SRC)/include/COMWrappers.xsl $<
534
535# alias for generating the COM Wrappers file.
536testwrappers:: $$(PATH_VirtualBox)/include/COMWrappers.h
537
538
539#
540# Generate qrc file with branded icons.
541#
542VirtualBox_BLDDIRS += $(VBOX_VIRTUALBOX4_OUT_DIR)
543VirtualBox_CLEAN += $(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc
544if "$(KBUILD_HOST)" == "win" ## @todo remove when kBuild ticket #52 has been fixed and deployed.
545 VBOX_DRIVE_HACK := $(firstword $(subst :, ,$(PATH_ROOT))):
546else
547 VBOX_DRIVE_HACK :=
548endif
549$(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc: \
550 $(VBOX_VIRTUALBOX4_SRC)/VirtualBoxBrand.qrc \
551 | $$(dir $$@)
552 $(call MSG_GENERATE,VirtualBox,$<,$@)
553 $(QUIET)$(SED) \
554 -e 's;@VBOX_ABOUT_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_ABOUT_PNG));g' \
555 -e 's;@VBOX_ABOUT_16PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_ABOUT_16PX_PNG));g' \
556 -e 's;@VBOX_VBOX_16PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_16PX_PNG));g' \
557 -e 's;@VBOX_VBOX_20PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_20PX_PNG));g' \
558 -e 's;@VBOX_VBOX_32PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_32PX_PNG));g' \
559 -e 's;@VBOX_VBOX_40PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_40PX_PNG));g' \
560 -e 's;@VBOX_VBOX_48PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_48PX_PNG));g' \
561 -e 's;@VBOX_VBOX_64PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_VBOX_64PX_PNG));g' \
562 -e 's;@VBOX_CUBE_42PX_PNG@;$(subst $(VBOX_DRIVE_HACK),,$(VBOX_BRAND_GUI_CUBE_42PX_PNG));g' \
563 --output $@ \
564 $<
565
566
567ifeq ($(KBUILD_TARGET),win)
568#
569# On Windows we'll have to generate/edit part of the resource file.
570# The IDI_ICON1 name is Qt specific.
571#
572src/win/VirtualBox.rc_INCS = $(PATH_VirtualBox)
573src/win/VirtualBox.rc_DEPS = $(PATH_VirtualBox)/VirtualBox-icon.rc
574src/win/VirtualBox.rc_CLEAN = $(PATH_VirtualBox)/VirtualBox-icon.rc
575
576$$(PATH_VirtualBox)/VirtualBox-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
577 $(APPEND) -t $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
578
579endif # win
580
581
582ifeq ($(KBUILD_TARGET),darwin)
583#
584# Create directories for each approved language or the application
585# menu won't be translated.
586#
587INSTALLS += VirtualBox.lproj
588VirtualBox.lproj_INST = $(INST_VIRTUALBOX)Contents/Resources/
589VirtualBox.lproj_MODE = 755
590VirtualBox.lproj_DIRS := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES_ALL))
591
592#
593# On OS X (darwin) we need to install icon resources and compulsory bundle contents.
594# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
595#
596INSTALLS += VirtualBox.app
597VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
598VirtualBox.app_MODE = 644
599VirtualBox.app_SOURCES = \
600 src/darwin/PkgInfo \
601 $(PATH_VirtualBox.app)/Info.plist \
602 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
603
604$$(PATH_VirtualBox.app)/Info.plist: $(PATH_SUB_CURRENT)/src/darwin/Info.plist $(VBOX_VERSION_MK) | $$(@D)/
605 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
606 $(QUIET)$(RM) -f $@
607 $(QUIET)$(SED) \
608 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
609 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
610 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
611 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
612 $< > $@
613
614INSTALLS += VirtualBoxVM.app
615VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
616VirtualBoxVM.app_MODE = 644
617VirtualBoxVM.app_SOURCES = \
618 src/darwin/VM-PkgInfo=>PkgInfo \
619 $(PATH_VirtualBoxVM.app)/VM-Info.plist=>Info.plist
620VirtualBoxVM.app_SYMLINKS = \
621 MacOS=>../../../MacOS/ \
622 Resources=>../../../Resources/
623
624$$(PATH_VirtualBoxVM.app)/VM-Info.plist: $(PATH_SUB_CURRENT)/src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $$(@D)/
625 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
626 $(QUIET)$(RM) -f $@
627 $(QUIET)$(SED) \
628 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
629 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
630 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
631 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
632 --output $@ $<
633endif # darwin
634
635
636#
637# Testcase for the darwin keyboard routines.
638#
639ifdef VBOX_WITH_TESTCASES
640PROGRAMS.darwin += tstDarwinKeyboard
641tstDarwinKeyboard_NAME = tstDarwinKeyboard
642tstDarwinKeyboard_TEMPLATE = VBOXR3TSTEXE
643tstDarwinKeyboard_DEFS.x86 = USE_HID_FOR_MODIFIERS
644tstDarwinKeyboard_INCS = include
645tstDarwinKeyboard_SOURCES = \
646 src/darwin/tstDarwinKeyboard.cpp \
647 src/darwin/DarwinKeyboard.cpp
648tstDarwinKeyboard_SOURCES.amd64 = \
649 src/darwin/VBoxCocoaApplication.m
650tstDarwinKeyboard_LDFLAGS = -framework IOKit -framework Carbon -framework AppKit
651tstDarwinKeyboard_LIBS = \
652 $(LIB_RUNTIME)
653endif
654
655
656# Unset everything that was loaded from VBoxUI.pro.
657TEMPLATE := $(SAVED_TEMPLATE)
658SAVED_TEMPLATE :=
659LANGUAGE :=
660FORMS :=
661TRANSLATIONS :=
662IMAGES :=
663
664
665# Commit the magic.
666# (note: before custom rules that make usage of generated variables!).
667include $(KBUILD_PATH)/subfooter.kmk
668
669#
670# Update all known NLS translation (.ts) files in the nls/ subdirectory.
671#
672# NOTE: This target is intended to be run only by the GUI maintainer shortly
673# before a new product release. VirtualBox_xx_YY.ts is a template for new
674# languages and should never be actually translated or installed.
675#
676updatenls:: \
677 $(filter-out %.qrc,$(VirtualBox_SOURCES) $(VirtualBox_VBOX_EXTRA_NLS_SOURCES)) \
678 $(wildcard include/*.h)
679 $(call MSG_L1,lupdate all languages (nls/*.ts))
680 $(QUIET)$(TOOL_QT4_LUPDATE) \
681 $^ \
682 -ts \
683 $(filter-out nls/qt_%.ts,$(VirtualBox_QT_TRANSLATIONS)) \
684 nls/VirtualBox_xx_YY.ts
685
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