Update makefile to allow kernel override

This commit is contained in:
Omar Pakker 2019-06-05 01:08:00 +02:00 committed by Geoffrey McRae
parent 2b4f8091f9
commit 71ffa0a137

View File

@ -1,11 +1,13 @@
obj-m += kvmfr.o obj-m += kvmfr.o
USER := $(shell whoami) USER := $(shell whoami)
KVER ?= $(shell uname -r)
KDIR ?= /lib/modules/$(KVER)/build
all: all:
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules make -C $(KDIR) M=$(PWD) modules
clean: clean:
make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean make -C $(KDIR) M=$(PWD) clean
test: all test: all
grep -q '^uio' /proc/modules || sudo modprobe uio grep -q '^uio' /proc/modules || sudo modprobe uio