VirtualBox

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

Last change on this file since 24789 was 24672, checked in by vboxsync, 15 years ago

VirtualBox/Makefile.kmk: Be more quiet when generating COMWrappers.h/cpp.

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