Makefile.kmk revision 098f28af4c67943631523e7ad3f9a4ddceb0d381
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Makefile for the Linux installer.
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Copyright (C) 2006-2007 Sun Microsystems, Inc.
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# This file is part of VirtualBox Open Source Edition (OSE), as
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# available from http://www.virtualbox.org. This file is free software;
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# you can redistribute it and/or modify it under the terms of the GNU
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# General Public License (GPL) as published by the Free Software
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Foundation, in version 2 as it comes in the "COPYING" file of the
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Clara, CA 95054 USA or visit http://www.sun.com if you need
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# additional information or have any questions.
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerSUB_DEPTH = ../../../..
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerinclude $(KBUILD_PATH)/subheader.kmk
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerifneq ($(KBUILD_HOST),linux)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(error "The Linux installer can only be built on Linux!")
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Globals and targets.
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerVBOX_PATH_LNX_INST_SRC := $(PATH_SUB_CURRENT)
47191265a0ac73f0ac0db0330969ce6920adaa1fBrendan MillerVBOX_LNX_INST_OUT_DIR := $(PATH_TARGET)/Installer/linux
47191265a0ac73f0ac0db0330969ce6920adaa1fBrendan MillerVBOX_LNX_INST_STAGE_DIR := $(PATH_TARGET)/Installer/linux/install
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerVBOX_LNX_DBG_PATH := usr/lib/debug/opt/VirtualBox
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerVBOX_LNX_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).run
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Unset this to speed up things during makefile hacking.
641b861c668fdb84b7ed44966216b36863ffb608Brendan MmillerVBOX_LNX_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerBLDDIRS += $(VBOX_LNX_INST_OUT_DIR) $(VBOX_LNX_INST_STAGE_DIR)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerPACKING += $(PATH_BIN)/VirtualBox.tar.bz2
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerif !defined(VBOX_NO_LINUX_RUN_INSTALLER) && !defined(VBOX_OSE)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller PACKING += $(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerOTHER_CLEAN += \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(addprefix $(VBOX_LNX_INST_STAGE_DIR)/,\
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(wildcard $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-*) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(addprefix $(VBOX_LNX_INST_OUT_DIR)/,\
641b861c668fdb84b7ed44966216b36863ffb608Brendan Mmiller# Linux installs.
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerINSTALLS += linux-bin
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerlinux-bin_INST = bin/
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerlinux-bin_MODE = a+rx,u+w
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerlinux-bin_SOURCES = \
47191265a0ac73f0ac0db0330969ce6920adaa1fBrendan Miller $(if $(VBOX_WITH_PYTHON),$(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py=>vboxshell.py,)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerINSTALLS += linux-misc
4898977f579fcb4eb88439686577754e34599f13Brendan Millerlinux-misc_INST = bin/
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerlinux-misc_MODE = a+r,u+w
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerlinux-misc_SOURCES = \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_WITH_QTGUI),$(PATH_linux-misc)/VirtualBox.desktop,)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerlinux-misc_CLEAN = $(PATH_linux-misc)/VirtualBox.desktop
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller$$(PATH_linux-misc)/VirtualBox.desktop: $(PATH_SUB_CURRENT)/VirtualBox.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(call MSG_GENERATE,,$@,$<)
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmillerifdef VBOX_PATH_PACKAGE_DOCS
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+$(VBOX_PATH_PACKAGE_DOCS)+" --output $@ $<
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+/opt/VirtualBox+" --output $@ $<
0c3f79f75f596c8d6700b2de830000f754bb28a9Phill Cunnington# The files residing in bin/ that we'll ship.
21dcdac963f79c098a5ea1a2c5c5e109429c9786Brendan Miller# Strip these binaries
0c3f79f75f596c8d6700b2de830000f754bb28a9Phill CunningtonVBOX_LNX_STRIP_BIN = \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_WITH_MAIN), \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller VBoxNetAdpCtl \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller VBoxXPCOMIPCD \
641b861c668fdb84b7ed44966216b36863ffb608Brendan Mmiller $(if $(VBOX_WITH_CROGL),\
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller VBoxTestOGL \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller $(if $(VBOX_WITH_PYTHON),$(notdir $(wildcard $(PATH_BIN)/VBoxPython*.so)),) \
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan Mmiller# Do not remove relocation information of these binaries
932eacec6c157231777c9b1d1326c8ed1f0a8d99Brendan MmillerVBOX_LNX_STRIP_OBJ = \
VMMGC.gc \
$(if $(VBOX_WITH_PYTHON),vboxshell.py,) \
VBox.sh \
VBox.png \
include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
$(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
$(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so)
$(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
$(foreach f,$(notdir $(wildcard $(PATH_BIN)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
$(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
$(if $(VBOX_WITH_HARDENING),VBoxBFE.so)
# Cleanup of the files we copy/symlink from bin.
$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
$(VBOX_PATH_LNX_INST_SRC)/routines.sh \
$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
$(VBOX_LNX_INST_OUT_DIR)/install.sh \
$(VBOX_PATH_LNX_INST_SRC)/vboxdrv-pardus.py \
$(VBOX_PATH_LNX_INST_SRC)/uninstall.sh \
$(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/routines.sh $(VBOX_LNX_INST_STAGE_DIR)/
$(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
$(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
$(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/vboxdrv-pardus.py $(VBOX_LNX_INST_STAGE_DIR)/
$(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
$(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/uninstall.sh $(VBOX_LNX_INST_STAGE_DIR)/
$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_VERSION_STAMP) | $$(dir $$@)
# .tar.bz2 for converting into .run
$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: \
$(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
$(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
$(PATH_BIN)/VirtualBox.tar.bz2: \
$(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
$(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
$(QUIET)$(if $(VBOX_NO_LINUX_RUN_INSTALLER),,objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_INST_OUT_DIR)/archive,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH),$@) $@)
# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
$(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
# .tar.bz2 for with the debug info.
$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
$(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
include $(KBUILD_PATH)/subfooter.kmk