-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (44 loc) · 1.52 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
50
BUILD_DIR := /usr/src/linux-$(shell uname -r)
ifeq ("$(wildcard $(BUILD_DIR))","")
BUILD_DIR := /lib/modules/$(shell uname -r)/build
endif
MAKE_OPTS = -C $(BUILD_DIR) M=`pwd` SUBDIRS=`pwd`
PATH_SYSFS := $(shell find /sys/ -name get_icons | sed 's/\/get_icons//')
#EXTRA_CFLAGS += -DDEBUG -O0 -g -Wall
SHELL := $(shell which bash)
obj-m += yealink.o
modules:
make $(MAKE_OPTS) $@
clean:
make $(MAKE_OPTS) $@
test: modules
[ "$(PATH_SYSFS)" ] || { echo "No device connected, aborting tests."; false; }
modprobe uhci_hcd || :
modprobe evdev || :
rmmod yealink || :
insmod yealink.ko
sleep 1
cat $(PATH_SYSFS)/model
echo -n RINGTONE > $(PATH_SYSFS)/show_icon
date +"%m.%e.%k:%M" | sed 's/^0/ /' > $(PATH_SYSFS)/line1
LANG=C date +%a | perl -e 'printf "%.2s", uc(<>);' > $(PATH_SYSFS)/show_icon
cat $(PATH_SYSFS)/get_icons
cat $(PATH_SYSFS)/line?
sleep 6
echo -n RINGTONE > $(PATH_SYSFS)/hide_icon
cnt=0 ; while [ $$cnt != 5000 ] ; do \
dd if=/dev/urandom bs=1 count=6 2>/dev/null | \
hexdump -e '"%02x"' > $(PATH_SYSFS)/line3 ;\
let cnt=cnt+1;\
done
tar:
rev=$$(svn info | grep "Revision" | awk '{print $$2}'); \
tar jcvf yealink-r$${rev}.tar.bz2 README TODO Makefile *.[ch]
dist:
vers=`grep 'define *DRIVER_VERSION' yealink.c` ; \
vers=$${vers#*\"} ; vers=$${vers%\"*} ; \
echo "creating yealink-module-$${vers}.tar.bz2"; \
mkdir yealink-module-$${vers}; \
cp README TODO Makefile *.[ch] yealink-module-$${vers}; \
tar jcvf yealink-module-$${vers}.tar.bz2 yealink-module-$${vers}; \
rm -Rf yealink-module-$${vers}