]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - ubuntu/vbox/vboxguest/Makefile
UBUNTU: ubuntu: vbox -- update to 5.2.2-dfsg-2
[mirror_ubuntu-bionic-kernel.git] / ubuntu / vbox / vboxguest / Makefile
1 KBUILD_EXTMOD=${srctree}/ubuntu/vbox
2 # $Revision: 119168 $
3 ## @file
4 # VirtualBox Guest Additions Module Makefile.
5 #
6
7 #
8 # Copyright (C) 2006-2017 Oracle Corporation
9 #
10 # This file is part of VirtualBox Open Source Edition (OSE), as
11 # available from http://www.virtualbox.org. This file is free software;
12 # you can redistribute it and/or modify it under the terms of the GNU
13 # General Public License (GPL) as published by the Free Software
14 # Foundation, in version 2 as it comes in the "COPYING" file of the
15 # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 #
18 # The contents of this file may alternatively be used under the terms
19 # of the Common Development and Distribution License Version 1.0
20 # (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21 # VirtualBox OSE distribution, in which case the provisions of the
22 # CDDL are applicable instead of those of the GPL.
23 #
24 # You may elect to license modified versions of this file under the
25 # terms and conditions of either the GPL or the CDDL or both.
26 #
27
28 # Linux kbuild sets this to our source directory if we are called from there
29 obj ?= $(CURDIR)
30 include $(obj)/Makefile.include.header
31
32 MOD_NAME = vboxguest
33
34 MOD_OBJS = \
35 VBoxGuest-linux.o \
36 VBoxGuest.o \
37 VBoxGuestR0LibGenericRequest.o \
38 VBoxGuestR0LibHGCMInternal.o \
39 VBoxGuestR0LibInit.o \
40 VBoxGuestR0LibPhysHeap.o \
41 VBoxGuestR0LibVMMDev.o \
42 r0drv/alloc-r0drv.o \
43 r0drv/initterm-r0drv.o \
44 r0drv/memobj-r0drv.o \
45 r0drv/mpnotification-r0drv.o \
46 r0drv/powernotification-r0drv.o \
47 r0drv/linux/alloc-r0drv-linux.o \
48 r0drv/linux/assert-r0drv-linux.o \
49 r0drv/linux/initterm-r0drv-linux.o \
50 r0drv/linux/memobj-r0drv-linux.o \
51 r0drv/linux/memuserkernel-r0drv-linux.o \
52 r0drv/linux/mp-r0drv-linux.o \
53 r0drv/linux/mpnotification-r0drv-linux.o \
54 r0drv/linux/process-r0drv-linux.o \
55 r0drv/linux/semevent-r0drv-linux.o \
56 r0drv/linux/semeventmulti-r0drv-linux.o \
57 r0drv/linux/semfastmutex-r0drv-linux.o \
58 r0drv/linux/semmutex-r0drv-linux.o \
59 r0drv/linux/spinlock-r0drv-linux.o \
60 r0drv/linux/thread-r0drv-linux.o \
61 r0drv/linux/thread2-r0drv-linux.o \
62 r0drv/linux/time-r0drv-linux.o \
63 r0drv/linux/timer-r0drv-linux.o \
64 r0drv/linux/RTLogWriteDebugger-r0drv-linux.o \
65 r0drv/generic/semspinmutex-r0drv-generic.o \
66 common/alloc/alloc.o \
67 common/err/RTErrConvertFromErrno.o \
68 common/err/RTErrConvertToErrno.o \
69 common/err/errinfo.o \
70 common/log/log.o \
71 common/log/logellipsis.o \
72 common/log/logrel.o \
73 common/log/logrelellipsis.o \
74 common/log/logcom.o \
75 common/log/logformat.o \
76 common/misc/RTAssertMsg1Weak.o \
77 common/misc/RTAssertMsg2.o \
78 common/misc/RTAssertMsg2Add.o \
79 common/misc/RTAssertMsg2AddWeak.o \
80 common/misc/RTAssertMsg2AddWeakV.o \
81 common/misc/RTAssertMsg2Weak.o \
82 common/misc/RTAssertMsg2WeakV.o \
83 common/misc/assert.o \
84 common/misc/thread.o \
85 common/string/RTStrCat.o \
86 common/string/RTStrCopy.o \
87 common/string/RTStrCopyEx.o \
88 common/string/RTStrCopyP.o \
89 common/string/strformat.o \
90 common/string/strformatrt.o \
91 common/string/strformattype.o \
92 common/string/strprintf.o \
93 common/string/strtonum.o \
94 common/table/avlpv.o \
95 common/time/time.o \
96 generic/RTAssertShouldPanic-generic.o \
97 generic/RTLogWriteStdErr-stub-generic.o \
98 generic/RTLogWriteStdOut-stub-generic.o \
99 generic/RTMpGetCoreCount-generic.o \
100 generic/RTSemEventWait-2-ex-generic.o \
101 generic/RTSemEventWaitNoResume-2-ex-generic.o \
102 generic/RTSemEventMultiWait-2-ex-generic.o \
103 generic/RTSemEventMultiWaitNoResume-2-ex-generic.o \
104 generic/rtStrFormatKernelAddress-generic.o \
105 generic/errvars-generic.o \
106 generic/mppresent-generic.o \
107 VBox/log-vbox.o \
108 VBox/logbackdoor.o
109 ifeq ($(BUILD_TARGET_ARCH),x86)
110 MOD_OBJS += \
111 common/math/gcc/divdi3.o \
112 common/math/gcc/moddi3.o \
113 common/math/gcc/udivdi3.o \
114 common/math/gcc/udivmoddi4.o \
115 common/math/gcc/umoddi3.o \
116 common/math/gcc/qdivrem.o
117 endif
118 ifeq ($(BUILD_TARGET_ARCH),amd64)
119 MOD_OBJS += common/alloc/heapsimple.o
120 endif
121
122 MOD_DEFS = -DVBOX -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_GUEST \
123 -DIN_GUEST_R0 -DIN_MODULE -DRT_WITH_VBOX -DVBGL_VBOXGUEST \
124 -DVBOX_WITH_HGCM
125 ifeq ($(BUILD_TARGET_ARCH),amd64)
126 MOD_DEFS += -DRT_ARCH_AMD64
127 else
128 MOD_DEFS += -DRT_ARCH_X86
129 endif
130 ifeq ($(BUILD_TARGET_ARCH),amd64)
131 MOD_DEFS += -DVBOX_WITH_64_BITS_GUESTS
132 endif
133 MOD_INCL = $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
134 MOD_INCL += $(addprefix -I$(KBUILD_EXTMOD)/vboxguest,/ /include /r0drv/linux)
135
136 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxguest),)
137 MANGLING := $(KBUILD_EXTMOD)/vboxguest/include/VBox/VBoxGuestMangling.h
138 else
139 MANGLING := $(KBUILD_EXTMOD)/include/VBox/VBoxGuestMangling.h
140 endif
141 ifeq ($(KERN_VERSION),24)
142 ## @todo move to MOD_DEFS when we have finished refactoring
143 MOD_CFLAGS = -DEXPORT_SYMTAB
144 else
145 MOD_CFLAGS = -Wno-declaration-after-statement -include $(MANGLING) -fno-pie
146 endif
147
148 MOD_CLEAN = . linux r0drv generic r0drv/linux r0drv/generic VBox \
149 common/alloc common/err common/log common/math/gcc common/misc \
150 common/string common/table common/time
151
152 include $(obj)/Makefile.include.footer
153
154 check: $(MOD_NAME)
155 @if ! readelf -p __ksymtab_strings vboxguest.ko | grep -E "\[.*\] *(RT|g_..*RT.*)"; then \
156 echo "All exported IPRT symbols are properly renamed!"; \
157 else \
158 echo "error: Some exported IPRT symbols was not properly renamed! See above." >&2; \
159 false; \
160 fi
161