1 | # $Id: Makefile.module 100191 2023-06-16 08:04:11Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # VBox Linux Shared Folders VFS Module Makefile.
|
---|
4 | #
|
---|
5 | # (For 2.6.x this file must be 'Makefile'!)
|
---|
6 | #
|
---|
7 |
|
---|
8 | #
|
---|
9 | # Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
10 | #
|
---|
11 | # This file is part of VirtualBox base platform packages, as
|
---|
12 | # available from https://www.virtualbox.org.
|
---|
13 | #
|
---|
14 | # This program is free software; you can redistribute it and/or
|
---|
15 | # modify it under the terms of the GNU General Public License
|
---|
16 | # as published by the Free Software Foundation, in version 3 of the
|
---|
17 | # License.
|
---|
18 | #
|
---|
19 | # This program is distributed in the hope that it will be useful, but
|
---|
20 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
22 | # General Public License for more details.
|
---|
23 | #
|
---|
24 | # You should have received a copy of the GNU General Public License
|
---|
25 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
26 | #
|
---|
27 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
28 | #
|
---|
29 |
|
---|
30 | # Linux kbuild sets this to our source directory if we are called from there
|
---|
31 | obj ?= $(CURDIR)
|
---|
32 | include $(obj)/Makefile-header.gmk
|
---|
33 | VBOXSF_DIR = $(VBOX_MODULE_SRC_DIR)
|
---|
34 |
|
---|
35 | # Allow building directly from the subdirectory without assuming the toplevel
|
---|
36 | # makefile has done the copying. Not the default use case, but can be handy.
|
---|
37 | ifndef KBUILD_EXTRA_SYMBOLS
|
---|
38 | KBUILD_EXTRA_SYMBOLS=$(abspath $(VBOXSF_DIR)/../vboxguest/Module.symvers)
|
---|
39 | endif
|
---|
40 |
|
---|
41 | VBOXMOD_NAME = vboxsf
|
---|
42 | VBOXMOD_OBJS = \
|
---|
43 | vfsmod.o \
|
---|
44 | dirops.o \
|
---|
45 | lnkops.o \
|
---|
46 | regops.o \
|
---|
47 | utils.o \
|
---|
48 | VBoxGuestR0LibGenericRequest.o \
|
---|
49 | VBoxGuestR0LibHGCM.o \
|
---|
50 | VBoxGuestR0LibIdc.o \
|
---|
51 | VBoxGuestR0LibIdc-unix.o \
|
---|
52 | VBoxGuestR0LibInit.o \
|
---|
53 | VBoxGuestR0LibPhysHeap.o \
|
---|
54 | VBoxGuestR0LibSharedFolders.o
|
---|
55 | ifeq ($(VBOX_KBUILD_TARGET_ARCH),x86)
|
---|
56 | VBOXMOD_OBJS += \
|
---|
57 | divdi3.o \
|
---|
58 | moddi3.o \
|
---|
59 | udivdi3.o \
|
---|
60 | udivmoddi4.o \
|
---|
61 | umoddi3.o \
|
---|
62 | qdivrem.o
|
---|
63 | endif
|
---|
64 | VBOXMOD_INCL = \
|
---|
65 | $(VBOXSF_DIR) \
|
---|
66 | $(VBOXSF_DIR)include \
|
---|
67 | $(VBOXSF_DIR)r0drv/linux
|
---|
68 | VBOXMOD_DEFS = \
|
---|
69 | RT_OS_LINUX \
|
---|
70 | IN_RING0 \
|
---|
71 | IN_RT_R0 \
|
---|
72 | IN_SUP_R0 \
|
---|
73 | VBOX \
|
---|
74 | VBOX_WITH_HGCM \
|
---|
75 | IN_MODULE \
|
---|
76 | IN_GUEST \
|
---|
77 | IN_GUEST_R0 \
|
---|
78 | RT_NO_EXPORT_SYMBOL
|
---|
79 | ifeq ($(VBOX_KBUILD_TARGET_ARCH),amd64)
|
---|
80 | VBOXMOD_DEFS += VBOX_WITH_64_BITS_GUESTS
|
---|
81 | endif
|
---|
82 | ifeq ($(VBOX_KBUILD_TARGET_ARCH),arm64)
|
---|
83 | VBOXMOD_DEFS += VBOX_WITH_64_BITS_GUESTS
|
---|
84 | endif
|
---|
85 | ifneq ($(filter %uek.x86_64,$(KERN_VER)),)
|
---|
86 | VBOXMOD_DEFS += VBOX_UEK
|
---|
87 | endif
|
---|
88 | VBOXMOD_CFLAGS := $(call VBOX_GCC_CHECK_CC,-Wno-declaration-after-statement,-Wno-declaration-after-statement,,)
|
---|
89 | VBOXMOD_CFLAGS += $(call VBOX_GCC_CHECK_CC,-fno-pie,-fno-pie,,)
|
---|
90 | ifneq ($(KERN_VERSION),24)
|
---|
91 | VBOXMOD_CFLAGS += -include $(VBOXSF_DIR)/include/VBox/VBoxGuestMangling.h
|
---|
92 | ## @todo r-bird: What's with -fshort-wchar here?? We either need that or we dont, right? It should be 2.6+ only.
|
---|
93 | VBOXMOD_CFLAGS += -fshort-wchar
|
---|
94 | endif
|
---|
95 | ifdef VBOX_NO_OMIT_FRAME_POINTER
|
---|
96 | VBOXMOD_CFLAGS += -fno-omit-frame-pointer
|
---|
97 | endif
|
---|
98 |
|
---|
99 | ifneq ($(KERN_VERSION),24)
|
---|
100 | # special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
|
---|
101 | # ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
|
---|
102 | ifeq ($(KERNELRELEASE),)
|
---|
103 | VBOXMOD_CFLAGS += $(foreach inc,$(KERN_INCL),\
|
---|
104 | $(if $(wildcard $(inc)/linux/utsrelease.h),\
|
---|
105 | $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
|
---|
106 | grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
|
---|
107 | grep '"2.6.18.*v5.*"' $(inc)/linux/utsrelease.h; \
|
---|
108 | grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
|
---|
109 | -DKERNEL_FC6,),))
|
---|
110 | else
|
---|
111 | VBOXMOD_CFLAGS += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
|
---|
112 | echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
|
---|
113 | echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
|
---|
114 | echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
|
---|
115 | -DKERNEL_FC6,)
|
---|
116 | endif
|
---|
117 | endif
|
---|
118 |
|
---|
119 | VBOXMOD_CLEAN = . linux r0drv r0drv/linux
|
---|
120 |
|
---|
121 | include $(obj)/Makefile-footer.gmk
|
---|
122 |
|
---|