Makefile.kmk revision 43d127a1fd971503e17fefb48c87abbb414da084
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd# Makefile for the VirtualBox Qt GUI.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Copyright (C) 2006-2009 Sun Microsystems, Inc.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# This file is part of VirtualBox Open Source Edition (OSE), as
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc# available from http://www.virtualbox.org. This file is free software;
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# you can redistribute it and/or modify it under the terms of the GNU
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# General Public License (GPL) as published by the Free Software
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# Foundation, in version 2 as it comes in the "COPYING" file of the
2e545ce2450a9953665f701bb05350f0d3f26275nd# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Clara, CA 95054 USA or visit http://www.sun.com if you need
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen# additional information or have any questions.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndSUB_DEPTH = ../../../..
a78048ccbdb6256da15e6b0e7e95355e480c2301ndinclude $(KBUILD_PATH)/subheader.kmk
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjungVBOX_VIRTUALBOX4_SRC := $(PATH_SUB_CURRENT)
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBOX_VIRTUALBOX4_OUT_DIR := $(PATH_TARGET)/VirtualBox/misc
4b575a6b6704b516f22d65a3ad35696d7b9ba372rpluemVBOX_WITH_REGISTRATION := 1
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Ask the user to register at Sun. If this setting is disabled the user can
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# still register using the menu if desired.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBOX_WITH_REGISTRATION_REQUEST := 1
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Show the update notifier dialog during startup. If this setting is disabled
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# the user can still update using the menu if desired.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBOX_WITH_UPDATE_REQUEST := 1
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# The targets.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifdef VBOX_WITH_HARDENING
a78048ccbdb6256da15e6b0e7e95355e480c2301ndPROGRAMS += VirtualBoxHardened
a78048ccbdb6256da15e6b0e7e95355e480c2301ndDLLS += VirtualBox
a78048ccbdb6256da15e6b0e7e95355e480c2301ndPROGRAMS += VirtualBox
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
a78048ccbdb6256da15e6b0e7e95355e480c2301nd DLLS += VBoxKeyboard
a78048ccbdb6256da15e6b0e7e95355e480c2301nd ## @todo convert to install target.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
a78048ccbdb6256da15e6b0e7e95355e480c2301nd CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Include the language lists.
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedoohinclude $(PATH_SUB_CURRENT)/nls/ApprovedLanguages.kmk
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# VBoxKeyboard - keyboard library for X11.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBoxKeyboard_TEMPLATE = VBOXR3
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBoxKeyboard_SOURCES = \
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBoxKeyboard_LIBS = X11
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# redistributed with usable sources.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# This rule will link create a temporary symlink to src/X11/ and tar
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# up the selected files into a tarball that is installed into the
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# bin directory (probably belongs in /usr/shared/somewhere really,
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# but wtf, it's not like we're even trying to be FHS compliant).
a78048ccbdb6256da15e6b0e7e95355e480c2301nd## @todo this should be tar'ed down into the output directory and installed using an install target.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd$(PATH_BIN)/vboxkeyboard.tar.gz: $(abspathex \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(VBoxKeyboard_SOURCES) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd ,$(PATH_SUB_CURRENT)) | $(PATH_TARGET)/VBoxKeyboard/
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(call MSG_TOOL,tar/gzip,,$@)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard $@
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/X11/ $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(QUIET)cd $(PATH_TARGET)/VBoxKeyboard \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd | gzip - > $@
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
a78048ccbdb6256da15e6b0e7e95355e480c2301ndOTHER_CLEAN += \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Hardened VirtualBox.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBoxHardened_TEMPLATE = VBOXR3HARDENEDEXE
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBoxHardened_SOURCES = src/hardenedmain.cpp
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBoxHardened_NAME = VirtualBox
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd #VirtualBoxHardened_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBoxHardened_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# Include Qt project file, we'll use FORMS and TRANSLATIONS in
5652dbe450e4fcfdf36d4cfb42d7f2345ded29a4maczniak# the VirtualBox setup below.
d05e31513e1ed1df255774920b11ccad0262ad9cndSAVED_TEMPLATE := $(TEMPLATE)
a78048ccbdb6256da15e6b0e7e95355e480c2301ndinclude $(PATH_SUB_CURRENT)/VBoxUI.pro
a78048ccbdb6256da15e6b0e7e95355e480c2301nd# VirtualBox - The GUI program.
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXQT4GUI,VBOXQT4GUIEXE)
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_NAME = VirtualBox
d05e31513e1ed1df255774920b11ccad0262ad9cndifndef VBOX_WITH_HARDENING # For the launch trick we need different inode numbers.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd ifeq ($(KBUILD_TARGET),darwin) ## @todo use .darwin when ticket 36 has been fixed.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd #VirtualBox_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_INST = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_SDKS.win = WINPSDK DXSDK
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_SDKS += LIBSDL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifdef VBOX_WITH_ICHAT_THEATER
a78048ccbdb6256da15e6b0e7e95355e480c2301nd # For testing iChat Theater stuff change the sdk path (HACK ALERT!)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.debug = VBOX_CHECK_STATE # QT_FATAL_ASSERT
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifndef VBOX_WITH_COCOA_QT
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.darwin.x86= USE_HID_FOR_MODIFIERS
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.linux = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.openbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.solaris = VBOX_GUI_USE_QIMAGE #VBOX_GUI_USE_SDL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.win.amd64 = VBOX_WITHOUT_QHTTP
a78048ccbdb6256da15e6b0e7e95355e480c2301nd## @todo VBOX_WITH_HACKED_QT doesn't apply to Qt4, so why is this still here?
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS.darwin.x86 += VBOX_WITH_HACKED_QT
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifdef VBOX_WITH_ICHAT_THEATER
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_DEFS.darwin += VBOX_WITH_ICHAT_THEATER
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifneq ($(KBUILD_TYPE),release)
a78048ccbdb6256da15e6b0e7e95355e480c2301nd # non-release builds has some extra features.
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
a78048ccbdb6256da15e6b0e7e95355e480c2301ndVirtualBox_DEFS += \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_REGISTRATION),VBOX_WITH_REGISTRATION) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_REGISTRATION_REQUEST),VBOX_WITH_REGISTRATION_REQUEST) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_UPDATE_REQUEST),VBOX_WITH_UPDATE_REQUEST) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd $(if $(VBOX_WITH_NETFLT)$(eq $(KBUILD_TARGET),freebsd),VBOX_WITH_NETFLT)
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifdef VBOX_WITH_DEBUGGER_GUI
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI
a78048ccbdb6256da15e6b0e7e95355e480c2301nd if "$(KBUILD_TYPE)" != "release"
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
a78048ccbdb6256da15e6b0e7e95355e480c2301ndifdef VBOX_WITH_VIDEOHWACCEL
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_DEFS += VBOX_WITH_VIDEOHWACCEL \
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VBOX_GUI_USE_QGL
a78048ccbdb6256da15e6b0e7e95355e480c2301ndelse ifdef VBOX_GUI_USE_QGL
a78048ccbdb6256da15e6b0e7e95355e480c2301nd VirtualBox_DEFS += VBOX_GUI_USE_QGL
253547fb9cc7986e84ff68aef076f664fc4169dctakashiifdef VBOX_BLEEDING_EDGE
727872d18412fc021f03969b8641810d8896820bhumbedooh VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
727872d18412fc021f03969b8641810d8896820bhumbedooh VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
0d0ba3a410038e179b695446bb149cce6264e0abnd VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
727872d18412fc021f03969b8641810d8896820bhumbedooh VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\"
0d0ba3a410038e179b695446bb149cce6264e0abndVirtualBox_INCS = \
0d0ba3a410038e179b695446bb149cce6264e0abnd $(PATH_VirtualBox)/include
0d0ba3a410038e179b695446bb149cce6264e0abnd# Necessary for the hdd backend enumeration
727872d18412fc021f03969b8641810d8896820bhumbedoohVirtualBox_LIBS = $(LIB_DDU)
0d0ba3a410038e179b695446bb149cce6264e0abndifdef VBOX_WITH_VIDEOHWACCEL
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh# Necessary for save state support
205f749042ed530040a4f0080dbcb47ceae8a374rjungVirtualBox_LIBS += $(LIB_VMM)
0d0ba3a410038e179b695446bb149cce6264e0abndifeq ($(KBUILD_TYPE),release)
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
a78048ccbdb6256da15e6b0e7e95355e480c2301nd ifeq ($(USERNAME),dmik)
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)) \