forked from fengjiannan2010/wiringpi-node
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·66 lines (56 loc) · 1.6 KB
/
install.sh
File metadata and controls
executable file
·66 lines (56 loc) · 1.6 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
exit 0
check_make_ok() {
if [ $? != 0 ]; then
echo "failed."
echo ""
echo "================================================================================"
if [ $2 == 1 ]; then
echo "FATAL: Making $1 failed."
else
echo "Making $1 failed."
fi
echo "Please check install.log and fix any problems. If you're still stuck,"
echo "then please open a new issue then post all the output and as many details as you can to"
echo " https://github.com/WiringPi/WiringPi-Node/issues"
echo "================================================================================"
echo ""
if [ $2 == 1 ]; then
exit 1
fi
fi
}
rm ./install.log 2>/dev/null 1>&2
echo -n "Making libWiringPi ... "
cd ./WiringPi/wiringPi/
make clean >> ../../install.log 2>&1
make static >> ../../install.log 2>&1
check_make_ok "libWiringPi" 1
cd ../../
echo "done."
cd ./WiringPi/devLib/
echo -n "Making devLib ..."
make clean >> ../../install.log 2>&1
make static >> ../../install.log 2>&1
check_make_ok "devLib" 0
cd ../../
echo "done."
cd ./WiringPi/gpio/
echo -n "Unistalling gpio utility ... "
sudo make uninstall >> ../../install.log 2>&1
echo "done."
echo -n "Making gpio utility ... "
make clean >> ../../install.log 2>&1
make >> ../../install.log 2>&1
check_make_ok "gpio utility" 0
echo "done."
echo -n "Installing gpio utility ... "
sudo make install >> ../../install.log 2>&1
check_make_ok "gpio utility" 0
cd ../../
echo "done."
echo -n "Making WiringPi-node ... "
node-gyp rebuild 2>&1 | tee -a ./install.log
check_make_ok "WiringPi-node" 1
echo "done."
echo "Enjoy !"