1 From eb9ded87d9d1a6755f2bb7258641c9c80c54c347 Mon Sep 17 00:00:00 2001
2 From: Christian Hesse <mail@eworm.de>
3 Date: Mon, 17 Oct 2022 16:30:32 +0200
4 Subject: [PATCH] support building from dkms
7 src/VBox/HostDrivers/linux/Makefile | 18 +++++++++---------
8 1 file changed, 9 insertions(+), 9 deletions(-)
10 diff --git a/src/VBox/HostDrivers/linux/Makefile b/src/VBox/HostDrivers/linux/Makefile
11 index badeb4f4..314281f3 100644
12 --- a/src/VBox/HostDrivers/linux/Makefile
13 +++ b/src/VBox/HostDrivers/linux/Makefile
15 # SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
18 -ifneq ($(KERNELRELEASE),)
19 +ifneq ($(KBUILD_EXTMOD),)
21 -# Building from kBuild (make -C <kernel_directory> M=`pwd`),
22 -# or inside a kernel source tree.
23 +# Building from kBuild (make -C <kernel_directory> M=`pwd`).
24 +# KBUILD_EXTMOD is set to $(M) in this case.
27 - ifneq ($(wildcard $(CURDIR)/vboxnetflt/Makefile),)
28 + ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetflt/Makefile),)
31 - ifneq ($(wildcard $(CURDIR)/vboxnetadp/Makefile),)
32 + ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxnetadp/Makefile),)
35 - ifneq ($(wildcard $(CURDIR)/vboxpci/Makefile),)
36 + ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxpci/Makefile),)
40 -else # ! KERNELRELEASE
41 +else # ! KBUILD_EXTMOD
43 -# convenience Makefile without KERNELRELEASE
44 +# convenience Makefile without KBUILD_EXTMOD
47 ifneq ($(shell id -u),0)
48 @@ -244,5 +244,5 @@ load: unload
52 -endif # ! KERNELRELEASE
53 +endif # ! KBUILD_EXTMOD