VirtualBox

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

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

no more QT_UISRCS, it all in SOURCES now.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 24.3 KB
Line 
1# $Id: Makefile.kmk 10622 2008-07-15 00:16:10Z 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
22DEPTH = ../../../..
23include $(KBUILD_PATH)/header.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# Disable the debugger for now, this is another story.
42VBOX_WITH_DEBUGGER_GUI :=
43DEFS := $(filter-out VBOX_WITH_DEBUGGER_GUI,$(DEFS))
44
45# Guess VBOX_WITH_QT4_SUN
46ifndef VBOX_WITH_QT4_SUN
47 ifndef VBOX_OSE
48 if1of ($(KBUILD_TARGET), darwin solaris win)
49 VBOX_WITH_QT4_SUN := 1
50 endif
51 endif
52endif
53
54#
55# Handmade configuration of qt4 - very annoying, this needs to
56# be cleaned up properly later some time (not important now).
57#
58ifeq ($(VBOX_PATH_QT4),)
59 ifeq ($(KBUILD_TARGET),darwin)
60 VBOX_PATH_QT4 := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
61 ifeq ($(VBOX_PATH_QT4),)
62 ifneq ($(wildcard /Library/Frameworks/QtCore.framework),)
63 # Using the global installation (for OSE).
64 VBOX_PATH_QT4 ?= /usr
65 VBOX_PATH_QT4_FRAMEWORKS ?= /Library/Frameworks
66 endif
67 endif
68 else if1of ($(KBUILD_TARGET),win)
69 VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
70 else if1of ($(KBUILD_TARGET),solaris)
71 VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
72 ifneq ($(VBOX_PATH_QT4),)
73 VBOX_WITH_QT4_SUN = 1
74 endif
75 endif
76endif
77ifeq ($(VBOX_PATH_QT4),)
78 if1of ($(USERNAME), bird)
79 # gentoo (64-bit)
80 VBOX_PATH_QT4 ?= /usr
81 VBOX_PATH_QT4_LIB ?= /usr/lib/qt4
82 endif
83endif
84VBOX_PATH_QT4 ?= /usr
85VBOX_PATH_QT4_LIB ?= $(VBOX_PATH_QT4)/lib
86
87# Hack LD_LIBRARY_PATH for stuff in tools.
88ifdef VBOX_WITH_QT4_SUN
89 if1of ($(KBUILD_TARGET), linux)
90 export LD_LIBRARY_PATH := $(VBOX_PATH_QT4_LIB):$(LD_LIBRARY_PATH)
91 endif
92endif
93
94
95ifdef VBOX_WITH_QT4_SUN
96#
97# Install our Qt DLLs / Shared Objects / Frameworks.
98#
99## @todo move to the root Makefile.kmk, and remove qt4-bin from INSTALLS below.
100 INSTALLS += qt4-bin
101 qt4-bin_MODE = 644
102 ifeq ($(KBUILD_TARGET),darwin)
103 qt4-bin_INST = $(INST_VIRTUALBOX)Contents/Frameworks/
104 qt4-bin_SOURCES = \
105 $(VBOX_PATH_QT4)/Frameworks/QtCore.framework/Versions/4/QtCore=>QtCore.framework/Versions/4/QtCore \
106 $(VBOX_PATH_QT4)/Frameworks/QtGui.framework/Versions/4/QtGui=>QtGui.framework/Versions/4/QtGui
107 else ifeq ($(KBUILD_TARGET),win)
108 qt4-bin_INST = $(INST_BIN)
109 qt4-bin_SOURCES = \
110 $(VBOX_PATH_QT4_LIB)/VBoxQtCore4.dll \
111 $(VBOX_PATH_QT4_LIB)/VBoxQtGui4.dll
112 else
113 qt4-bin_INST = $(INST_BIN)
114 qt4-bin_SOURCES = \
115 $(VBOX_PATH_QT4_LIB)/libVBoxQtCore.so.4 \
116 $(VBOX_PATH_QT4_LIB)/libVBoxQtGui.so.4
117 endif
118endif # VBOX_WITH_QT4_SUN
119
120
121# Template copy from the qt3 stuff. Appended a "4" on the
122# relevant places.
123
124#
125# Template for building Qt GUI executables.
126#
127
128TEMPLATE_VBOXQT4GUIEXE = VBox Qt4 GUI Executable
129USES += qt4
130TEMPLATE_VBOXQT4GUIEXE_USES = qt4
131TEMPLATE_VBOXQT4GUIEXE_QTTOOL = QT4
132TEMPLATE_VBOXQT4GUIEXE_MOCTOOL = QT4
133TEMPLATE_VBOXQT4GUIEXE_UICTOOL = QT4
134TEMPLATE_VBOXQT4GUIEXE_RCCTOOL = QT4
135TEMPLATE_VBOXQT4GUIEXE_LRCTOOL = QT4
136TEMPLATE_VBOXQT4GUIEXE_SDKS = QT4
137ifdef VBOX_WITH_QT4_SUN
138 ifneq ($(KBUILD_TARGET),darwin) ## @todo The next darwin build should also make use the prefix just to make things more uniform.
139 TEMPLATE_VBOXQT4GUIEXE_QT_PREFIX = VBox
140 endif
141endif
142TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT QT_SHARED HAVE_CONFIG_H $(ARCH_BITS_DEFS)
143TEMPLATE_VBOXQT4GUIEXE_INCS = \
144 $(VBOX_PATH_SDK)/include
145
146ifeq ($(KBUILD_TARGET),win)
147 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
148 TEMPLATE_VBOXQT4GUIEXE_DEFS += \
149 _WIN32_WINNT=0x0500 UNICODE _UNICODE \
150 QT_DLL _CRT_SECURE_NO_DEPRECATE \
151 $(QMAKE_PRL_DEFINES)
152 ## @todo VCC70 flags?
153 ifdef VBOX_USE_VCC80
154 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
155 -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
156 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
157 else
158 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
159 -nologo -Zm200 -W3 -MD -Zi -GX
160 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
161 endif
162 TEMPLATE_VBOXQT4GUIEXE_INCS += \
163 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
164 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
165 /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
166 /DELAYLOAD:oleaut32.dll
167 TEMPLATE_VBOXQT4GUIEXE_SDKS += WINPSDK
168 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
169 $(VBOX_LIBS_QT4) \
170 $(LIB_RUNTIME) \
171 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
172 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
173 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
174 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
175 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
176 TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
177
178else # the gcc guys:
179 TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
180 TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
181
182 TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
183
184 TEMPLATE_VBOXQT4GUIEXE_INCS += \
185 $(LIB_SDL_INC)
186 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
187 -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
188 -Wno-long-long -fshort-wchar -fno-strict-aliasing \
189 $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
190 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
191 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
192 TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
193 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
194 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
195 TEMPLATE_VBOXQT4GUIEXE_LIBS = \
196 $(VBOX_LIBS_QT4) \
197 $(LIB_SDL) \
198 $(LIB_RUNTIME) \
199 $(LIB_REM) \
200 $(LIB_VMM)
201
202 ifeq ($(KBUILD_TARGET),linux)
203 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
204 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
205 $(VBOX_XCURSOR_LIBS)
206 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
207 $(VBOX_LIBPATH_X11)
208 else ifeq ($(KBUILD_TARGET),darwin)
209 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
210 TEMPLATE_VBOXQT4GUIEXE_LIBS +=
211 TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
212 else
213 TEMPLATE_VBOXQT4GUIEXE_INCS += \
214 $(VBOX_XCURSOR_INCS)
215 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
216 $(VBOX_XCURSOR_LIBS) \
217 Xext \
218 X11 \
219 m \
220 $(LIB_PTHREAD)
221 TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
222 $(VBOX_LIBPATH_X11)
223 ifeq ($(KBUILD_TARGET),freebsd)
224 TEMPLATE_VBOXQT4GUIEXE_INCS += \
225 /usr/include \
226 /usr/X11R6/include \
227 /usr/local/include
228 endif
229 ifeq ($(KBUILD_TARGET),solaris)
230 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
231 rt socket nsl
232 endif
233 ifdef VBOX_WITH_ORIGIN
234 # Assume the Qt shared objects are in the same directory as the executable, on Solaris too.
235 TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)'
236 endif
237 endif
238
239endif
240
241# Add COM/XPCOM stuff
242TEMPLATE_VBOXQT4GUIEXE_LIBS += \
243 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
244ifdef VBOX_WITH_XPCOM
245 ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM.
246 TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
247 TEMPLATE_VBOXQT4GUIEXE_INCS += \
248 $(VBOX_XPCOM_INCS)
249 TEMPLATE_VBOXQT4GUIEXE_LIBS += \
250 $(LIB_XPCOM)
251endif
252
253#
254# Template for building Qt GUI components.
255#
256TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
257TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQTGUIEXE
258TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
259ifeq ($(KBUILD_TARGET),darwin)
260 TEMPLATE_VBOXQT4GUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS))
261endif
262ifeq ($(filter-out solaris.x86 %.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),)
263 ifneq ($(KBUILD_TARGET),win)
264 TEMPLATE_VBOXQT4GUI_DEFS = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
265 TEMPLATE_VBOXQT4GUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
266 TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
267 TEMPLATE_VBOXQT4GUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
268 endif
269endif
270
271
272#
273# The targets.
274#
275PROGRAMS += VirtualBox4
276ifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
277 DLLS += VBoxKeyboard
278 ## @todo convert to install target.
279 OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
280 CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
281endif
282INSTALLS += VirtualBox4.nls
283
284
285#
286# VBoxKeyboard - keyboard library for X11.
287#
288VBoxKeyboard_TEMPLATE = VBOXR3
289VBoxKeyboard_SOURCES = \
290 src/linux/keyboard-new.c
291VBoxKeyboard_LIBS = X11
292VBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
293
294
295#
296# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
297# redistributed with usable sources.
298#
299# This rule will link create a temporary symlink to src/linux/ and tar
300# up the selected files into a tarball that is installed into the
301# bin directory (probably belongs in /usr/shared/somewhere really,
302# but wtf, it's not like we're even trying to be FHS compliant).
303#
304## @todo this should be tar'ed down into the output directory and installed using an install target.
305$(PATH_BIN)/vboxkeyboard.tar.gz: \
306 $(VBoxKeyboard_SOURCES) \
307 src/linux/COPYING.LIB \
308 src/linux/keyboard.h \
309 src/linux/keyboard-layouts.h \
310 src/linux/keyboard-list.h \
311 src/linux/keyboard-tables.h \
312 src/linux/keyboard-types.h \
313 src/linux/Makefile
314 $(call MSG_TOOL,tar/gzip,,$@)
315 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard $@
316 $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/linux/ $(PATH_TARGET)/vboxkeyboard
317 $(QUIET)cd $(PATH_TARGET) \
318 && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
319 | gzip - > $@
320 $(QUIET2)$(RM) -f $(PATH_TARGET)/vboxkeyboard
321
322
323#
324# Include Qt project file, we'll use FORMS and TRANSLATIONS in
325# the VirtualBox4 setup below.
326#
327SAVED_TEMPLATE := $(TEMPLATE)
328include $(PATH_SUB_CURRENT)/VBoxUI.pro
329
330
331#
332# VirtualBox4 - The GUI program.
333#
334VirtualBox4_TEMPLATE = VBOXQT4GUIEXE
335VirtualBox4_NAME = VirtualBox
336VirtualBox4_SDKS.win = WINPSDK DXSDK
337ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
338 VirtualBox4_SDKS += LIBSDL
339endif
340
341ifeq ($(KBUILD_TARGET),darwin)
342 # For the launch trick we need different inode numbers.
343 VirtualBox4_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
344
345 # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
346 ifdef VBOX_WITH_ICHAT_THEATER
347 VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
348 endif
349endif # darwin
350
351VirtualBox4_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
352VirtualBox4_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
353VirtualBox4_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
354VirtualBox4_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
355VirtualBox4_DEFS.linux = VBOX_GUI_USE_SDL
356VirtualBox4_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
357VirtualBox4_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
358VirtualBox4_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
359VirtualBox4_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
360VirtualBox4_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
361#ifndef VBOX_OSE
362## @todo VBOX_WITH_HACKED_QT doesn't apply to Qt4, so why is this still here?
363 VirtualBox4_DEFS.darwin += VBOX_WITH_HACKED_QT
364#endif
365ifdef VBOX_WITH_ICHAT_THEATER
366 VirtualBox4_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
367endif
368ifneq ($(KBUILD_TYPE),release)
369 # non-release builds has some extra features.
370 VirtualBox4_DEFS.win += VBOX_GUI_USE_DDRAW
371 VirtualBox4_DEFS.linux += VBOX_GUI_USE_QIMAGE
372endif
373ifdef VBOX_WITH_REGISTRATION
374 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION
375endif
376ifdef VBOX_WITH_REGISTRATION_REQUEST
377 VirtualBox4_DEFS += VBOX_WITH_REGISTRATION_REQUEST
378endif
379ifdef VBOX_WITH_UPDATE_REQUEST
380 VirtualBox4_DEFS += VBOX_WITH_UPDATE_REQUEST
381endif
382ifdef VBOX_WITH_ALSA
383 VirtualBox4_DEFS += VBOX_WITH_ALSA
384endif
385ifdef VBOX_WITH_PULSE
386 VirtualBox4_DEFS += VBOX_WITH_PULSE
387endif
388ifdef VBOX_WITH_E1000
389 VirtualBox4_DEFS += VBOX_WITH_E1000
390endif
391ifdef VBOX_OSE
392 VirtualBox4_DEFS += VBOX_OSE
393endif
394ifdef VBOX_WITH_DEBUGGER_GUI
395 VirtualBox4_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
396endif
397
398VirtualBox4_INCS = \
399 ./include \
400 $(PATH_VirtualBox4)/include
401
402ifeq ($(KBUILD_TYPE),release)
403 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
404else
405 VirtualBox4_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
406 ifeq ($(USERNAME),dmik)
407 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:windows
408 else
409 VirtualBox4_LDFLAGS.win += /SUBSYSTEM:console
410 endif
411endif
412# r=bird: what is -lz doing here? it belongs in LIBS
413VirtualBox4_LDFLAGS.darwin = -framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -lz
414ifdef VBOX_WITH_ICHAT_THEATER
415 VirtualBox4_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
416endif
417VirtualBox4_LIBS.win = \
418 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
419 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
420 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
421ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
422 VirtualBox4_LIBS += $(PATH_DLL)/VBoxKeyboard$(VBOX_SUFF_DLL)
423endif
424
425ifdef VBOX_WITH_DEBUGGER_GUI ## @todo make this dynamically loadable and ship with release builds too.
426 ifeq ($(KBUILD_TARGET),win)
427 VirtualBox4_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
428 else
429 VirtualBox4_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
430 endif
431endif
432
433
434# Headers containing definitions of classes that use the Q_OBJECT macro.
435VirtualBox4_QT_MOCHDRS = \
436 include/QIWidgetValidator.h \
437 include/QIHotKeyEdit.h \
438 include/QIStatusBar.h \
439 include/QIStateIndicator.h \
440 include/QIMessageBox.h \
441 include/QILabel.h \
442 include/QILabel_p.h \
443 include/QIAbstractWizard.h \
444 include/QIListView.h \
445 include/QITreeWidget.h \
446 include/QIMainDialog.h \
447 include/QIHelpButton.h \
448 include/VBoxUtils.h \
449 include/VBoxGlobalSettings.h \
450 include/VBoxGlobal.h \
451 include/VBoxVMListView.h \
452 include/VBoxMediaComboBox.h \
453 include/VBoxSelectorWnd.h \
454 include/VBoxConsoleWnd.h \
455 include/VBoxConsoleView.h \
456 include/VBoxProblemReporter.h \
457 include/VBoxDownloaderWgt.h \
458 include/VBoxNetworkFramework.h \
459 include/VBoxAboutDlg.h \
460 include/VBoxCloseVMDlg.h \
461 include/VBoxNewVMWzd.h \
462 include/VBoxNewHDWzd.h \
463 include/VBoxVMFirstRunWzd.h \
464 include/VBoxRegistrationDlg.h \
465 include/VBoxUpdateDlg.h \
466 include/VBoxSnapshotDetailsDlg.h \
467 include/VBoxVMInformationDlg.h \
468 include/VBoxTakeSnapshotDlg.h \
469 include/VBoxSnapshotsWgt.h \
470 include/VBoxVMLogViewer.h \
471 include/VBoxDiskImageManagerDlg.h \
472 include/VBoxSettingsUtils.h \
473 include/VBoxVMSettingsGeneral.h \
474 include/VBoxVMSettingsHD.h \
475 include/VBoxVMSettingsCD.h \
476 include/VBoxVMSettingsFD.h \
477 include/VBoxVMSettingsAudio.h \
478 include/VBoxVMSettingsNetwork.h \
479 include/VBoxVMSettingsSerial.h \
480 include/VBoxVMSettingsParallel.h \
481 include/VBoxVMSettingsUSB.h \
482 include/VBoxVMSettingsSF.h \
483 include/VBoxVMSettingsVRDP.h \
484 include/VBoxGLSettingsGeneral.h \
485 include/VBoxGLSettingsInput.h \
486 include/VBoxGLSettingsUpdate.h \
487 include/VBoxGLSettingsLanguage.h \
488 include/VBoxSettingsDialog.h \
489 include/VBoxSettingsDialogSpecific.h \
490 include/VBoxSettingsPage.h \
491 include/VBoxSettingsSelector.h
492
493# Sources containing local definitions of classes that use the Q_OBJECT macro.
494VirtualBox4_QT_MOCSRCS = \
495 src/VBoxSelectorWnd.cpp
496ifdef VBOX_WITH_XPCOM
497 VirtualBox4_QT_MOCSRCS += \
498 src/COMDefs.cpp
499endif
500
501VirtualBox4_SOURCES = \
502 src/main.cpp \
503 src/COMDefs.cpp \
504 src/QIWidgetValidator.cpp \
505 src/QIHotKeyEdit.cpp \
506 src/QIStateIndicator.cpp \
507 src/QIStatusBar.cpp \
508 src/QIMessageBox.cpp \
509 src/QILabel.cpp \
510 src/QIAbstractWizard.cpp \
511 src/QIDialog.cpp \
512 src/QIDialogButtonBox.cpp \
513 src/QIListView.cpp \
514 src/QITreeWidget.cpp \
515 src/QIMainDialog.cpp \
516 src/QILineEdit.cpp \
517 src/QIHelpButton.cpp \
518 src/VBoxDefs.cpp \
519 src/VBoxGlobalSettings.cpp \
520 src/VBoxGlobal.cpp \
521 src/VBoxMediaComboBox.cpp \
522 src/VBoxProblemReporter.cpp \
523 src/VBoxSelectorWnd.cpp \
524 src/VBoxConsoleView.cpp \
525 src/VBoxConsoleWnd.cpp \
526 src/VBoxDownloaderWgt.cpp \
527 src/VBoxVMListView.cpp \
528 src/VBoxFrameBuffer.cpp \
529 src/HappyHttp.cpp \
530 src/VBoxNetworkFramework.cpp \
531 src/VBoxAboutDlg.cpp \
532 src/VBoxCloseVMDlg.cpp \
533 src/VBoxNewVMWzd.cpp \
534 src/VBoxNewHDWzd.cpp \
535 src/VBoxVMFirstRunWzd.cpp \
536 src/VBoxRegistrationDlg.cpp \
537 src/VBoxUpdateDlg.cpp \
538 src/VBoxSnapshotDetailsDlg.cpp \
539 src/VBoxVMInformationDlg.cpp \
540 src/VBoxTakeSnapshotDlg.cpp \
541 src/VBoxSnapshotsWgt.cpp \
542 src/VBoxVMLogViewer.cpp \
543 src/VBoxDiskImageManagerDlg.cpp \
544 src/VBoxVMSettingsGeneral.cpp \
545 src/VBoxVMSettingsHD.cpp \
546 src/VBoxVMSettingsCD.cpp \
547 src/VBoxVMSettingsFD.cpp \
548 src/VBoxVMSettingsAudio.cpp \
549 src/VBoxVMSettingsNetwork.cpp \
550 src/VBoxVMSettingsSerial.cpp \
551 src/VBoxVMSettingsParallel.cpp \
552 src/VBoxVMSettingsUSB.cpp \
553 src/VBoxVMSettingsSF.cpp \
554 src/VBoxVMSettingsVRDP.cpp \
555 src/VBoxGLSettingsGeneral.cpp \
556 src/VBoxGLSettingsInput.cpp \
557 src/VBoxGLSettingsUpdate.cpp \
558 src/VBoxGLSettingsLanguage.cpp \
559 src/VBoxSettingsDialog.cpp \
560 src/VBoxSettingsDialogSpecific.cpp \
561 src/VBoxSettingsSelector.cpp
562
563ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11
564 ifndef VBOX_OSE
565 VirtualBox4_QT_MOCHDRS += \
566 include/VBoxLicenseViewer.h
567 VirtualBox4_SOURCES += \
568 src/VBoxLicenseViewer.cpp
569 endif
570 VirtualBox4_SOURCES += \
571 src/linux/XKeyboard-new.cpp
572endif
573
574VirtualBox4_SOURCES.win += \
575 src/VBoxFBDDRAW.cpp \
576 $(PATH_TARGET)/VirtualBox4.rc
577
578VirtualBox4_SOURCES.darwin = \
579 src/darwin/DarwinKeyboard.cpp \
580 src/darwin/DarwinCursor.cpp \
581 src/darwin/VBoxUtils-darwin.cpp \
582 src/VBoxFBQuartz2D.cpp
583# src/darwin/VBoxAquaStyle.cpp
584
585ifdef VBOX_WITH_ICHAT_THEATER
586 VirtualBox4_SOURCES.darwin += \
587 src/darwin/VBoxIChatTheaterWrapper.m
588endif
589
590# The Qt modules we're using.
591# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
592VirtualBox4_QT_MODULES = Core Gui
593
594# Import QDesigner UI sources and translations from VBoxUI.pro.
595# Note that the OSE about dialog is always required by lupdate/lrelease.
596ifndef VBOX_WITH_REGISTRATION
597 FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
598endif
599VirtualBox4_SOURCES := \
600 $(VirtualBox4_SOURCES) \
601 $(FORMS) \
602 ui/VBoxAboutDlg.ui
603
604# Resource files with some OSE differences.
605VirtualBox4_SOURCES += VirtualBox.qrc
606ifdef VBOX_OSE
607 VirtualBox4_SOURCES += VirtualBox_OSE.qrc
608else
609 VirtualBox4_SOURCES += VirtualBox_NonOSE.qrc
610 VirtualBox4_SOURCES += src/VBoxAboutNonOSEDlg.cpp
611 VirtualBox4_QT_MOCHDRS += include/VBoxAboutNonOSEDlg.h
612endif
613VirtualBox_OSE.qrc_RCCFLAGS = -name OSE
614VirtualBox_NonOSE.qrc_RCCFLAGS = -name NonOSE
615
616
617# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
618VirtualBox4_QT_TRANSLATIONS := $(TRANSLATIONS) \
619 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts, $(filter nls/VirtualBox_%.ts,$(TRANSLATIONS)))
620# Compress the translation units.
621VirtualBox4_LRCFLAGS = -compress
622# Where to install the translations (a separate install target, VirtualBox4-nls-inst is created).
623VirtualBox4_QT_TRANSLATIONS_INST = $(INST_BIN)nls/
624
625
626
627# Some flag hacks (should go away).
628ifneq ($(KBUILD_TARGET),win)
629 src/HappyHttp.cpp_CXXFLAGS += -fexceptions
630 src/VBoxDownloaderWgt.cpp_CXXFLAGS += -fexceptions
631 src/VBoxNetworkFramework.cpp_CXXFLAGS += -fexceptions
632endif
633src/HappyHttp.cpp_CXXFLAGS.linux += -O2
634
635## @todo how to detect what tool is used?
636## @todo GCC3 seems to lack -Wno-missing-base-class-initializer, so we use
637# more generic -Wno-extra
638# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
639ifdef VBOX_WITH_XPCOM
640 src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
641endif
642
643
644
645#
646# On Windows we'll have to generate/edit the resource file.
647# The IDI_ICON1 name is Qt specific.
648#
649$(PATH_TARGET)/VirtualBox4.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
650 $(RM) -f $@
651 $(APPEND) $@ 'IDI_ICON1 ICON "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
652
653VirtualBox4_CLEAN.win += $(PATH_TARGET)/VirtualBox4.rc
654
655
656#
657# Other stuff.
658#
659VBOX_WRAPPERS_FILE4 = $(PATH_VirtualBox4)/include/COMWrappers.h
660VirtualBox4_BLDDIRS += $(PATH_VirtualBox4)/include/
661VirtualBox4_INTERMEDIATES = $(VBOX_WRAPPERS_FILE4)
662
663VBOX_WRAPPERS_INC_FILE4 = include/COMDefs.h
664VBOX_WRAPPERS_TEMPLATE4 = include/COMWrappers.xsl
665VBOX_WRAPPERS_XIDLFILE4 = ../../Main/idl/VirtualBox.xidl
666
667
668
669# generated files we need to clean manually
670OTHER_CLEAN = \
671 $(VirtualBox4_GENSRCS) \
672 $(VirtualBox4_GENHDRS) \
673 $(VBOX_WRAPPERS_FILE4) \
674 $(PATH_BIN)/vboxkeyboard.tar.gz
675
676
677#
678# On OS X (darwin) we need to install icon resources and compusory bundle contents.
679# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
680#
681INSTALLS.darwin += VirtualBox.app
682VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
683VirtualBox.app_MODE = 644
684VirtualBox.app_SOURCES = \
685 src/darwin/PkgInfo \
686 $(PATH_TARGET)/Info.plist \
687 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
688
689$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
690 $(call MSG_GENERATE,VirtualBox.app,$<,$@)
691 $(QUIET)$(RM) -f $@
692 $(QUIET)$(SED) \
693 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
694 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
695 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
696 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
697 $< > $@
698
699INSTALLS.darwin += VirtualBoxVM.app
700VirtualBoxVM.app_INST = $(VirtualBox.app_INST)Resources/VirtualBoxVM.app/Contents/
701VirtualBoxVM.app_MODE = 644
702VirtualBoxVM.app_SOURCES = \
703 src/darwin/VM-PkgInfo=>PkgInfo \
704 $(PATH_TARGET)/VM-Info.plist=>Info.plist \
705 $(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
706VirtualBoxVM.app_SYMLINKS = \
707 MacOS=>../../../MacOS/
708
709$(PATH_TARGET)/VM-Info.plist: src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
710 $(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
711 $(QUIET)$(RM) -f $@
712 $(QUIET)$(SED) \
713 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
714 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
715 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
716 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
717 --output $@ $<
718
719#
720# Testcase for the darwin keyboard routines.
721#
722ifdef VBOX_WITH_TESTCASES
723PROGRAMS.darwin += tstDarwinKeyboard4
724tstDarwinKeyboard4_NAME = tstDarwinKeyboard
725tstDarwinKeyboard4_TEMPLATE = VBOXR3TSTEXE
726tstDarwinKeyboard4_INCS = include
727tstDarwinKeyboard4_SOURCES = \
728 src/darwin/tstDarwinKeyboard.cpp \
729 src/darwin/DarwinKeyboard.cpp
730tstDarwinKeyboard4_LDFLAGS = -framework IOKit -framework Carbon
731tstDarwinKeyboard4_LIBS = \
732 $(LIB_RUNTIME)
733endif
734
735
736#
737# Install the license file. Belongs in the root makefile really.
738#
739# Note: I'm doing this right here because the GUI will _not_ run
740# without that file which might be annoying for developers!
741#
742ifndef VBOX_OSE
743ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),)
744$(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
745 $(call MSG_GENERATE,,$@)
746 $(QUIET)$(CP) $< $@
747
748$(PATH_BIN)/VirtualBox: $(VBOX_LICENSE_BIN)
749endif
750endif
751
752
753
754# Unset everything that was loaded from VBoxUI.pro.
755TEMPLATE := $(SAVED_TEMPLATE)
756SAVED_TEMPLATE :=
757LANGUAGE :=
758FORMS :=
759TRANSLATIONS :=
760IMAGES :=
761
762
763# Commit the magic.
764# (note: before custom rules that make usage of generated variables!).
765include $(KBUILD_PATH)/footer.kmk
766
767
768#
769# Generate the COM wrappers.
770#
771$(VBOX_WRAPPERS_INC_FILE4): $(VBOX_WRAPPERS_FILE4)
772
773$(VBOX_WRAPPERS_FILE4): $(VBOX_WRAPPERS_XIDLFILE4) $(VBOX_WRAPPERS_TEMPLATE4) | $(call DIRDEP,$(PATH_VirtualBox4)/include/)
774 $(call MSG_TOOL,xsltproc,VirtualBox4,$<,$@)
775 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_WRAPPERS_TEMPLATE4) $<
776
777
778#
779# Update all known NLS translation (.ts) files in the nls/ subdirectory.
780#
781# NOTE: This target is intened to be run only by the GUI maintainer shortly
782# before a new product release. VirtualBox_xx_YY.ts is a template for new
783# languages and should never be actually translated or installed.
784#
785updatenls:: \
786 $(filter-out %.qrc,$(VirtualBox4_SOURCES)) \
787 $(wildcard include/*.h)
788 $(call MSG_L1,lupdate all languages (nls/*.ts))
789 $(QUIET)$(TOOL_QT4_LUPDATE) \
790 $^ \
791 -ts \
792 $(filter-out nls/qt_%.ts,$(VirtualBox4_QT_TRANSLATIONS)) \
793 nls/VirtualBox_xx_YY.ts
794
795
796# alias for generating the COM Wrappers file.
797testwrappers:: $(VBOX_WRAPPERS_FILE4)
798
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