From 9acb2d763567919bde0b533a259065bbcf12ce5f Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 12 Jul 2023 16:07:20 +0200 Subject: Update --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..af2daf6 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +# Linux Makefile Location: +#LML="/usr/src/linux-headers-$(shell uname -r)/" +LML="/lib/modules/$(shell uname -r)/build/" # Change if required on your system + +obj-m += ina260.o + +all: ina260.c + make -C $(LML) M=$(PWD) modules + +run: ina260.c + -echo 0x40 > /sys/bus/i2c/devices/i2c-2/delete_device + -rmmod ina260 + make clean + make + insmod ina260.ko + echo ina260 0x40 > /sys/bus/i2c/devices/i2c-2/new_device + +read: read.c + gcc $^ -o read + +clean: + rm -f ina260*.o ina260.ko ina260.mod* Module.symvers modules.order .ina260* .Module* .modules* + +.PHONY: clean run -- cgit v1.2.3