-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·66 lines (59 loc) · 1.91 KB
/
install.sh
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
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/PiStation/connector-433/issues"
echo "================================================================================"
echo ""
if [ $2 == 1 ]; then
exit 1
fi
fi
}
check_git_clone() {
if [ $? != 0 ]; then
echo "failed."
echo ""
echo "================================================================================"
echo "FATAL: Cloning libWiringPi failed."
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/PiStation/connector-433/issues"
echo "================================================================================"
echo ""
exit 1
fi
}
rm ./install.log 2>/dev/null 1>&2
echo -n "Cloning libWiringPi ... "
rm -Rf ./wiringpi 2>/dev/null 1>&2
git clone https://github.com/nekuz0r/wiringpi.git -b 2.25 > ./install.log 2>&1
check_git_clone
#git submodule init
#check_git_clone
#git submodule update
#check_git_clone
echo "done."
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."
echo -n "Making 433 connector ... "
cd bin/src
make 433connector >> ../../install.log 2>&1
make 433rgb >> ../../install.log 2>&1
check_make_ok "433 connector" 0
echo "done."
echo "Compiling of libraries finished"