Makefile.kmk revision 0690b6c399b2125d58bc513cfa77339c0dbbcfae
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Makefile for the VirtualBox Qt GUI.
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Copyright (C) 2006-2007 Sun Microsystems, Inc.
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# This file is part of VirtualBox Open Source Edition (OSE), as
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# available from http://www.virtualbox.org. This file is free software;
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# you can redistribute it and/or modify it under the terms of the GNU
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# General Public License (GPL) as published by the Free Software
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Foundation, in version 2 as it comes in the "COPYING" file of the
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Clara, CA 95054 USA or visit http://www.sun.com if you need
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# additional information or have any questions.
855892326cdb610d90dcf860a8d2cb05e2f8fddfndSUB_DEPTH = ../../../..
855892326cdb610d90dcf860a8d2cb05e2f8fddfndinclude $(KBUILD_PATH)/subheader.kmk
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBOX_VIRTUALBOX4_SRC := $(PATH_SUB_CURRENT)
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBOX_VIRTUALBOX4_OUT_DIR := $(PATH_TARGET)/VirtualBox/misc
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBOX_WITH_REGISTRATION := 1
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Ask the user to register at Sun. If this setting is disabled the user can
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# still register using the menu if desired.
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBOX_WITH_REGISTRATION_REQUEST := 1
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Show the update notifier dialog during startup. If this setting is disabled
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# the user can still update using the menu if desired.
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBOX_WITH_UPDATE_REQUEST := 1
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# The targets.
855892326cdb610d90dcf860a8d2cb05e2f8fddfndifdef VBOX_WITH_HARDENING
855892326cdb610d90dcf860a8d2cb05e2f8fddfndPROGRAMS += VirtualBoxHardened
855892326cdb610d90dcf860a8d2cb05e2f8fddfndDLLS += VirtualBox
855892326cdb610d90dcf860a8d2cb05e2f8fddfndPROGRAMS += VirtualBox
855892326cdb610d90dcf860a8d2cb05e2f8fddfndifeq ($(filter-out freebsd linux openbsd netbsd solaris,$(KBUILD_TARGET)),) # X11
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd DLLS += VBoxKeyboard
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd ## @todo convert to install target.
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd OTHERS += $(PATH_BIN)/vboxkeyboard.tar.gz
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd CLEAN += $(PATH_BIN)/vboxkeyboard.tar.gz
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Include the language lists.
855892326cdb610d90dcf860a8d2cb05e2f8fddfndinclude $(PATH_SUB_CURRENT)/nls/ApprovedLanguages.kmk
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# VBoxKeyboard - keyboard library for X11.
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBoxKeyboard_TEMPLATE = VBOXR3
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBoxKeyboard_SOURCES = \
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBoxKeyboard_LIBS = X11
855892326cdb610d90dcf860a8d2cb05e2f8fddfndVBoxKeyboard_LIBPATH = $(VBOX_LIBPATH_X11)
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# vboxkeyboard.tar.gz - the LGPLed keyboard library must always be
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# redistributed with usable sources.
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# This rule will link create a temporary symlink to src/X11/ and tar
95475ded9ec220bbb2576cae62b155425a77b2c7gsmith# up the selected files into a tarball that is installed into the
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# bin directory (probably belongs in /usr/shared/somewhere really,
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# but wtf, it's not like we're even trying to be FHS compliant).
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd## @todo this should be tar'ed down into the output directory and installed using an install target.
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd$(PATH_BIN)/vboxkeyboard.tar.gz: $(abspathex \
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd $(VBoxKeyboard_SOURCES) \
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd ,$(PATH_SUB_CURRENT)) | $(PATH_TARGET)/VBoxKeyboard/
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd $(call MSG_TOOL,tar/gzip,,$@)
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard $@
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd $(QUIET)$(LN_SYMLINK) $(VBOX_VIRTUALBOX4_SRC)/src/X11/ $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd $(QUIET)cd $(PATH_TARGET)/VBoxKeyboard \
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd && tar -chvf - $(addprefix vboxkeyboard/,$(notdir $^)) \
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd | gzip - > $@
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd $(QUIET2)$(RM) -f $(PATH_TARGET)/VBoxKeyboard/vboxkeyboard
855892326cdb610d90dcf860a8d2cb05e2f8fddfndOTHER_CLEAN += \
855892326cdb610d90dcf860a8d2cb05e2f8fddfnd# Hardened VirtualBox.
VirtualBoxHardened_SOURCES = src/hardenedmain.cpp
#VirtualBoxHardened_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
include $(PATH_SUB_CURRENT)/VBoxUI.pro
#VirtualBox_INST.darwin = $(INST_BIN)VirtualBox $(INST_BIN)VirtualBoxVM
VirtualBox_SDKS.win = WINPSDK DXSDK
ifeq ($(filter-out freebsd linux netbsd openbsd os2,$(KBUILD_TARGET)),) # X11 + os2 ## @todo solaris
VBOX_PATH_MACOSX_SDK = /Developer/SDKs/MacOSX10.5.sdk
VirtualBox_DEFS.debug = VBOX_CHECK_STATE # QT_FATAL_ASSERT
VirtualBox_DEFS.darwin = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
VirtualBox_DEFS.darwin.x86= USE_HID_FOR_MODIFIERS
VirtualBox_DEFS.freebsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
VirtualBox_DEFS.linux = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
VirtualBox_DEFS.netbsd = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
VirtualBox_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_src/main.cpp_DEFS += VBOX_VERSION_STRING=\"$(VBOX_VERSION_STRING)\"
VirtualBox_src/main.cpp_DEPS += $(VBOX_VERSION_MK)
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
$(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
$(PATH_SDK_DXSDK_LIB)/ddraw.lib \
$(PATH_SDK_DXSDK_LIB)/dxguid.lib
$(PATH_VirtualBox)/VirtualBox.rc
# (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
# 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 the resource file.
$$(PATH_VirtualBox)/VirtualBox.rc: $(PATH_SUB_CURRENT)/Makefile.kmk $(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)) \