# Comment/uncomment the following line to disable/enable debugging ifneq ($(KERNELRELEASE),) # call from kernel build system obj-m := battery_drv.o else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) all: modules modules: battery_drv.c $(MAKE) -C $(KERNELDIR) M=$(PWD) modules install: modules $(MAKE) -C $(KERNELDIR) M=$(PWD) install tty-battery : tty-battery.c $(CC) -Wall $^ -o $@ -D_GNU_SOURCE clean: $(MAKE) -C $(KERNELDIR) M=$(PWD) clean endif