KERNELDIR := /usr/src/linux-headers-6.1.21-v8+ MODULE_NAME=ads1278 SRC := ads1278_core.c ifneq ($(KERNELRELEASE),) $(MODULE_NAME)-objs = $(SRC:.c=.o) obj-m := $(MODULE_NAME).o else PWD := $(shell pwd) default: ifeq ($(strip $(KERNELDIR)),) $(error "KERNELDIR is undefined!") else $(MAKE) -C $(KERNELDIR) scripts $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif clean: rm -rf *~ *.ko *.o *.mod.c modules.order Module.symvers .${MODULE_NAME}* .tmp_versions endif