From dcca03f27879701d7377109517176a3aae86619f Mon Sep 17 00:00:00 2001 From: Mikk Mar Date: Wed, 28 Aug 2019 16:01:25 +0300 Subject: Makefile: allow specifying kernel release This makes depmod work when building/installing the module for a kernel other than the currently running one. Signed-off-by: Mikk Mar --- src/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 24b2ba0..8226038 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,8 @@ # # Copyright (C) 2015-2019 Jason A. Donenfeld . All Rights Reserved. -KERNELDIR ?= /lib/modules/$(shell uname -r)/build +KERNELRELEASE ?= $(shell uname -r) +KERNELDIR ?= /lib/modules/$(KERNELRELEASE)/build PREFIX ?= /usr DESTDIR ?= SRCDIR ?= $(PREFIX)/src @@ -45,7 +46,7 @@ clean: module-install: @$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install - $(DEPMOD) -a + $(DEPMOD) -a $(KERNELRELEASE) install: module-install tools-install -- cgit v1.2.3-59-g8ed1b