]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - ubuntu/vbox/vboxsf/Makefile
UBUNTU: ubuntu: vbox -- update to 5.2.0-dfsg-2
[mirror_ubuntu-bionic-kernel.git] / ubuntu / vbox / vboxsf / Makefile
1 KBUILD_EXTMOD=${srctree}/ubuntu/vbox
2 #
3 # VirtualBox Guest Additions Module Makefile.
4 #
5 # (For 2.6.x this file must be 'Makefile'!)
6 #
7 # Copyright (C) 2006-2011 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 # Linux kbuild sets this to our source directory if we are called from there
19 obj ?= $(CURDIR)
20 include $(obj)/Makefile.include.header
21
22 MOD_NAME = vboxsf
23 MOD_OBJS = \
24 vfsmod.o \
25 dirops.o \
26 lnkops.o \
27 regops.o \
28 utils.o \
29 VBoxGuestR0LibHGCM.o \
30 VBoxGuestR0LibIdc.o \
31 VBoxGuestR0LibIdc-unix.o \
32 VBoxGuestR0LibSharedFolders.o
33 ifeq ($(BUILD_TARGET_ARCH),x86)
34 MOD_OBJS += \
35 divdi3.o \
36 moddi3.o \
37 udivdi3.o \
38 udivmoddi4.o \
39 umoddi3.o \
40 qdivrem.o
41 endif
42
43 MOD_INCL = \
44 $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux) \
45 $(addprefix -I$(KBUILD_EXTMOD)/vboxsf,/ /include /r0drv/linux)
46
47 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxsf),)
48 MANGLING := $(KBUILD_EXTMOD)/vboxsf/include/VBox/VBoxGuestMangling.h
49 else
50 MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h
51 endif
52
53 MOD_DEFS = -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
54 -DIN_SUP_R0 -DVBOX -DVBOX_WITH_HGCM -DIN_MODULE -DIN_GUEST_R0
55 # our module does not export any symbol
56 MOD_DEFS += -DRT_NO_EXPORT_SYMBOL
57 ifeq ($(BUILD_TARGET_ARCH),amd64)
58 MOD_DEFS += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
59 else
60 MOD_DEFS += -DRT_ARCH_X86
61 endif
62
63 ifeq ($(KERN_VERSION), 24)
64 MOD_CFLAGS =
65 else
66 MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -include $(MANGLING) -fno-pie
67
68 # special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
69 # ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
70 ifeq ($(KERNELRELEASE),)
71 MOD_EXTRA += $(foreach inc,$(KERN_INCL),\
72 $(if $(wildcard $(inc)/linux/utsrelease.h),\
73 $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
74 grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
75 grep '"2.6.18.*v5.*"' $(inc)/linux/utsrelease.h; \
76 grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
77 -DKERNEL_FC6,),))
78 else
79 MOD_EXTRA += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
80 echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
81 echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
82 echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
83 -DKERNEL_FC6,)
84 endif
85 endif
86
87 MOD_CLEAN = . linux r0drv r0drv/linux
88
89 include $(obj)/Makefile.include.footer