blob: af2daf601d39a9ee2278672b9c3a0af520372238 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
|