Makefile.kmk revision 28f6fe0a72dd4363f87bb8d56d7cd0b14ec46e66
45e9809aff7304721fddb95654901b32195c9c7avboxsync# $Id$
45e9809aff7304721fddb95654901b32195c9c7avboxsync## @file
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Makefile for the Linux installer.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Copyright (C) 2007 innotek GmbH
45e9809aff7304721fddb95654901b32195c9c7avboxsync#
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Use only with permission
45e9809aff7304721fddb95654901b32195c9c7avboxsync#
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncDEPTH = ../../../..
45e9809aff7304721fddb95654901b32195c9c7avboxsyncinclude $(PATH_KBUILD)/header.kmk
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncifneq ($(BUILD_PLATFORM),linux)
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(error "The Linux installer can only be built on Linux!") # yeah, right.
45e9809aff7304721fddb95654901b32195c9c7avboxsyncendif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPROGRAMS = VBoxTunctl
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPACKING = $(if $(VBOX_OSE),,$(PATH_BIN)/VirtualBox.run)
45e9809aff7304721fddb95654901b32195c9c7avboxsyncPACKING += $(PATH_BIN)/VirtualBox.tar.bz2
45e9809aff7304721fddb95654901b32195c9c7avboxsyncOTHER_CLEAN = $(addprefix $(PATH_TARGET)/install/,\
45e9809aff7304721fddb95654901b32195c9c7avboxsync install.sh deffiles routines.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxAddIF.sh vboxdrv.sh vboxnet.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VirtualBox.tar.bz2 LICENSE) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(wildcard $(PATH_TARGET)/VirtualBox-*)
45e9809aff7304721fddb95654901b32195c9c7avboxsyncINSTALLS = linux-bin linux-doc
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncVBoxTunctl_TEMPLATE = VBOXR3EXE
45e9809aff7304721fddb95654901b32195c9c7avboxsyncVBoxTunctl_SOURCES = tunctl.c
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Linux installs.
45e9809aff7304721fddb95654901b32195c9c7avboxsync#
45e9809aff7304721fddb95654901b32195c9c7avboxsynclinux-bin_INST = bin/
45e9809aff7304721fddb95654901b32195c9c7avboxsynclinux-bin_MODE = a+rx,u+w
45e9809aff7304721fddb95654901b32195c9c7avboxsynclinux-bin_SOURCES = \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBox.sh=>VBox.sh
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsynclinux-doc_INST = bin/
45e9809aff7304721fddb95654901b32195c9c7avboxsynclinux-doc_MODE = a+r,u+w
45e9809aff7304721fddb95654901b32195c9c7avboxsynclinux-doc_SOURCES = \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_OSE),,$(PATH_ROOT)/doc/License.txt=>LICENSE) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBox.png=>VBox.png
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Strip these binaries
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXSTRIPBIN = \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxDD.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxDD2.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxManage \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxREM.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxRT.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_WITH_VBOXSDL),VBoxSDL,) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxSVC \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxDDU.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxVMM.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxXML.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxXPCOM.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxXPCOMIPCD \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_WITH_QTGUI),VirtualBox,) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync tstVMM \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxTunctl \
45e9809aff7304721fddb95654901b32195c9c7avboxsync components/VBoxC.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync components/VBoxSVCM.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync components/VBoxXPCOMIPCC.so
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Don't remove relocation information of these binaries
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXSTRIPOBJ = \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxDD2GC.gc \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxDD2R0.r0 \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxDDGC.gc \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxDDR0.r0 \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VMMGC.gc \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VMMR0.r0
45e9809aff7304721fddb95654901b32195c9c7avboxsyncifeq ($(BUILD_TARGET_ARCH),amd64)
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXSTRIPOBJ += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxREM2.rel
45e9809aff7304721fddb95654901b32195c9c7avboxsyncendif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Don't strip anything of these files
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXNOSTRIP = \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_OSE),,LICENSE) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync components/VBoxXPCOMBase.xpt \
45e9809aff7304721fddb95654901b32195c9c7avboxsync components/VirtualBox_XPCOM.xpt \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBox.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBox.png \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxAddIF.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_WITH_QTGUI),VirtualBox.desktop,) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_WITH_QTGUI),nls,) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync src \
45e9809aff7304721fddb95654901b32195c9c7avboxsync sdk
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Guest Additions
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXNOSTRIP += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_OSE),,additions/VBoxGuestAdditions.iso)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Shared Folders
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXSTRIPBIN += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxSharedFolders.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_OSE),,VRDPAuth.so)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Shared Clipboard
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXSTRIPBIN += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxSharedClipboard.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so,)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncifdef VBOX_WITH_DOCS
45e9809aff7304721fddb95654901b32195c9c7avboxsync LINUXNOSTRIP += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync UserManual.pdf
45e9809aff7304721fddb95654901b32195c9c7avboxsync LINUXSTRIPBIN += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_WITH_QTGUI),kchmviewer,)
45e9809aff7304721fddb95654901b32195c9c7avboxsync ifneq ($(wildcard $(PATH_BIN)/VirtualBox.chm),)
45e9809aff7304721fddb95654901b32195c9c7avboxsync # our 64-bit tinderboxes are not able to generate VirtualBox.chm so far
45e9809aff7304721fddb95654901b32195c9c7avboxsync # but for building .deb/.rpm packages we use precompiled binaries.
45e9809aff7304721fddb95654901b32195c9c7avboxsync LINUXNOSTRIP += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VirtualBox.chm
45e9809aff7304721fddb95654901b32195c9c7avboxsync endif
45e9809aff7304721fddb95654901b32195c9c7avboxsyncendif
45e9809aff7304721fddb95654901b32195c9c7avboxsyncifdef VBOX_WITH_VRDP
45e9809aff7304721fddb95654901b32195c9c7avboxsync LINUXSTRIPBIN += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxVRDP.so \
45e9809aff7304721fddb95654901b32195c9c7avboxsync VBoxVRDP
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync LINUXNOSTRIP += \
45e9809aff7304721fddb95654901b32195c9c7avboxsync rdesktop-vrdp.tar.gz
45e9809aff7304721fddb95654901b32195c9c7avboxsyncendif
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncLINUXARCHFILES := $(LINUXSTRIPBIN) $(LINUXSTRIPOBJ) $(LINUXNOSTRIP)
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncOTHER_CLEAN += $(addprefix $(PATH_TARGET)/archive/,$(LINUXARCHFILES))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncinclude $(PATH_KBUILD)/footer.kmk
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(PATH_BIN)/VirtualBox.run: \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(PATH_TARGET)/install/VirtualBox.tar.bz2 \
45e9809aff7304721fddb95654901b32195c9c7avboxsync install.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(VBOX_VERSION_STAMP) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync routines.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync deffiles \
45e9809aff7304721fddb95654901b32195c9c7avboxsync vboxnet.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync vboxdrv.sh \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(if $(VBOX_OSE),,$(PATH_ROOT)/doc/License.txt)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_TOOL,makeself,,,$@)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" \
45e9809aff7304721fddb95654901b32195c9c7avboxsync -e "s;_BUILD_;$(shell date);g" \
45e9809aff7304721fddb95654901b32195c9c7avboxsync -e "s;_ARCH_;${BUILD_TARGET_ARCH};g" \
45e9809aff7304721fddb95654901b32195c9c7avboxsync < install.sh > $(PATH_TARGET)/install/install.sh
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)chmod 0744 $(PATH_TARGET)/install/install.sh
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(INSTALL) -m 0755 routines.sh $(PATH_TARGET)/install
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(INSTALL) -m 0755 deffiles $(PATH_TARGET)/install
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(PATH_ROOT)/doc/License.txt $(PATH_TARGET)/install/LICENSE)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(INSTALL) -m 0755 vboxnet.sh $(PATH_TARGET)/install
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(INSTALL) -m 0755 vboxdrv.sh $(PATH_TARGET)/install
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(RM) -f $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(VBOX_MAKESELF) --follow $(PATH_TARGET)/install $@ \
45e9809aff7304721fddb95654901b32195c9c7avboxsync "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# .tar.bz2 for converting into .run
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(PATH_TARGET)/install/VirtualBox.tar.bz2: \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(addprefix $(PATH_TARGET)/archive/, $(LINUXARCHFILES)) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync Makefile.kmk \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(VBOX_VERSION_STAMP) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_L1,Packing $@)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(MKDIR) -p $(@D)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING) $(LINUXARCHFILES)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)chmod 0644 $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# .tar.bz2 for distribution
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(PATH_BIN)/VirtualBox.tar.bz2: \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(addprefix $(PATH_TARGET)/archive/, $(LINUXARCHFILES)) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync Makefile.kmk \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(VBOX_VERSION_STAMP) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_L1,Packing $@)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(MKDIR) -p $(PATH_TARGET)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(PATH_TARGET) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(LINUXARCHFILES))
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING): $(PATH_TARGET)/archive
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_INST_SYM,$<,$@)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(MKDIR) -p $(@D)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)rm -rf $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(LN_SYMLINK) $< $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(PATH_BIN)/VBoxAddIF.sh: VBoxAddIF.sh $(VBOX_VERSION_STAMP)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_GENERATE,,$@,$<)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" $< > $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)chmod 0755 $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(PATH_BIN)/VirtualBox.desktop: VirtualBox.desktop $(VBOX_VERSION_STAMP)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_GENERATE,,$@,$<)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(SED) -e "s/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/" $< > $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Note: The -m <mode> feature of kmk_builtin_install does not work together with fakeroot!
45e9809aff7304721fddb95654901b32195c9c7avboxsync# Note: $(INSTALL) -s is currently not reliable when used in parallel builds. Fixed in 0.1.1.
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(foreach f,$(LINUXSTRIPBIN),$(PATH_TARGET)/archive/$(f)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(PATH_TARGET)/archive/% : $(PATH_BIN)/% | $(call DIRDEP,$(PATH_TARGET)/archive)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_INST_FILE,$<,$@)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)install -D -m 0755 $(if $(filter release profile,$(BUILD_TYPE)),-s,) $< $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(foreach f,$(LINUXSTRIPOBJ),$(PATH_TARGET)/archive/$(f)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(PATH_TARGET)/archive/% : $(PATH_BIN)/% | $(call DIRDEP,$(PATH_TARGET)/archive)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_INST_FILE,$<,$@)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)objcopy --strip-unneeded -R .comment $< $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(foreach f,$(LINUXNOSTRIP),$(PATH_TARGET)/archive/$(f)): \
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(PATH_TARGET)/archive/% : $(PATH_BIN)/% | $(call DIRDEP,$(PATH_TARGET)/archive)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(call MSG_INST_SYM,$<,$@)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(RM) -f $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(MKDIR) -p $(@D)
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(LN_SYMLINK) $< $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync$(foreach d,archive install,$(PATH_TARGET)/$(d)/):
45e9809aff7304721fddb95654901b32195c9c7avboxsync $(QUIET)$(MKDIR) -p $@
45e9809aff7304721fddb95654901b32195c9c7avboxsync