commit 903ef79c132e3a913ee1873cea51522413c18445 parent 325cd1c69b15721347a9007202ae9b470ebc9f2a Author: deurzen <m.deurzen@tum.de> Date: Fri, 20 Nov 2020 15:35:23 +0100 updates make process Diffstat:
M | Makefile | | | 17 | ++++++++++++++--- |
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,10 +1,21 @@ -obj-m += g7.o -g7-objs := ./src/g7.o ./src/ioctl.o - +TARGET := g7 KERNELDIR := /lib/modules/$(shell uname -r)/build +src_files := $(wildcard $(src)/src/*.c) +src_files += $(wildcard $(src)/src/$(TARGET)/*.c) +src_files := $(src_files:$(src)/%=%) + +obj-m += $(TARGET).o +$(TARGET)-objs := $(src_files:%.c=%.o) + all: make -C $(KERNELDIR) M=$(PWD) modules clean: make -C $(KERNELDIR) M=$(PWD) clean + +install: + sudo insmod ./$(TARGET).ko + +remove: + sudo rmmod $(TARGET)