# $Id: Makefile.kmk 23043 2009-09-15 20:23:44Z vboxsync $ ## @file # Makefile for the linux guest additions base directory. # # # Copyright (C) 2006-2007 Sun Microsystems, Inc. # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa # Clara, CA 95054 USA or visit http://www.sun.com if you need # additional information or have any questions. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk # # Include sub-makefiles. # include $(PATH_SUB_CURRENT)/sharedfolders/Makefile.kmk include $(PATH_SUB_CURRENT)/drm/Makefile.kmk # # Globals # VBOX_LNX_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/linux BLDDIRS += \ $(VBOX_LNX_ADD_INS_OUT_DIR) \ $(VBOX_LNX_ADD_INS_OUT_DIR)/module VBOX_PATH_LINUX_ADDITION_INSTALLER := $(PATH_SUB_CURRENT)/installer VBOX_PATH_X11_ADDITION_INSTALLER := $(PATH_ROOT)/src/VBox/Additions/x11/Installer # # Targets # ifndef VBOX_OSE BLDDIRS += $(VBOX_LNX_ADD_INS_OUT_DIR) $(VBOX_LNX_ADD_INS_OUT_DIR)/module PACKING += $(PATH_BIN)/additions/VBoxLinuxAdditions.run OTHER_CLEAN += $(PACKING) # OSE only contains the source code for this VBOX_SELINUX_CMPLD := $(PATH_SUB_CURRENT)/selinux-fedora/vbox_x11.pp endif # # Files to install # VBOX_LNX_ADD_STRIP_BIN = \ VBoxService \ VBoxClient \ VBoxControl \ vboxmouse_drv_70.so \ vboxmouse_drv_71.so \ vboxmouse_drv_14.so \ vboxmouse_drv_15.so \ vboxmouse_drv_16.so \ vboxmouse_drv_17.so \ vboxvideo_drv_70.so \ vboxvideo_drv_71.so \ vboxvideo_drv_13.so \ vboxvideo_drv_14.so \ vboxvideo_drv_15.so \ vboxvideo_drv_16.so \ vboxvideo_drv_17.so \ mount.vboxsf \ VBoxOGLarrayspu.so \ VBoxOGLcrutil.so \ VBoxOGLerrorspu.so \ VBoxOGLfeedbackspu.so \ VBoxOGLpackspu.so \ VBoxOGLpassthroughspu.so \ VBoxOGL.so VBOX_LNX_ADD_STRIP_OBJ = \ vboxmouse_drv.o \ vboxvideo_drv.o VBOX_LNX_ADD_MODULES = \ vboxguest \ vboxvfs \ vboxvideo_drm # # All the bin files that go into the archives. # VBOX_LNX_ADD_DBG_SYM_FILES := $(addsuffix .dbgsym,$(VBOX_LNX_ADD_STRIP_BIN)) VBOX_LNX_ADD_INS_FILES := $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_STRIP_BIN) $(VBOX_LNX_ADD_STRIP_OBJ) $(VBOX_LNX_ADD_DBG_SYM_FILES)) VBOX_LNX_ADD_INS_MODULES := $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/module/,$(VBOX_LNX_ADD_MODULES)) # Cleanup of the the installer directory files OTHER_CLEAN += $(VBOX_LNX_ADD_INS_FILES)) $(VBOX_LNX_ADD_INS_MODULES) # pattern rule for copying the debug info from the VBOX_LNX_ADD_STRIP_BIN files to the installation directory $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_DBG_SYM_FILES)): \ $(VBOX_LNX_ADD_INS_OUT_DIR)/%.dbgsym : $(PATH_BIN)/additions/% | $$(dir $$@) $(call MSG_TOOL,copydbg,$<,$@) $(QUIET)objcopy --only-keep-debug $< $@ # pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_STRIP_BIN)): \ $(VBOX_LNX_ADD_INS_OUT_DIR)/% : $(PATH_BIN)/additions/% \ $(VBOX_LNX_ADD_INS_OUT_DIR)/%.dbgsym \ | $$(dir $$@) $(call MSG_INST_FILE,$<,$@) $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@ $(QUIET)objcopy --add-gnu-debuglink=$(addsuffix .dbgsym,$@) $@ # pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_STRIP_OBJ)): \ $(VBOX_LNX_ADD_INS_OUT_DIR)/% : $(PATH_BIN)/additions/% | $$(dir $$@) $(call MSG_INST_FILE,$<,$@) ifeq ($(VBOX_DO_STRIP),) $(QUIET)$(INSTALL) -m 0644 $< $@ else # strip to temp file because of umask. $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp $(QUIET)$(INSTALL) -m 0644 $@.tmp $@ $(QUIET)$(RM) -f -- $@.tmp endif # pattern rule for copying the VBOX_LNX_ADD_MODULES files to the installation directory $(VBOX_LNX_ADD_INS_MODULES): \ $(VBOX_LNX_ADD_INS_OUT_DIR)/module/% : $(PATH_BIN)/additions/src/% | $(VBOX_LNX_ADD_INS_OUT_DIR)/module/ $(call MSG_INST_FILE,$<,$@) # Remove target directories first, otherwise the behaviour of cp will not be # what we want if it already exists. See the cp manual page for more details. $(QUIET)$(RM) -Rf $@ $(QUIET)cp -af $< $(VBOX_LNX_ADD_INS_OUT_DIR)/module INSTALLS += $(if $(VBOX_OSE),, lnx_add_inst-nobin) lnx_add_inst-nobin_INST = obj/Additions/Installer/linux lnx_add_inst-nobin_MODE = a+r,u+w lnx_add_inst-nobin_SOURCES = \ ../x11/Installer/VBoxRandR.sh \ installer/vboxadd-service.sh \ ../x11/Installer/98vboxadd-xclient \ ../x11/Installer/vboxclient.desktop \ installer/vboxadd.sh \ ../x11/Installer/vboxvideo.ids \ ../x11/Installer/x11config.pl \ ../x11/Installer/x11config15.pl \ ../x11/Installer/linux_xorg_suse11.conf \ installer/90-vboxguest.fdi INSTALLS += $(if $(VBOX_OSE),, lnx_add_inst-bin) lnx_add_inst-bin_INST = obj/Additions/Installer/linux lnx_add_inst-bin_MODE = a+rx,u+w lnx_add_inst-bin_SOURCES = \ ../../Installer/linux/routines.sh \ selinux-fedora/vbox_x11.pp INSTALLS += GuestDrivers-src GuestDrivers-src_INST = bin/additions/src/ GuestDrivers-src_MODE = a+r,u+w GuestDrivers-src_SOURCES = Makefile INSTALLS += $(if $(VBOX_OSE),, AutoRun-sh) AutoRun-sh_INST = bin/additions/ AutoRun-sh_MODE = a+rx,u+w AutoRun-sh_SOURCES = $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/autorun.sh # # Install the sources of our (sanity) test kernel module # INSTALLS += $(if $(VBOX_OSE),, LnxAddTest-src) LnxAddTest-src_INST = obj/Additions/Installer/linux/module/test LnxAddTest-src_MODE = a+r,u+w LnxAddTest-src_SOURCES = \ installer/Makefile.test=>Makefile \ installer/test.c # # Install the sources of our (sanity) test kernel rendering (DRM) module # INSTALLS += $(if $(VBOX_OSE),, LnxAddDRM-src) LnxAddDRM-src_INST = obj/Additions/Installer/linux/module/test_drm LnxAddDRM-src_MODE = a+r,u+w LnxAddDRM-src_SOURCES = \ installer/Makefile.include.header \ installer/Makefile.include.footer \ installer/Makefile.test.drm=>Makefile \ installer/test_drm.c # this file needs editing before it can be included in the generic installer. $(VBOX_LNX_ADD_INS_OUT_DIR)/install.sh: \ $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/install.sh | $$(dir $$@) $(QUIET)$(SED) \ -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \ -e "s;_BUILD_;$(shell date);g" \ -e "s;_OSE_;$(VBOX_OSE);g" \ -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \ -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \ --output $(VBOX_LNX_ADD_INS_OUT_DIR)/install_.sh \ $< $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_ADD_INS_OUT_DIR)/install_.sh $@ $(QUIET)$(RM) $(VBOX_LNX_ADD_INS_OUT_DIR)/install_.sh OTHERS_CLEAN += $(VBOX_LNX_ADD_INS_OUT_DIR)/install.sh include $(KBUILD_PATH)/subfooter.kmk # # Build the Linux Guest Additions self extracting installer. # # Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and # any references should be made via variables assigned a know value via := . # # We need to depend on all source files for the additions and shared # folders kernel modules. ## @todo Replace the wildcard stuff by the correct file lists now that # we've got everything included. # $(PATH_BIN)/additions/VBoxLinuxAdditions.run: \ $(INSTARGET_lnx_add_inst-nobin) \ $(INSTARGET_lnx_add_inst-bin) \ $(INSTARGET_LnxAddTest-src) \ $(INSTARGET_LnxAddTestDRM-src) \ $(VBOX_LNX_ADD_INS_FILES) \ $(VBOX_LNX_ADD_INS_MODULES) \ $(VBOX_LNX_ADD_INS_OUT_DIR)/install.sh \ $(wildcard $(PATH_BIN)/additions/src/*) \ $(wildcard $(PATH_BIN)/additions/src/*/*) \ $(wildcard $(PATH_BIN)/additions/src/*/*/*) \ $(wildcard $(PATH_BIN)/additions/src/*/*/*/*) \ $(VBOX_VERSION_STAMP) $(QUIET)$(VBOX_MAKESELF) $(VBOX_LNX_ADD_INS_OUT_DIR) $@ \ "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux installation" /bin/sh ./install.sh "> /dev/null"