1
0

Add example kernel module

This commit is contained in:
2018-10-07 10:48:25 +00:00
parent 0e03daf21c
commit 97842d8753
5 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,15 @@
# out-of-tree called make with two arguments -- kernel headers path and name
# of target binary that MUST be produced by makefile
# e.g.:
# make KERNEL=/lib/modules/4.8.0-58-generic/build TARGET=hello-world.ko
KERNEL := /lib/modules/$(shell uname -r)/build
TARGET := out-of-tree-module-example
obj-m += $(TARGET).o
$(TARGET)-objs = module.o
all:
make -C $(KERNEL) M=$(PWD) modules
clean:
make -C $(KERNEL) M=$(PWD) clean