# $Id: Makefile.kmk 15589 2008-12-16 14:24:08Z vboxsync $ ## @file # Sub-Makefile for the vboxvfs (linux shared folders module). # # # 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 PROGRAMS += mountvboxsf INSTALLS += vboxvfs-mod vboxvfs-sh ifdef VBOX_WITH_ADDITION_DRIVERS SYSMODS += vboxvfs endif # # Populate FILES_VBOXVFS_NOBIN # include $(PATH_SUB_CURRENT)/files_vboxvfs vboxvfs-mod_INST = $(INST_ADDITIONS)src/vboxvfs/ vboxvfs-mod_MODE = a+r,u+w vboxvfs-mod_SOURCES = $(subst ",,$(FILES_VBOXVFS_NOBIN)) vboxvfs-mod_SOURCES += $(if $(VBOX_OSE),,\ $(PATH_vboxvfs-mod)/dkms.conf) vboxvfs-mod_CLEAN += $(PATH_vboxvfs-mod)/dkms.conf vboxvfs-sh_INST = $(INST_ADDITIONS)src/vboxvfs/ vboxvfs-sh_MODE = a+rx,u+w vboxvfs-sh_SOURCES = $(subst ",,$(FILES_VBOXVFS_BIN)) vboxvfs-sh_SOURCES += \ $(PATH_vboxvfs-sh)/build_in_tmp \ $(if $(VBOX_OSE),,\ $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers) vboxvfs-sh_CLEAN += $(PATH_vboxvfs-sh)/build_in_tmp # # The module (for syntax checking). # vboxvfs_TEMPLATE = VBOXGUESTR0 vboxvfs_NOINST = 1 vboxvfs_CFLAGS = -fshort-wchar vboxvfs_DEFS = \ MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \ KBUILD_MODNAME=KBUILD_STR\(vboxadd\) \ KBUILD_BASENAME=KBUILD_STR\(vboxadd\) vboxvfs_INCS = \ $(PATH_ROOT)/src/VBox/Additions/common/VBoxGuestLib \ $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux vboxvfs_SOURCES = \ vfsmod.c \ utils.c \ dirops.c \ regops.c vboxvfs_LIBS = \ $(VBOX_LIB_VBGL_R0) \ $(VBOX_LIB_IPRT_GUEST_R0) # detect fc6 2.6.18 vboxvfs_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\ $(if $(wildcard $(inc)/linux/utsrelease.h),\ $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\ then echo yes; fi),KERNEL_FC6,),)) # detect rhel5 2.6.18 vboxvfs_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\ $(if $(wildcard $(inc)/linux/utsrelease.h),\ $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\ then echo yes; fi),KERNEL_FC6,),)) # # The mount util. # mountvboxsf_TEMPLATE = VBOXGUESTR3EXE mountvboxsf_DEFS = _GNU_SOURCE mountvboxsf_SOURCES = \ mount.vboxsf.c ## Scripts needed for building kernel modules $$(PATH_vboxvfs-sh)/build_in_tmp: \ $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \ $(VBOX_VERSION_STAMP) \ | $$(dir $$@) $(call MSG_TOOL,Creating,,$@) $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxvfs;g" < $< > $@ $(QUIET)chmod 0755 $@ $$(PATH_vboxvfs-mod)/dkms.conf: \ $(PATH_SUB_CURRENT)/dkms.conf \ $(VBOX_VERSION_STAMP) \ | $$(dir $$@) $(call MSG_TOOL,Creating,,$@) $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" < $< > $@ include $(KBUILD_PATH)/subfooter.kmk