summaryrefslogtreecommitdiffstats
path: root/src/VBox/Additions/linux/sharedfolders/Makefile.module
blob: 3eeb976c4a920fb2a2455be08dd349dcea0a54a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# $Id: Makefile.module $
## @file
# VBox Linux Shared Folders VFS Module Makefile.
#
# (For 2.6.x this file must be 'Makefile'!)
#

#
# Copyright (C) 2006-2023 Oracle and/or its affiliates.
#
# This file is part of VirtualBox base platform packages, as
# available from https://www.virtualbox.org.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, in version 3 of the
# License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses>.
#
# SPDX-License-Identifier: GPL-3.0-only
#

# Linux kbuild sets this to our source directory if we are called from there
obj ?= $(CURDIR)
include $(obj)/Makefile-header.gmk
VBOXSF_DIR = $(VBOX_MODULE_SRC_DIR)

# Allow building directly from the subdirectory without assuming the toplevel
# makefile has done the copying. Not the default use case, but can be handy.
ifndef KBUILD_EXTRA_SYMBOLS
KBUILD_EXTRA_SYMBOLS=$(abspath $(VBOXSF_DIR)/../vboxguest/Module.symvers)
endif

VBOXMOD_NAME = vboxsf
VBOXMOD_OBJS = \
	vfsmod.o \
	dirops.o \
	lnkops.o \
	regops.o \
	utils.o \
	VBoxGuestR0LibGenericRequest.o \
	VBoxGuestR0LibHGCM.o \
	VBoxGuestR0LibIdc.o \
	VBoxGuestR0LibIdc-unix.o \
	VBoxGuestR0LibInit.o \
	VBoxGuestR0LibPhysHeap.o \
	VBoxGuestR0LibSharedFolders.o
ifeq ($(VBOX_KBUILD_TARGET_ARCH),x86)
VBOXMOD_OBJS += \
	divdi3.o \
	moddi3.o \
	udivdi3.o \
	udivmoddi4.o \
	umoddi3.o \
	qdivrem.o
endif
VBOXMOD_INCL = \
	$(VBOXSF_DIR) \
	$(VBOXSF_DIR)include \
	$(VBOXSF_DIR)r0drv/linux
VBOXMOD_DEFS = \
	RT_OS_LINUX \
	IN_RING0 \
	IN_RT_R0 \
	IN_SUP_R0 \
	VBOX \
	VBOX_WITH_HGCM \
	IN_MODULE \
	IN_GUEST \
	IN_GUEST_R0 \
	RT_NO_EXPORT_SYMBOL
ifeq ($(VBOX_KBUILD_TARGET_ARCH),amd64)
VBOXMOD_DEFS += VBOX_WITH_64_BITS_GUESTS
endif
ifneq ($(filter %uek.x86_64,$(KERN_VER)),)
VBOXMOD_DEFS += VBOX_UEK
endif
VBOXMOD_CFLAGS := $(call VBOX_GCC_CHECK_CC,-Wno-declaration-after-statement,-Wno-declaration-after-statement,,)
VBOXMOD_CFLAGS += $(call VBOX_GCC_CHECK_CC,-fno-pie,-fno-pie,,)
ifneq ($(KERN_VERSION),24)
VBOXMOD_CFLAGS += -include $(VBOXSF_DIR)/include/VBox/VBoxGuestMangling.h
## @todo r-bird: What's with -fshort-wchar here?? We either need that or we dont, right? It should be 2.6+ only.
VBOXMOD_CFLAGS += -fshort-wchar
endif
ifdef VBOX_NO_OMIT_FRAME_POINTER
VBOXMOD_CFLAGS += -fno-omit-frame-pointer
endif

ifneq ($(KERN_VERSION),24)
# special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
# ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
 ifeq ($(KERNELRELEASE),)
VBOXMOD_CFLAGS += $(foreach inc,$(KERN_INCL),\
               $(if $(wildcard $(inc)/linux/utsrelease.h),\
                 $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
                              grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
                              grep '"2.6.18.*v5.*"'  $(inc)/linux/utsrelease.h; \
                              grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
                   -DKERNEL_FC6,),))
 else
VBOXMOD_CFLAGS += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
                          echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
                          echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
                          echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
		-DKERNEL_FC6,)
 endif
endif

VBOXMOD_CLEAN = . linux r0drv r0drv/linux

include $(obj)/Makefile-footer.gmk