1
0
mirror of https://github.com/richardghirst/PiBits.git synced 2024-11-28 12:24:11 +01:00
PiBits/ServoBlaster/user/Makefile
2015-10-03 20:35:33 +01:00

26 lines
651 B
Makefile

.PHONY: all install uninstall
all: servod
servod: servod.c mailbox.c
gcc -Wall -g -O2 -o servod servod.c mailbox.c -lm
install: servod
[ "`id -u`" = "0" ] || { echo "Must be run as root"; exit 1; }
cp -f servod /usr/local/sbin
cp -f init-script /etc/init.d/servoblaster
chmod 755 /etc/init.d/servoblaster
update-rc.d servoblaster defaults 92 08
/etc/init.d/servoblaster start
uninstall:
[ "`id -u`" = "0" ] || { echo "Must be run as root"; exit 1; }
[ -e /etc/init.d/servoblaster ] && /etc/init.d/servoblaster stop || :
update-rc.d servoblaster remove
rm -f /usr/local/sbin/servod
rm -f /etc/init.d/servoblaster
clean:
rm -f servod