VirtualBox

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

Last change on this file since 22406 was 22391, checked in by vboxsync, 16 years ago

FE/Qt4: show some special version number for bleeding edge builds

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