2020-11-08 00:19:03 +01:00
|
|
|
obj-m += nct6687.o
|
|
|
|
|
2022-02-12 20:12:07 +01:00
|
|
|
curpwd := $(shell pwd)
|
|
|
|
kver := $(shell uname -r)
|
2020-11-08 00:19:03 +01:00
|
|
|
|
2022-02-12 20:12:07 +01:00
|
|
|
build:
|
2022-02-15 23:06:26 +01:00
|
|
|
rm -rf ${curpwd}/${kver}
|
|
|
|
mkdir -p ${curpwd}/${kver}
|
2022-02-12 20:12:07 +01:00
|
|
|
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/
|
2020-11-08 00:19:03 +01:00
|
|
|
sudo depmod
|
|
|
|
sudo modprobe nct6687
|
|
|
|
|
|
|
|
clean:
|
2022-02-15 23:06:26 +01:00
|
|
|
[ -d "${curpwd}/${kver}" ] && make -C /lib/modules/${kver}/build M=${curpwd}/${kver} clean
|
2022-02-22 11:11:27 +01:00
|
|
|
|
|
|
|
|
2022-04-22 17:55:20 +02:00
|
|
|
|
|
|
|
dkms/build:
|
|
|
|
make -C /lib/modules/${kver}/build M=${curpwd} modules
|
|
|
|
|
|
|
|
dkms/install:
|
|
|
|
rm -rf ${curpwd}/dkms
|
|
|
|
mkdir -p ${curpwd}/dkms
|
|
|
|
cp ${curpwd}/dkms.conf ${curpwd}/Makefile ${curpwd}/nct6687.c ${curpwd}/dkms
|
2022-04-22 18:20:53 +02:00
|
|
|
sudo rm -rf /usr/src/nct6687d-1
|
2022-04-22 17:55:20 +02:00
|
|
|
sudo cp -rT dkms /usr/src/nct6687d-1
|
|
|
|
sudo dkms install nct6687d/1
|
|
|
|
sudo modprobe nct6687
|
|
|
|
|
|
|
|
dkms/clean:
|
|
|
|
sudo dkms remove nct6687d/1
|
|
|
|
make -C /lib/modules/${kver}/build M=${curpwd} clean
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-22 11:11:27 +01:00
|
|
|
debian/changelog: FORCE
|
|
|
|
git --no-pager log \
|
|
|
|
--format='nct6687d-dkms (%ad) unstable; urgency=low%n%n * %s%n%n -- %aN <%aE> %aD%n' \
|
|
|
|
--date='format:%Y%m%d-%H%M%S' \
|
|
|
|
> $@
|
|
|
|
|
|
|
|
deb: debian/changelog
|
|
|
|
dpkg-buildpackage -b -rfakeroot -us -uc
|
|
|
|
|
|
|
|
.PHONY: FORCE
|
2022-04-22 17:55:20 +02:00
|
|
|
FORCE:
|