diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-05-14 19:52:38 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-05-14 19:52:38 +0200 |
commit | 5ce3f5c841eb64854af1c7fe47fac003ca31419a (patch) | |
tree | 12addae5521689eb685ef811de0038abc68e0721 /driver/Makefile | |
parent | cfcf4b94f312eeb88e462f3eec88b932d672ef3d (diff) |
WIP 9.3
Diffstat (limited to 'driver/Makefile')
-rw-r--r-- | driver/Makefile | 14 |
1 files changed, 13 insertions, 1 deletions
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 $< + |