1 | # $Id: Makefile.kmk 31900 2010-08-24 09:53:37Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the vboxsf (linux shared folders module).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | PROGRAMS += mount.vboxsf
|
---|
22 | INSTALLS += vboxsf-mod vboxsf-sh
|
---|
23 | ifdef VBOX_WITH_ADDITION_DRIVERS
|
---|
24 | SYSMODS += vboxsf
|
---|
25 | endif
|
---|
26 |
|
---|
27 | #
|
---|
28 | # Populate FILES_VBOXSF_NOBIN
|
---|
29 | #
|
---|
30 | include $(PATH_SUB_CURRENT)/files_vboxsf
|
---|
31 |
|
---|
32 | vboxsf-mod_INST = $(INST_ADDITIONS)src/vboxsf/
|
---|
33 | vboxsf-mod_MODE = a+r,u+w
|
---|
34 | vboxsf-mod_SOURCES = $(subst ",,$(FILES_VBOXSF_NOBIN))
|
---|
35 | vboxsf-mod_SOURCES += $(PATH_vboxsf-mod)/dkms.conf
|
---|
36 | vboxsf-mod_CLEAN += $(PATH_vboxsf-mod)/dkms.conf
|
---|
37 |
|
---|
38 | vboxsf-sh_INST = $(INST_ADDITIONS)src/vboxsf/
|
---|
39 | vboxsf-sh_MODE = a+rx,u+w
|
---|
40 | vboxsf-sh_SOURCES = $(subst ",,$(FILES_VBOXSF_BIN))
|
---|
41 | vboxsf-sh_SOURCES += \
|
---|
42 | $(PATH_vboxsf-sh)/build_in_tmp \
|
---|
43 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
|
---|
44 | vboxsf-sh_CLEAN += $(PATH_vboxsf-sh)/build_in_tmp
|
---|
45 |
|
---|
46 |
|
---|
47 | #
|
---|
48 | # The module (for syntax checking).
|
---|
49 | # The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels
|
---|
50 | #
|
---|
51 | vboxsf_TEMPLATE = VBOXGUESTR0
|
---|
52 | vboxsf_NOINST = 1
|
---|
53 | vboxsf_CFLAGS = -fshort-wchar
|
---|
54 | vboxsf_DEFS = \
|
---|
55 | MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \
|
---|
56 | KBUILD_MODNAME=KBUILD_STR\(vboxsf\) \
|
---|
57 | KBUILD_BASENAME=KBUILD_STR\(vboxsf\) \
|
---|
58 | DEBUG_HASH=2 DEBUG_HASH2=3
|
---|
59 | vboxsf_INCS = \
|
---|
60 | $(PATH_ROOT)/src/VBox/Additions/common/VBoxGuestLib \
|
---|
61 | $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
|
---|
62 | vboxsf_SOURCES = \
|
---|
63 | vfsmod.c \
|
---|
64 | utils.c \
|
---|
65 | dirops.c \
|
---|
66 | regops.c
|
---|
67 | vboxsf_LIBS = \
|
---|
68 | $(VBOX_LIB_VBGL_R0)
|
---|
69 |
|
---|
70 | # detect fc6 2.6.18
|
---|
71 | vboxsf_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\
|
---|
72 | $(if $(wildcard $(inc)/linux/utsrelease.h),\
|
---|
73 | $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
|
---|
74 | then echo yes; fi),KERNEL_FC6,),))
|
---|
75 | # detect rhel5 2.6.18
|
---|
76 | vboxsf_DEFS += $(foreach inc,$(VBOX_LINUX_INCS),\
|
---|
77 | $(if $(wildcard $(inc)/linux/utsrelease.h),\
|
---|
78 | $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
|
---|
79 | then echo yes; fi),KERNEL_FC6,),))
|
---|
80 |
|
---|
81 |
|
---|
82 | #
|
---|
83 | # The mount util.
|
---|
84 | #
|
---|
85 | mount.vboxsf_TEMPLATE = VBOXGUESTR3EXE
|
---|
86 | mount.vboxsf_DEFS = _GNU_SOURCE
|
---|
87 | mount.vboxsf_SOURCES = \
|
---|
88 | mount.vboxsf.c \
|
---|
89 | vbsfmount.c
|
---|
90 |
|
---|
91 | ## Scripts needed for building kernel modules
|
---|
92 |
|
---|
93 | $$(PATH_vboxsf-sh)/build_in_tmp: \
|
---|
94 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
|
---|
95 | $(VBOX_VERSION_STAMP) \
|
---|
96 | | $$(dir $$@)
|
---|
97 | $(call MSG_TOOL,Creating,,$@)
|
---|
98 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxsf;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
|
---|
99 | $(QUIET)chmod 0755 $@
|
---|
100 |
|
---|
101 | $$(PATH_vboxsf-mod)/dkms.conf: \
|
---|
102 | $(PATH_SUB_CURRENT)/dkms.conf \
|
---|
103 | $(VBOX_VERSION_STAMP) \
|
---|
104 | | $$(dir $$@)
|
---|
105 | $(call MSG_TOOL,Creating,,$@)
|
---|
106 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
|
---|
107 |
|
---|
108 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
109 |
|
---|