summarylogtreecommitdiffstats
path: root/013-Makefile.patch
blob: c7dc2b9fccb669da19fb5ed63e0b91960fee5a27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- a/src/vboxhost/Makefile
+++ b/src/vboxhost/Makefile
@@ -33,25 +33,25 @@
 # SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
 #
 
-ifneq ($(KERNELRELEASE),)
+ifneq ($(KBUILD_EXTMOD),)
 
-# Building from kBuild (make -C <kernel_directory> M=`pwd`),
-# or inside a kernel source tree.
+# Building from kBuild (make -C <kernel_directory> M=`pwd`).
+# KBUILD_EXTMOD is set to $(M) in this case.
 
 obj-m = vboxdrv/
- ifneq ($(wildcard $(CURDIR)/vboxnetflt/Makefile),)
+ ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),)
 obj-m += vboxnetflt/
  endif
- ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),)
+ ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),)
 obj-m += vboxnetadp/
  endif
- ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),)
+ ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci/Makefile),)
 obj-m += vboxpci/
  endif
 
-else # ! KERNELRELEASE
+else # ! KBUILD_EXTMOD
 
-# convenience Makefile without KERNELRELEASE
+# convenience Makefile without KBUILD_EXTMOD
 
 ifndef SUDO
  ifneq ($(shell id -u),0)
@@ -244,5 +244,5 @@ load: unload
 		fi; \
 	done
 
-endif # ! KERNELRELEASE
+endif # ! KBUILD_EXTMOD