1 | # $Id: Makefile 77403 2019-02-20 18:44:36Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the VirtualBox Linux Host Driver.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2019 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 | # The contents of this file may alternatively be used under the terms
|
---|
18 | # of the Common Development and Distribution License Version 1.0
|
---|
19 | # (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | # VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | # CDDL are applicable instead of those of the GPL.
|
---|
22 | #
|
---|
23 | # You may elect to license modified versions of this file under the
|
---|
24 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | #
|
---|
26 |
|
---|
27 | # Find the directory of this makefile.
|
---|
28 | VBOXDRV_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
|
---|
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 |
|
---|
34 | VBOXMOD_NAME = vboxdrv
|
---|
35 | VBOXMOD_OBJS = \
|
---|
36 | linux/SUPDrv-linux.o \
|
---|
37 | SUPDrv.o \
|
---|
38 | SUPDrvGip.o \
|
---|
39 | SUPDrvSem.o \
|
---|
40 | SUPDrvTracer.o \
|
---|
41 | SUPLibAll.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/assert-r0drv-linux.o \
|
---|
48 | r0drv/linux/alloc-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/rtStrFormatKernelAddress-r0drv-linux.o \
|
---|
56 | r0drv/linux/semevent-r0drv-linux.o \
|
---|
57 | r0drv/linux/semeventmulti-r0drv-linux.o \
|
---|
58 | r0drv/linux/semfastmutex-r0drv-linux.o \
|
---|
59 | r0drv/linux/semmutex-r0drv-linux.o \
|
---|
60 | r0drv/linux/spinlock-r0drv-linux.o \
|
---|
61 | r0drv/linux/thread-r0drv-linux.o \
|
---|
62 | r0drv/linux/thread2-r0drv-linux.o \
|
---|
63 | r0drv/linux/threadctxhooks-r0drv-linux.o \
|
---|
64 | r0drv/linux/time-r0drv-linux.o \
|
---|
65 | r0drv/linux/timer-r0drv-linux.o \
|
---|
66 | r0drv/generic/semspinmutex-r0drv-generic.o \
|
---|
67 | common/alloc/alloc.o \
|
---|
68 | common/checksum/crc32.o \
|
---|
69 | common/checksum/ipv4.o \
|
---|
70 | common/checksum/ipv6.o \
|
---|
71 | common/err/RTErrConvertFromErrno.o \
|
---|
72 | common/err/RTErrConvertToErrno.o \
|
---|
73 | common/err/errinfo.o \
|
---|
74 | common/log/log.o \
|
---|
75 | common/log/logellipsis.o \
|
---|
76 | common/log/logrel.o \
|
---|
77 | common/log/logrelellipsis.o \
|
---|
78 | common/log/logcom.o \
|
---|
79 | common/log/logformat.o \
|
---|
80 | common/misc/RTAssertMsg1Weak.o \
|
---|
81 | common/misc/RTAssertMsg2.o \
|
---|
82 | common/misc/RTAssertMsg2Add.o \
|
---|
83 | common/misc/RTAssertMsg2AddWeak.o \
|
---|
84 | common/misc/RTAssertMsg2AddWeakV.o \
|
---|
85 | common/misc/RTAssertMsg2Weak.o \
|
---|
86 | common/misc/RTAssertMsg2WeakV.o \
|
---|
87 | common/misc/assert.o \
|
---|
88 | common/misc/handletable.o \
|
---|
89 | common/misc/handletablectx.o \
|
---|
90 | common/misc/thread.o \
|
---|
91 | common/string/RTStrCat.o \
|
---|
92 | common/string/RTStrCopy.o \
|
---|
93 | common/string/RTStrCopyEx.o \
|
---|
94 | common/string/RTStrCopyP.o \
|
---|
95 | common/string/RTStrNCmp.o \
|
---|
96 | common/string/RTStrNLen.o \
|
---|
97 | common/string/stringalloc.o \
|
---|
98 | common/string/strformat.o \
|
---|
99 | common/string/strformatnum.o \
|
---|
100 | common/string/strformatrt.o \
|
---|
101 | common/string/strformattype.o \
|
---|
102 | common/string/strprintf.o \
|
---|
103 | common/string/strtonum.o \
|
---|
104 | common/table/avlpv.o \
|
---|
105 | common/time/time.o \
|
---|
106 | r0drv/linux/RTLogWriteDebugger-r0drv-linux.o \
|
---|
107 | generic/RTAssertShouldPanic-generic.o \
|
---|
108 | generic/RTLogWriteStdErr-stub-generic.o \
|
---|
109 | generic/RTLogWriteStdOut-stub-generic.o \
|
---|
110 | generic/RTLogWriteUser-generic.o \
|
---|
111 | generic/RTMpGetArraySize-generic.o \
|
---|
112 | generic/RTMpGetCoreCount-generic.o \
|
---|
113 | generic/RTSemEventWait-2-ex-generic.o \
|
---|
114 | generic/RTSemEventWaitNoResume-2-ex-generic.o \
|
---|
115 | generic/RTSemEventMultiWait-2-ex-generic.o \
|
---|
116 | generic/RTSemEventMultiWaitNoResume-2-ex-generic.o \
|
---|
117 | generic/RTTimerCreate-generic.o \
|
---|
118 | generic/errvars-generic.o \
|
---|
119 | generic/mppresent-generic.o \
|
---|
120 | generic/uuid-generic.o \
|
---|
121 | VBox/log-vbox.o
|
---|
122 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
123 | VBOXMOD_OBJS += \
|
---|
124 | math/gcc/divdi3.o \
|
---|
125 | math/gcc/moddi3.o \
|
---|
126 | math/gcc/qdivrem.o \
|
---|
127 | math/gcc/udivdi3.o \
|
---|
128 | math/gcc/udivmoddi4.o \
|
---|
129 | math/gcc/divdi3.o \
|
---|
130 | math/gcc/umoddi3.o
|
---|
131 | endif
|
---|
132 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
133 | VBOXMOD_OBJS += common/alloc/heapsimple.o
|
---|
134 | endif
|
---|
135 | ifdef VBOX_WITH_NATIVE_DTRACE
|
---|
136 | VBOXMOD_OBJS += SUPDrvDTrace.o
|
---|
137 | endif
|
---|
138 | VBOXMOD_INCL = \
|
---|
139 | $(VBOXDRV_DIR) \
|
---|
140 | $(VBOXDRV_DIR)include \
|
---|
141 | $(VBOXDRV_DIR)r0drv/linux
|
---|
142 | ifdef VBOX_WITH_NATIVE_DTRACE
|
---|
143 | VBOXMOD_INCL += \
|
---|
144 | /usr/include/linux \
|
---|
145 | /usr/include
|
---|
146 | endif
|
---|
147 | VBOXMOD_DEFS = \
|
---|
148 | RT_OS_LINUX \
|
---|
149 | IN_RING0 \
|
---|
150 | IN_RT_R0 \
|
---|
151 | IN_SUP_R0 \
|
---|
152 | VBOX \
|
---|
153 | RT_WITH_VBOX \
|
---|
154 | VBOX_WITH_HARDENING \
|
---|
155 | SUPDRV_WITH_RELEASE_LOGGER \
|
---|
156 | VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV \
|
---|
157 | IPRT_WITH_EFLAGS_AC_PRESERVING \
|
---|
158 | VBOX_WITH_64_BITS_GUESTS # <-- must be consistent with Config.kmk!
|
---|
159 | ifndef CONFIG_VBOXDRV_FIXEDMAJOR
|
---|
160 | VBOXMOD_DEFS += CONFIG_VBOXDRV_AS_MISC
|
---|
161 | endif
|
---|
162 | ifdef VBOX_WITH_NATIVE_DTRACE
|
---|
163 | VBOXMOD_DEFS += VBOX_WITH_NATIVE_DTRACE
|
---|
164 | endif
|
---|
165 | ifdef VBOX_WITH_TEXT_MODMEM_HACK
|
---|
166 | VBOXMOD_DEFS += RTMEMALLOC_EXEC_HEAP VBOX_WITH_TEXT_MODMEM_HACK
|
---|
167 | endif
|
---|
168 | VBOXMOD_CFLAGS = -include $(VBOXDRV_DIR)include/VBox/SUPDrvMangling.h \
|
---|
169 | -fno-omit-frame-pointer -fno-pie -Wno-declaration-after-statement
|
---|
170 |
|
---|
171 |
|
---|
172 | include $(obj)/Makefile-footer.gmk
|
---|
173 |
|
---|
174 | check: $(VBOXMOD_0_TARGET)
|
---|
175 | @if ! readelf -p __ksymtab_strings vboxdrv.ko | grep -E "\[.*\] *(RT|g_..*RT.*)"; then \
|
---|
176 | echo "All exported IPRT symbols are properly renamed!"; \
|
---|
177 | else \
|
---|
178 | echo "error: Some exported IPRT symbols was not properly renamed! See above." >&2; \
|
---|
179 | false; \
|
---|
180 | fi
|
---|
181 |
|
---|