mirror of
https://github.com/Fred78290/nct6687d
synced 2025-02-08 08:48:24 +01:00
New Makefile
This commit is contained in:
parent
63062c5003
commit
08eccc5092
1 changed files with 12 additions and 5 deletions
17
Makefile
17
Makefile
|
@ -1,12 +1,19 @@
|
||||||
obj-m += nct6687.o
|
obj-m += nct6687.o
|
||||||
|
|
||||||
all:
|
curpwd := $(shell pwd)
|
||||||
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
|
kver := $(shell uname -r)
|
||||||
|
|
||||||
install: all
|
build:
|
||||||
sudo cp nct6687.ko /lib/modules/$(shell uname -r)/kernel/drivers/hwmon/
|
[ -d "${curpwd}/${kver}" ] && rm -rf ${curpwd}/${kver}
|
||||||
|
mkdir ${curpwd}/${kver}
|
||||||
|
cp ${curpwd}/Makefile ${curpwd}/nct6687.c ${curpwd}/${kver}
|
||||||
|
cd ${curpwd}/${kver}
|
||||||
|
make -C /lib/modules/${kver}/build M=${curpwd}/${kver} modules
|
||||||
|
|
||||||
|
install: build
|
||||||
|
sudo cp ${curpwd}/${kver}/nct6687.ko /lib/modules/${kver}/kernel/drivers/hwmon/
|
||||||
sudo depmod
|
sudo depmod
|
||||||
sudo modprobe nct6687
|
sudo modprobe nct6687
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean
|
make -C /lib/modules/${kver}/build M=${curpwd}/${kver} clean
|
||||||
|
|
Loading…
Add table
Reference in a new issue