VirtualBox

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

Last change on this file since 12102 was 12102, checked in by vboxsync, 17 years ago

VirtualBox4/Makefile: prefix all property inventions like this with VBOX_!

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette