parameterize kernel directory

The directory for kernel headers can now be
overridden through the KERNEL_DIR variable
This commit is contained in:
anna 2023-08-10 03:11:18 +02:00
parent 23d2512131
commit 827f5d3424
Signed by: fef
GPG key ID: 2585C2DC6D79B485

View file

@ -1,4 +1,5 @@
KERNELRELEASE ?= $(shell uname -r)
KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build
DEBUG ?= n
ifeq ($(DEBUG),y)
@ -7,7 +8,7 @@ else
EXTRA_CFLAGS += -O2
endif
EXTRA_CFLAGS += -I$(PWD)/include
EXTRA_CFLAGS += "-I$(PWD)/include"
obj-m += keymash.o
@ -16,10 +17,10 @@ keymash-sources = src/keymash.c
keymash-objs = $(keymash-sources:.c=.o)
keymash.ko:
make -C "/lib/modules/$(KERNELRELEASE)/build" M="$(PWD)" modules
make -C "$(KERNEL_DIR)" M="$(PWD)" modules
clean:
make -C "/lib/modules/$(KERNELRELEASE)/build" M="$(PWD)" clean
make -C "$(KERNEL_DIR)" M="$(PWD)" clean
all: keymash.ko