VirtualBox

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

Last change on this file since 20135 was 20078, checked in by vboxsync, 16 years ago

FE/Qt4: 3701: Remove native file dialog handling on Windows if possible - moving re-implementation into separate QIFileDialog class.

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