-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (31 loc) · 1.04 KB
/
Makefile
File metadata and controls
38 lines (31 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
CC=gcc
INC=-I/usr/include/libusb-1.0
LIB=-L/lib/$(arch)-linux-gnu/libusb-1.0.so.0
.PHONY: all clean archive
obj-m += trust_flex.o
all:
$(CC) detach_usbhid.c $(INC) $(LIB) -lusb-1.0 -o detach_usbhid
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
rm detach_usbhid
archive:
tar f - --exclude=.git -C ../ -c trust_flex | gzip -c9 > ../trust_flex-`date +%Y%m%d`.tgz
install:
cp ./trust_flex.ko /lib/modules/$(shell uname -r)/kernel/drivers/input/tablet/
echo trust_flex >> /etc/modules
depmod
cp ./load_trust_flex.sh /usr/local/bin
cp ./detach_usbhid /usr/local/bin
cp ./load_trust_flex.rules /etc/udev/rules.d
/sbin/udevadm control --reload
modprobe trust_flex
uninstall:
rm /usr/local/bin/load_trust_flex.sh
rm /usr/local/bin/detach_usbhid
rm /etc/udev/rules.d/load_trust_flex.rules
/sbin/udevadm control --reload
rm /lib/modules/$(shell uname -r)/kernel/drivers/input/tablet/trust_flex.ko
sed -i '/trust_flex/d' /etc/modules
depmod
rmmod trust_flex