From 5ce3f5c841eb64854af1c7fe47fac003ca31419a Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 14 May 2024 19:52:38 +0200 Subject: WIP 9.3 --- driver/Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'driver/Makefile') diff --git a/driver/Makefile b/driver/Makefile index 7de7424..f9cb359 100644 --- a/driver/Makefile +++ b/driver/Makefile @@ -9,9 +9,17 @@ obj-m += lork.o lork-y += main.o lork-y += platform.o -all: +# utility +ifneq ($(shell id -u),0) +AS_ROOT := sudo -n +endif +.PHONY: FORCE + +lork.ko: FORCE $(MAKE) -C $(KERNEL) M=$(PWD) modules +all: lork.ko FORCE + # the generated compile_commands.json needs to be edited to point to the kernel # folder as working directory because the include paths are relative compile_commands.json: @@ -19,3 +27,7 @@ compile_commands.json: jq --arg dir $(KERNEL) '.[].directory = $$dir' $@.tmp > $@ $(RM) $@.tmp +poke: lork.ko FORCE + $(AS_ROOT) insmod $< + $(AS_ROOT) rmmod $< + -- cgit v1.2.3