VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk@ 12498

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

FE/Qt: X11 keyboard code is not Linux-specific

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 20.5 KB
Line 
1# $Id: Makefile.kmk 12498 2008-09-16 15:54:06Z 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)
29
30VBOX_WITH_REGISTRATION := 1
31
32# Ask the user to register at Sun. If this setting is disabled the user can
33# still register using the menu if desired.
34VBOX_WITH_REGISTRATION_REQUEST := 1
35
36# Show the update notifier dialog during startup. If this setting is disabled
37# the user can still update using the menu if desired.
38VBOX_WITH_UPDATE_REQUEST := 1
39
40
41#
42# The targets.
43#
44ifdef VBOX_WITH_HARDENING
45PROGRAMS += VirtualBox4Hardened
46DLLS += VirtualBox4
47else
48PROGRAMS += VirtualBox4
49endif
50
51ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
52 DLLS += VBoxKeyboard
53 ## @todo convert to install target.
54 OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
55 CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
56endif
57INSTALLS += VirtualBox4.nls
58
59#
60# VBoxKeyboard - keyboard library for X11.
61#
62VBoxKeyboard_TEMPLATE = VBOXR3
63VBoxKeyboard_SOURCES = \
64 src/X11/keyboard-new.c
65VBoxKeyboard_LIBS = X11
66VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
67
68
69#
70# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
71# redistributed with usable sources.
72#
73# This rule will link create a temporary symlink to src/X11/ and tar
74# up the selected files into a tarball that is installed into the
75# bin directory (probably belongs in /usr/shared/somewhere really,
76# but wtf, it's not like we're even trying to be FHS compliant).
77#
78## @todo this should be tar'ed down into the output directory and installed using an install target.
79$(PATH_BIN)/vboxkeyboard.tar.gz: $(abspathex \
80 $(VBoxKeyboard_SOURCES) \
81 src/X11/COPYING.LIB \
82 src/X11/keyboard.h \
83 src/X11/keyboard-layouts.h \
84 src/X11/keyboard-list.h \
85 src/X11/keyboard-tables.h \
86 src/X11/keyboard-types.h \
87 src/X11/Makefile \
88 ,$(PATH_SUB_CURRENT))
89 $(call MSG_TOOL,tar/gzip,,$@)
90 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard $@
91 $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/X11/ $(PATH_TARGET)/vboxkeyboard
92 $(QUIET)cd $(PATH_TARGET) \
93 && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
94 | gzip - > $@
95 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard
96
97OTHER_CLEAN += \
98 $(PATH_BIN)/vboxkeyboard.tar.gz
99
100
101#
102# Hardened VirtualBox4.
103#
104VirtualBox4Hardened_TEMPLATE = VBOXR3HARDENEDEXE
105VirtualBox4Hardened_SOURCES = src/hardenedmain.cpp
106VirtualBox4Hardened_NAME = VirtualBox
107ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
108 #VirtualBox4Hardened_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
109 VirtualBox4Hardened_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
110endif
111
112
113#
114# Include Qt project file, we'll use FORMS and TRANSLATIONS in
115# the VirtualBox4 setup below.
116#
117SAVED_TEMPLATE := $(TEMPLATE)
118include $(PATH_SUB_CURRENT)/VBoxUI.pro
119
120
121#
122# VirtualBox4 - The GUI program.
123#
124USES += qt4
125VirtualBox4_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXQT4GUI,VBOXQT4GUIEXE)
126VirtualBox4_NAME = VirtualBox
127ifndef VBOX_WITH_HARDENING # For the launch trick we need different inode numbers.
128 ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
129 #VirtualBox4_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
130 VirtualBox4_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
131 endif
132endif
133VirtualBox4_SDKS.win = WINPSDK DXSDK
134ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
135 VirtualBox4_SDKS += LIBSDL
136endif
137
138ifdef VBOX_WITH_ICHAT_THEATER
139 # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
140 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
141endif
142
143VirtualBox4_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
144VirtualBox4_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
145VirtualBox4_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
146VirtualBox4_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
147VirtualBox4_DEFS.linux = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
148VirtualBox4_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
149VirtualBox4_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
150VirtualBox4_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
151VirtualBox4_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
152VirtualBox4_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
153## @todo VBOX_WITH_HACKED_QT doesn't apply to Qt4, so why is this still here?
154VirtualBox4_DEFS.darwin += VBOX_WITH_HACKED_QT
155ifdef VBOX_WITH_ICHAT_THEATER
156 VirtualBox4_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
157endif
158ifneq ($(KBUILD_TYPE),release)
159 # non-release builds has some extra features.
160 VirtualBox4_DEFS.win += VBOX_GUI_USE_DDRAW
161endif
162VirtualBox4_DEFS += \
163 $(if $(VBOX_WITH_REGISTRATION),VBOX_WITH_REGISTRATION) \
164 $(if $(VBOX_WITH_REGISTRATION_REQUEST),VBOX_WITH_REGISTRATION_REQUEST) \
165 $(if $(VBOX_WITH_UPDATE_REQUEST),VBOX_WITH_UPDATE_REQUEST) \
166 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA) \
167 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE) \
168 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \
169 $(if $(VBOX_OSE),VBOX_OSE) \
170 $(if $(VBOX_WITH_DEBUGGER_GUI),VBOX_WITH_DEBUGGER_GUI_MENU) \
171 $(if $(VBOX_WITH_NETFLT),VBOX_WITH_NETFLT)
172
173src/main.cpp_DEFS += VBOX_VERSION_STRING=\"$(VBOX_VERSION_STRING)\"
174src/main.cpp_DEPS += $(VBOX_VERSION_MK)
175
176VirtualBox4_INCS = \
177 ./include \
178 $(PATH_VirtualBox4)/include
179
180# Necessary for the hdd backend enumeration
181VirtualBox4_LIBS = $(LIB_DDU)
182
183ifeq ($(KBUILD_TYPE),release)
184 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
185else
186 VirtualBox4_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
187 ifeq ($(USERNAME),dmik)
188 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
189 else
190 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:console
191 endif
192endif
193# r=bird: what is -lz doing here? it belongs in LIBS.
194VirtualBox4_LDFLAGS.darwin = -lz \
195 -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -framework Carbon -framework QuickTime \
196 $(if $(VBOX_WITH_HARDENING),-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VirtualBox.dylib)
197ifdef VBOX_WITH_ICHAT_THEATER
198 VirtualBox4_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
199endif
200VirtualBox4_LIBS.win = \
201 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
202 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
203 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
204ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
205 VirtualBox4_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
206endif
207
208# Headers containing definitions of classes that use the Q_OBJECT macro.
209VirtualBox4_QT_MOCHDRS = \
210 include/QIWidgetValidator.h \
211 include/QIHotKeyEdit.h \
212 include/QIStatusBar.h \
213 include/QIStateIndicator.h \
214 include/QIMessageBox.h \
215 include/QILabel.h \
216 include/QILabel_p.h \
217 include/QILabelSeparator.h \
218 include/QIAbstractWizard.h \
219 include/QIListView.h \
220 include/QITreeWidget.h \
221 include/QIMainDialog.h \
222 include/QIHelpButton.h \
223 include/QIDialog.h \
224 include/VBoxFilePathSelectorWidget.h \
225 include/VBoxUtils.h \
226 include/VBoxGlobalSettings.h \
227 include/VBoxGlobal.h \
228 include/VBoxVMListView.h \
229 include/VBoxMediaComboBox.h \
230 include/VBoxSelectorWnd.h \
231 include/VBoxConsoleWnd.h \
232 include/VBoxConsoleView.h \
233 include/VBoxProblemReporter.h \
234 include/VBoxDownloaderWgt.h \
235 include/VBoxNetworkFramework.h \
236 include/VBoxAboutDlg.h \
237 include/VBoxCloseVMDlg.h \
238 include/VBoxNewVMWzd.h \
239 include/VBoxNewHDWzd.h \
240 include/VBoxVMFirstRunWzd.h \
241 include/VBoxRegistrationDlg.h \
242 include/VBoxUpdateDlg.h \
243 include/VBoxSnapshotDetailsDlg.h \
244 include/VBoxVMInformationDlg.h \
245 include/VBoxTakeSnapshotDlg.h \
246 include/VBoxSnapshotsWgt.h \
247 include/VBoxVMLogViewer.h \
248 include/VBoxDiskImageManagerDlg.h \
249 include/VBoxSettingsUtils.h \
250 include/VBoxVMSettingsGeneral.h \
251 include/VBoxVMSettingsHD.h \
252 include/VBoxVMSettingsCD.h \
253 include/VBoxVMSettingsFD.h \
254 include/VBoxVMSettingsAudio.h \
255 include/VBoxVMSettingsNetwork.h \
256 include/VBoxVMSettingsSerial.h \
257 include/VBoxVMSettingsParallel.h \
258 include/VBoxVMSettingsUSB.h \
259 include/VBoxVMSettingsUSBFilterDetails.h \
260 include/VBoxVMSettingsSF.h \
261 include/VBoxVMSettingsSFDetails.h \
262 include/VBoxVMSettingsVRDP.h \
263 include/VBoxGLSettingsGeneral.h \
264 include/VBoxGLSettingsInput.h \
265 include/VBoxGLSettingsUpdate.h \
266 include/VBoxGLSettingsLanguage.h \
267 include/VBoxSettingsDialog.h \
268 include/VBoxSettingsDialogSpecific.h \
269 include/VBoxSettingsPage.h \
270 include/VBoxSettingsSelector.h
271
272# Sources containing local definitions of classes that use the Q_OBJECT macro.
273VirtualBox4_QT_MOCSRCS = \
274 src/VBoxSelectorWnd.cpp \
275 src/VBoxDiskImageManagerDlg.cpp
276ifdef VBOX_WITH_XPCOM
277 VirtualBox4_QT_MOCSRCS += \
278 src/COMDefs.cpp
279endif
280
281VirtualBox4_SOURCES = \
282 src/main.cpp \
283 src/COMDefs.cpp \
284 src/QIWidgetValidator.cpp \
285 src/QIHotKeyEdit.cpp \
286 src/QIStateIndicator.cpp \
287 src/QIStatusBar.cpp \
288 src/QIMessageBox.cpp \
289 src/QILabel.cpp \
290 src/QILabelSeparator.cpp \
291 src/QIAbstractWizard.cpp \
292 src/QIDialog.cpp \
293 src/QIDialogButtonBox.cpp \
294 src/QIListView.cpp \
295 src/QITreeWidget.cpp \
296 src/QIMainDialog.cpp \
297 src/QILineEdit.cpp \
298 src/QIHelpButton.cpp \
299 src/VBoxFilePathSelectorWidget.cpp \
300 src/VBoxDefs.cpp \
301 src/VBoxGlobalSettings.cpp \
302 src/VBoxGlobal.cpp \
303 src/VBoxMediaComboBox.cpp \
304 src/VBoxProblemReporter.cpp \
305 src/VBoxSelectorWnd.cpp \
306 src/VBoxConsoleView.cpp \
307 src/VBoxConsoleWnd.cpp \
308 src/VBoxDownloaderWgt.cpp \
309 src/VBoxVMListView.cpp \
310 src/VBoxFrameBuffer.cpp \
311 src/HappyHttp.cpp \
312 src/VBoxNetworkFramework.cpp \
313 src/VBoxAboutDlg.cpp \
314 src/VBoxCloseVMDlg.cpp \
315 src/VBoxNewVMWzd.cpp \
316 src/VBoxNewHDWzd.cpp \
317 src/VBoxVMFirstRunWzd.cpp \
318 src/VBoxRegistrationDlg.cpp \
319 src/VBoxUpdateDlg.cpp \
320 src/VBoxSnapshotDetailsDlg.cpp \
321 src/VBoxVMInformationDlg.cpp \
322 src/VBoxTakeSnapshotDlg.cpp \
323 src/VBoxSnapshotsWgt.cpp \
324 src/VBoxVMLogViewer.cpp \
325 src/VBoxDiskImageManagerDlg.cpp \
326 src/VBoxVMSettingsGeneral.cpp \
327 src/VBoxVMSettingsHD.cpp \
328 src/VBoxVMSettingsCD.cpp \
329 src/VBoxVMSettingsFD.cpp \
330 src/VBoxVMSettingsAudio.cpp \
331 src/VBoxVMSettingsNetwork.cpp \
332 src/VBoxVMSettingsSerial.cpp \
333 src/VBoxVMSettingsParallel.cpp \
334 src/VBoxVMSettingsUSB.cpp \
335 src/VBoxVMSettingsUSBFilterDetails.cpp \
336 src/VBoxVMSettingsSF.cpp \
337 src/VBoxVMSettingsSFDetails.cpp \
338 src/VBoxVMSettingsVRDP.cpp \
339 src/VBoxGLSettingsGeneral.cpp \
340 src/VBoxGLSettingsInput.cpp \
341 src/VBoxGLSettingsUpdate.cpp \
342 src/VBoxGLSettingsLanguage.cpp \
343 src/VBoxSettingsDialog.cpp \
344 src/VBoxSettingsDialogSpecific.cpp \
345 src/VBoxSettingsSelector.cpp
346
347ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
348 ifndef VBOX_OSE
349 VirtualBox4_QT_MOCHDRS += \
350 include/VBoxLicenseViewer.h
351 VirtualBox4_SOURCES += \
352 src/VBoxLicenseViewer.cpp
353 else
354 VirtualBox4_VBOX_EXTRA_NLS_SOURCES += \
355 include/VBoxLicenseViewer.h \
356 src/VBoxLicenseViewer.cpp
357 endif
358 VirtualBox4_SOURCES += \
359 src/X11/XKeyboard-new.cpp \
360 src/VBoxX11Helper.cpp
361else
362 VirtualBox4_VBOX_EXTRA_NLS_SOURCES += \
363 include/VBoxLicenseViewer.h \
364 src/VBoxLicenseViewer.cpp
365endif
366
367VirtualBox4_SOURCES.win += \
368 src/VBoxFBDDRAW.cpp \
369 $(PATH_VirtualBox4)/VirtualBox4.rc
370
371VirtualBox4_SOURCES.darwin = \
372 src/darwin/DarwinKeyboard.cpp \
373 src/darwin/VBoxUtils-darwin.cpp \
374 src/VBoxFBQuartz2D.cpp
375# src/darwin/VBoxAquaStyle.cpp
376
377ifdef VBOX_WITH_ICHAT_THEATER
378 VirtualBox4_SOURCES.darwin += \
379 src/darwin/VBoxIChatTheaterWrapper.m
380endif
381
382# The Qt modules we're using.
383# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
384VirtualBox4_QT_MODULES = Core Gui
385
386# Import QDesigner UI sources and translations from VBoxUI.pro.
387# Note that the OSE about dialog is always required by lupdate/lrelease.
388ifndef VBOX_WITH_REGISTRATION
389 FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
390endif
391VirtualBox4_SOURCES := \
392 $(VirtualBox4_SOURCES) \
393 $(FORMS) \
394 ui/VBoxAboutDlg.ui
395
396# Resource files with some OSE differences.
397VirtualBox4_SOURCES += VirtualBox.qrc
398VirtualBox4_SOURCES += $(PATH_TARGET)/VirtualBoxBrand.qrc
399ifdef VBOX_OSE
400 $(PATH_TARGET)/VirtualBoxBrand.qrc_RCCFLAGS = -name OSE
401else
402 VirtualBox4_SOURCES += src/VBoxAboutNonOSEDlg.cpp
403 VirtualBox4_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
404 $(PATH_TARGET)/VirtualBoxBrand.qrc_RCCFLAGS = -name NonOSE
405endif
406
407
408# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
409VirtualBox4_QT_TRANSLATIONS := $(TRANSLATIONS) \
410 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS)))
411# Compress the translation units.
412VirtualBox4_LRCFLAGS = -compress
413# Where to install the translations (a separate install target, VirtualBox4-nls-inst is created).
414VirtualBox4_QT_TRANSLATIONS_INST = $(INST_BIN)nls/
415
416
417
418# Some flag hacks (should go away).
419ifneq ($(KBUILD_TARGET),win)
420 src/HappyHttp.cpp_CXXFLAGS += -fexceptions
421 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
422 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
423endif
424src/HappyHttp.cpp_CXXFLAGS.linux += -O2
425
426## @todo how to detect what tool is used?
427## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
428# more generic -Wno-extra
429# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
430ifdef VBOX_WITH_XPCOM
431 src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
432endif
433
434
435#
436# Generate the COM wrappers.
437#
438VirtualBox4_BLDDIRS += $(PATH_VirtualBox4)/include
439VirtualBox4_INTERMEDIATES += $(PATH_VirtualBox4)/include/COMWrappers.h \
440 $(PATH_TARGET)/VirtualBoxBrand.qrc
441VirtualBox4_CLEAN += $(PATH_VirtualBox4)/include/COMWrappers.h \
442 $(PATH_TARGET)/VirtualBoxBrand.qrc
443
444$$(PATH_VirtualBox4)/include/COMWrappers.h: \
445 $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl \
446 $(VBOX_VIRTUALBOX4_SRC)/include/COMWrappers.xsl \
447 | $$(dir $$@)
448 $(call MSG_GENERATE,VirtualBox4,$<,$@)
449 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_VIRTUALBOX4_SRC)/include/COMWrappers.xsl $<
450
451#
452# Generate qrc file with branded icons.
453#
454if "$(KBUILD_HOST)" == "win" ## @todo remove when kBuild ticket #52 has been fixed and deployed.
455VBOX_DRIVE_HACK := $(firstword $(subst :, ,$(PATH_ROOT))):
456else
457VBOX_DRIVE_HACK :=
458endif
459$(PATH_TARGET)/VirtualBoxBrand.qrc: \
460 $(VBOX_VIRTUALBOX4_SRC)/VirtualBoxBrand.qrc
461 $(call MSG_GENERATE,VirtualBox4,$<,$@)
462 $(QUIET)$(SED) \
463 -e 's;@VBOX_ABOUT_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_ABOUT_PNG));g' \
464 -e 's;@VBOX_ABOUT_16PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_ABOUT_16PX_PNG));g' \
465 -e 's;@VBOX_VBOX_16PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_VBOX_16PX_PNG));g' \
466 -e 's;@VBOX_VBOX_20PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_VBOX_20PX_PNG));g' \
467 -e 's;@VBOX_VBOX_32PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_VBOX_32PX_PNG));g' \
468 -e 's;@VBOX_VBOX_40PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_VBOX_40PX_PNG));g' \
469 -e 's;@VBOX_VBOX_48PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_VBOX_48PX_PNG));g' \
470 -e 's;@VBOX_VBOX_64PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_VBOX_64PX_PNG));g' \
471 -e 's;@VBOX_CUBE_42PX_PNG@;$(subst $(VBOX_DRIVE_HACK)/,/,$(VBOX_BRAND_GUI_CUBE_42PX_PNG));g' \
472 --output $@ \
473 $<
474
475# alias for generating the COM Wrappers file.
476testwrappers:: $(VBOX_WRAPPERS_FILE4)
477
478
479ifeq ($(KBUILD_TARGET),win)
480#
481# On Windows we'll have to generate/edit the resource file.
482# The IDI_ICON1 name is Qt specific.
483#
484$$(PATH_VirtualBox4)/VirtualBox4.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
485 $(RM) -f $@
486 $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
487
488VirtualBox4_CLEAN.win += $$(PATH_VirtualBox4)/VirtualBox4.rc
489endif # win
490
491
492# If there is the accessible plugin & we are using our home-made qt put it to
493# the output dir
494# @todo: fix this &| add it to the qt4 unit
495# note: it seems that $(PATH_SDK_QT4) isn't defined if this makefile is called
496# from the root VBox directory.
497if1of ($(KBUILD_TARGET),)
498#if1of ($(KBUILD_TARGET),darwin win)
499# Where are the plugins located
500PREFIX=lib
501SUFFIX=
502ifeq ($(KBUILD_TARGET),win)
503PREFIX=
504SUFFIX=4
505endif
506PATH_SDK_QT4_PLUGINS=$(PATH_SDK_QT4)/plugins
507# Generate the target dir
508BLDDIRS=$(PATH_BIN)/accessible/
509OTHERS += \
510 $(PATH_BIN)/accessible/$(PREFIX)qtaccessiblewidgets$(SUFFIX)$(SUFF_DLL)
511endif
512
513ifeq ($(KBUILD_TARGET),darwin)
514#
515# On OS X (darwin) we need to install icon resources and compulsory bundle contents.
516# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
517#
518INSTALLS += VirtualBox4.app
519VirtualBox4.app_INST = $(INST_VIRTUALBOX)Contents/
520VirtualBox4.app_MODE = 644
521VirtualBox4.app_SOURCES = \
522 src/darwin/PkgInfo \
523 $(PATH_VirtualBox4.app)/Info.plist \
524 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
525
526$$(PATH_VirtualBox4.app)/Info.plist: $(PATH_SUB_CURRENT)/src/darwin/Info.plist $(VBOX_VERSION_MK) | $$(@D)/
527 $(call MSG_GENERATE,VirtualBox4.app,$<,$@)
528 $(QUIET)$(RM) -f $@
529 $(QUIET)$(SED) \
530 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
531 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
532 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
533 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
534 $< > $@
535
536INSTALLS += VirtualBox4VM.app
537VirtualBox4VM.app_INST = $(VirtualBox4.app_INST)Resources/VirtualBoxVM.app/Contents/
538VirtualBox4VM.app_MODE = 644
539VirtualBox4VM.app_SOURCES = \
540 src/darwin/VM-PkgInfo=>PkgInfo \
541 $(PATH_VirtualBox4VM.app)/VM-Info.plist=>Info.plist \
542 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
543VirtualBox4VM.app_SYMLINKS = \
544 MacOS=>../../../MacOS/
545
546$$(PATH_VirtualBox4VM.app)/VM-Info.plist: $(PATH_SUB_CURRENT)/src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $$(@D)/
547 $(call MSG_GENERATE,VirtualBox4VM.app,$<,$@)
548 $(QUIET)$(RM) -f $@
549 $(QUIET)$(SED) \
550 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
551 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
552 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
553 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
554 --output $@ $<
555endif # darwin
556
557
558#
559# Testcase for the darwin keyboard routines.
560#
561ifdef VBOX_WITH_TESTCASES
562PROGRAMS.darwin += tstDarwinKeyboard4
563tstDarwinKeyboard4_NAME = tstDarwinKeyboard
564tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
565tstDarwinKeyboard4_INCS = include
566tstDarwinKeyboard4_SOURCES = \
567 src/darwin/tstDarwinKeyboard.cpp \
568 src/darwin/DarwinKeyboard.cpp
569tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
570tstDarwinKeyboard4_LIBS = \
571 $(LIB_RUNTIME)
572endif
573
574
575#
576# Install the license file. Belongs in the root makefile really.
577#
578# Note: I'm doing this right here because the GUI will _not_ run
579# without that file which might be annoying for developers!
580#
581ifndef VBOX_OSE
582ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),)
583$(VBOX_LICENSE_BIN): $(VBOX_BRAND_LICENSE_HTML)
584 $(call MSG_GENERATE,,$@)
585 $(QUIET)$(CP) $< $@
586
587$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
588endif
589endif
590
591
592
593# Unset everything that was loaded from VBoxUI.pro.
594TEMPLATE := $(SAVED_TEMPLATE)
595SAVED_TEMPLATE :=
596LANGUAGE :=
597FORMS :=
598TRANSLATIONS :=
599IMAGES :=
600
601
602# Commit the magic.
603# (note: before custom rules that make usage of generated variables!).
604include $(KBUILD_PATH)/subfooter.kmk
605
606$(PATH_BIN)/accessible/$(PREFIX)qtaccessiblewidgets$(SUFFIX)$(SUFF_DLL): $(PATH_SDK_QT4_PLUGINS)/accessible/$(PREFIX)qtaccessiblewidgets$(SUFFIX)$(SUFF_DLL) | $$(dir $$@)
607 $(INSTALL) -m 0644 $< ${@}
608ifeq ($(KBUILD_TARGET), darwin)
609 install_name_tool \
610 -change QtCore.framework/Versions/4/QtCore \
611 @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore \
612 -change QtGui.framework/Versions/4/QtGui \
613 @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui \
614 ${@}
615endif
616
617#
618# Update all known NLS translation (.ts) files in the nls/ subdirectory.
619#
620# NOTE: This target is intended to be run only by the GUI maintainer shortly
621# before a new product release. VirtualBox_xx_YY.ts is a template for new
622# languages and should never be actually translated or installed.
623#
624updatenls:: \
625 $(filter-out %.qrc,$(VirtualBox4_SOURCES) $(VirtualBox4_VBOX_EXTRA_NLS_SOURCES)) \
626 $(wildcard include/*.h)
627 $(call MSG_L1,lupdate all languages (nls/*.ts))
628 $(QUIET)$(TOOL_QT4_LUPDATE) \
629 $^ \
630 -ts \
631 $(filter-out nls/qt_%.ts,$(VirtualBox4_QT_TRANSLATIONS)) \
632 nls/VirtualBox_xx_YY.ts
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