]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - ubuntu/vbox/vboxsf/Makefile
UBUNTU: ubuntu: vbox -- update to 5.2.2-dfsg-2
[mirror_ubuntu-bionic-kernel.git] / ubuntu / vbox / vboxsf / Makefile
1 KBUILD_EXTMOD=${srctree}/ubuntu/vbox
2 # $Id: Makefile.module $
3 ## @file
4 # VirtualBox Guest Additions Module Makefile.
5 #
6 # (For 2.6.x this file must be 'Makefile'!)
7 #
8
9 #
10 # Copyright (C) 2006-2017 Oracle Corporation
11 #
12 # This file is part of VirtualBox Open Source Edition (OSE), as
13 # available from http://www.virtualbox.org. This file is free software;
14 # you can redistribute it and/or modify it under the terms of the GNU
15 # General Public License (GPL) as published by the Free Software
16 # Foundation, in version 2 as it comes in the "COPYING" file of the
17 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
19 #
20
21 # Linux kbuild sets this to our source directory if we are called from there
22 obj ?= $(CURDIR)
23 include $(obj)/Makefile.include.header
24
25 MOD_NAME = vboxsf
26 MOD_OBJS = \
27 vfsmod.o \
28 dirops.o \
29 lnkops.o \
30 regops.o \
31 utils.o \
32 VBoxGuestR0LibHGCM.o \
33 VBoxGuestR0LibIdc.o \
34 VBoxGuestR0LibIdc-unix.o \
35 VBoxGuestR0LibSharedFolders.o
36 ifeq ($(BUILD_TARGET_ARCH),x86)
37 MOD_OBJS += \
38 divdi3.o \
39 moddi3.o \
40 udivdi3.o \
41 udivmoddi4.o \
42 umoddi3.o \
43 qdivrem.o
44 endif
45
46 MOD_INCL = \
47 $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux) \
48 $(addprefix -I$(KBUILD_EXTMOD)/vboxsf,/ /include /r0drv/linux)
49
50 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxsf),)
51 MANGLING := $(KBUILD_EXTMOD)/vboxsf/include/VBox/VBoxGuestMangling.h
52 else
53 MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h
54 endif
55
56 MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
57 -DIN_SUP_R0 -DVBOX -DVBOX_WITH_HGCM -DIN_MODULE -DIN_GUEST_R0
58 # our module does not export any symbol
59 MOD_DEFS += -DRT_NO_EXPORT_SYMBOL
60 ifeq ($(BUILD_TARGET_ARCH),amd64)
61 MOD_DEFS += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
62 else
63 MOD_DEFS += -DRT_ARCH_X86
64 endif
65
66 ifeq ($(KERN_VERSION), 24)
67 MOD_CFLAGS =
68 else
69 MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING) -fno-pie
70
71 # special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
72 # ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
73 ifeq ($(KERNELRELEASE),)
74 MOD_EXTRA += $(foreach inc,$(KERN_INCL),\
75 $(if $(wildcard $(inc)/linux/utsrelease.h),\
76 $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
77 grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
78 grep '"2.6.18.*v5.*"' $(inc)/linux/utsrelease.h; \
79 grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
80 -DKERNEL_FC6,),))
81 else
82 MOD_EXTRA += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
83 echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
84 echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
85 echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
86 -DKERNEL_FC6,)
87 endif
88 endif
89
90 MOD_CLEAN = . linux r0drv r0drv/linux
91
92 include $(obj)/Makefile.include.footer