VirtualBox

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

Last change on this file since 18358 was 18299, checked in by vboxsync, 16 years ago

FE/Qt4: split out VBoxProgressDialog

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