Makefile.kmk revision abe070d63d73c4ea76ec1a7faa6760c3ccfbe3ae
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Makefile for the VirtualBox Qt GUI.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# available from http://www.virtualbox.org. This file is free software;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# you can redistribute it and/or modify it under the terms of the GNU
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# General Public License (GPL) as published by the Free Software
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# additional information or have any questions.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSUB_DEPTH = ../../../..
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinclude $(KBUILD_PATH)/subheader.kmk
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBOX_VIRTUALBOX4_SRC := $(PATH_SUB_CURRENT)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBOX_VIRTUALBOX4_OUT_DIR := $(PATH_TARGET)/VirtualBox/misc
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBOX_WITH_REGISTRATION := 1
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Ask the user to register at Sun. If this setting is disabled the user can
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# still register using the menu if desired.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBOX_WITH_REGISTRATION_REQUEST := 1
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Show the update notifier dialog during startup. If this setting is disabled
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# the user can still update using the menu if desired.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBOX_WITH_UPDATE_REQUEST := 1
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# The targets.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifdef VBOX_WITH_HARDENING
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncPROGRAMS += VirtualBoxHardened
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncDLLS += VirtualBox
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncPROGRAMS += VirtualBox
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync DLLS += VBoxKeyboard
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ## @todo convert to install target.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Include the language lists.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinclude $(PATH_SUB_CURRENT)/nls/ApprovedLanguages.kmk
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# VBoxKeyboard - keyboard library for X11.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBoxKeyboard_TEMPLATE = VBOXR3
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBoxKeyboard_SOURCES = \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBoxKeyboard_LIBS = X11
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# redistributed with usable sources.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# This rule will link create a temporary symlink to src/X11/ and tar
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# up the selected files into a tarball that is installed into the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# bin directory (probably belongs in /usr/shared/somewhere really,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# but wtf, it's not like we're even trying to be FHS compliant).
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync## @todo this should be tar'ed down into the output directory and installed using an install target.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync$(PATH_BIN)/vboxkeyboard.tar.gz: $(abspathex \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(VBoxKeyboard_SOURCES) \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ,$(PATH_SUB_CURRENT)) | $(PATH_TARGET)/VBoxKeyboard/
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(call MSG_TOOL,tar/gzip,,$@)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard $@
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/X11/ $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(QUIET)cd $(PATH_TARGET)/VBoxKeyboard \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync | gzip - > $@
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncOTHER_CLEAN += \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Hardened VirtualBox.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBoxHardened_TEMPLATE = VBOXR3HARDENEDEXE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBoxHardened_SOURCES = src/hardenedmain.cpp
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBoxHardened_NAME = VirtualBox
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync #VirtualBoxHardened_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync VirtualBoxHardened_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Include Qt project file, we'll use FORMS and TRANSLATIONS in
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# the VirtualBox setup below.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSAVED_TEMPLATE := $(TEMPLATE)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinclude $(PATH_SUB_CURRENT)/VBoxUI.pro
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# VirtualBox - The GUI program.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXQT4GUI,VBOXQT4GUIEXE)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_NAME = VirtualBox
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifndef VBOX_WITH_HARDENING # For the launch trick we need different inode numbers.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync #VirtualBox_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync VirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync VirtualBox_SDKS += LIBSDL
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifdef VBOX_WITH_ICHAT_THEATER
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS.debug = VBOX_CHECK_STATE # QT_FATAL_ASSERT
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifndef VBOX_WITH_COCOA_QT
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS.darwin.x86= USE_HID_FOR_MODIFIERS
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS.linux = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
VirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
VirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
VirtualBox_DEFS.darwin.x86 += VBOX_WITH_HACKED_QT
VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
VirtualBox_LDFLAGS.darwin = -lz \
-framework IOKit -framework AppKit -framework ApplicationServices -framework Foundation -framework Carbon \
$(if $(VBOX_WITH_HARDENING),-install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VirtualBox.dylib)
VirtualBox_LDFLAGS.darwin.x86 = -framework QuickTime
VirtualBox_LDFLAGS.darwin += -framework InstantMessage -framework QuartzCore
VirtualBox_LDFLAGS.darwin += -framework OpenGL
$(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
$(PATH_SDK_DXSDK_LIB)/ddraw.lib \
$(PATH_SDK_DXSDK_LIB)/dxguid.lib
VirtualBox_LIBS.solaris += GL
# (The include directory and lib/framework for each module will be added by the Qt4 unit.)
# Import QDesigner UI sources and translations from VBoxUI.pro.
FORMS := $(filter-out ui/VBoxRegistrationDlg.ui,$(FORMS))
# Resource files with some OSE differences (VirtualBoxBrand.qrc is created further down).
VirtualBox_SOURCES += VirtualBox.qrc
VirtualBox_SOURCES += $(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc
$(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc_RCCFLAGS = -name BRAND
VirtualBox_SOURCES += VirtualBoxShaders.qrc
VirtualBoxShaders.qrc_RCCFLAGS = -name SHADERS
# Import the translation source from VBoxUI.pro and add the qt_xx_YY counterparts
# bird: What about $(if $(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-missing-base-class-initializer),$(VBOX_GCC_Wno-extra))?
VirtualBox_src/COMDefs.cpp_CXXFLAGS = $(VBOX_GCC_Wno-extra)
VirtualBox_INTERMEDIATES += $(PATH_VirtualBox)/include/COMWrappers.h
VirtualBox_CLEAN += $(PATH_VirtualBox)/include/COMWrappers.h
$$(PATH_VirtualBox)/include/COMWrappers.h: \
$(VBOX_VIRTUALBOX4_SRC)/include/COMWrappers.xsl \
$(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_VIRTUALBOX4_SRC)/include/COMWrappers.xsl $<
testwrappers:: $$(PATH_VirtualBox)/include/COMWrappers.h
VirtualBox_CLEAN += $(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc
$(VBOX_VIRTUALBOX4_OUT_DIR)/VirtualBoxBrand.qrc: \
$(VBOX_VIRTUALBOX4_SRC)/VirtualBoxBrand.qrc \
# On Windows we'll have to generate/edit part of the resource file.
src/win/VirtualBox.rc_INCS = $(PATH_VirtualBox)
$$(PATH_VirtualBox)/VirtualBox-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
INSTALLS += VirtualBox.lproj
VirtualBox.lproj_MODE = 755
VirtualBox.lproj_DIRS := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES_ALL))
# The VirtualBoxVM.app helper is for launching VMs (fixes some issues with the dock).
INSTALLS += VirtualBox.app
VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
VirtualBox.app_MODE = 644
$(VBOX_MACOSX_ICON_FILE)=>Resources/virtualbox.icns
$$(PATH_VirtualBox.app)/Info.plist: $(PATH_SUB_CURRENT)/src/darwin/Info.plist $(VBOX_VERSION_MK) | $$(@D)/
$(call MSG_GENERATE,VirtualBox.app,$<,$@)
INSTALLS += VirtualBoxVM.app
VirtualBoxVM.app_MODE = 644
src/darwin/VM-PkgInfo=>PkgInfo \
$$(PATH_VirtualBoxVM.app)/VM-Info.plist: $(PATH_SUB_CURRENT)/src/darwin/VM-Info.plist $(VBOX_VERSION_MK) | $$(@D)/
$(call MSG_GENERATE,VirtualBoxVM.app,$<,$@)
PROGRAMS.darwin += tstDarwinKeyboard
tstDarwinKeyboard_DEFS.x86 = USE_HID_FOR_MODIFIERS
# Unset everything that was loaded from VBoxUI.pro.
include $(KBUILD_PATH)/subfooter.kmk
# before a new product release. VirtualBox_xx_YY.ts is a template for new
$(filter-out nls/qt_%.ts,$(VirtualBox_QT_TRANSLATIONS)) \