[69334] | 1 | # $Id: Makefile.module 100191 2023-06-16 08:04:11Z vboxsync $
|
---|
| 2 | ## @file
|
---|
[76733] | 3 | # VBox Linux Shared Folders VFS Module Makefile.
|
---|
[2614] | 4 | #
|
---|
| 5 | # (For 2.6.x this file must be 'Makefile'!)
|
---|
| 6 | #
|
---|
[69334] | 7 |
|
---|
| 8 | #
|
---|
[98103] | 9 | # Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[5227] | 10 | #
|
---|
[96407] | 11 | # This file is part of VirtualBox base platform packages, as
|
---|
| 12 | # available from https://www.virtualbox.org.
|
---|
[5227] | 13 | #
|
---|
[96407] | 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 | #
|
---|
[2614] | 29 |
|
---|
[36584] | 30 | # Linux kbuild sets this to our source directory if we are called from there
|
---|
| 31 | obj ?= $(CURDIR)
|
---|
[77390] | 32 | include $(obj)/Makefile-header.gmk
|
---|
[77504] | 33 | VBOXSF_DIR = $(VBOX_MODULE_SRC_DIR)
|
---|
[11519] | 34 |
|
---|
[85939] | 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 |
|
---|
[77399] | 41 | VBOXMOD_NAME = vboxsf
|
---|
| 42 | VBOXMOD_OBJS = \
|
---|
[2614] | 43 | vfsmod.o \
|
---|
[4729] | 44 | dirops.o \
|
---|
[33439] | 45 | lnkops.o \
|
---|
[4729] | 46 | regops.o \
|
---|
| 47 | utils.o \
|
---|
[77054] | 48 | VBoxGuestR0LibGenericRequest.o \
|
---|
[68641] | 49 | VBoxGuestR0LibHGCM.o \
|
---|
[68564] | 50 | VBoxGuestR0LibIdc.o \
|
---|
| 51 | VBoxGuestR0LibIdc-unix.o \
|
---|
[77054] | 52 | VBoxGuestR0LibInit.o \
|
---|
| 53 | VBoxGuestR0LibPhysHeap.o \
|
---|
[68105] | 54 | VBoxGuestR0LibSharedFolders.o
|
---|
[84947] | 55 | ifeq ($(VBOX_KBUILD_TARGET_ARCH),x86)
|
---|
[77399] | 56 | VBOXMOD_OBJS += \
|
---|
[4729] | 57 | divdi3.o \
|
---|
| 58 | moddi3.o \
|
---|
| 59 | udivdi3.o \
|
---|
[67293] | 60 | udivmoddi4.o \
|
---|
[4729] | 61 | umoddi3.o \
|
---|
| 62 | qdivrem.o
|
---|
[21339] | 63 | endif
|
---|
[77399] | 64 | VBOXMOD_INCL = \
|
---|
[77403] | 65 | $(VBOXSF_DIR) \
|
---|
| 66 | $(VBOXSF_DIR)include \
|
---|
| 67 | $(VBOXSF_DIR)r0drv/linux
|
---|
[77399] | 68 | VBOXMOD_DEFS = \
|
---|
[77397] | 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
|
---|
[84947] | 79 | ifeq ($(VBOX_KBUILD_TARGET_ARCH),amd64)
|
---|
[77399] | 80 | VBOXMOD_DEFS += VBOX_WITH_64_BITS_GUESTS
|
---|
[11629] | 81 | endif
|
---|
[100191] | 82 | ifeq ($(VBOX_KBUILD_TARGET_ARCH),arm64)
|
---|
| 83 | VBOXMOD_DEFS += VBOX_WITH_64_BITS_GUESTS
|
---|
| 84 | endif
|
---|
[78135] | 85 | ifneq ($(filter %uek.x86_64,$(KERN_VER)),)
|
---|
| 86 | VBOXMOD_DEFS += VBOX_UEK
|
---|
| 87 | endif
|
---|
[77404] | 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
|
---|
[77393] | 94 | endif
|
---|
| 95 | ifdef VBOX_NO_OMIT_FRAME_POINTER
|
---|
[77399] | 96 | VBOXMOD_CFLAGS += -fno-omit-frame-pointer
|
---|
[77393] | 97 | endif
|
---|
[2614] | 98 |
|
---|
[77393] | 99 | ifneq ($(KERN_VERSION),24)
|
---|
[17564] | 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)
|
---|
[36584] | 102 | ifeq ($(KERNELRELEASE),)
|
---|
[77399] | 103 | VBOXMOD_CFLAGS += $(foreach inc,$(KERN_INCL),\
|
---|
[77393] | 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,),))
|
---|
[36584] | 110 | else
|
---|
[77399] | 111 | VBOXMOD_CFLAGS += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
|
---|
[77393] | 112 | echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
|
---|
| 113 | echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
|
---|
| 114 | echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
|
---|
[11472] | 115 | -DKERNEL_FC6,)
|
---|
[36584] | 116 | endif
|
---|
[6592] | 117 | endif
|
---|
[2614] | 118 |
|
---|
[77399] | 119 | VBOXMOD_CLEAN = . linux r0drv r0drv/linux
|
---|
[2614] | 120 |
|
---|
[77390] | 121 | include $(obj)/Makefile-footer.gmk
|
---|
[77389] | 122 |
|
---|