4 # Simple wiringPi build and install script
6 # Copyright (c) 2012-2015 Gordon Henderson
7 #################################################################################
8 # This file is part of wiringPi:
9 # Wiring Compatable library for the Raspberry Pi
11 # wiringPi is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
16 # wiringPi is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU Lesser General Public License for more details.
21 # You should have received a copy of the GNU Lesser General Public License
22 # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
23 #################################################################################
25 # wiringPi is designed to run on a Raspberry Pi only.
26 # However if you're clever enough to actually look at this script to
27 # see why it's not building for you, then good luck.
29 # To everyone else: Stop using cheap alternatives. Support the
30 # Raspberry Pi Foundation as they're the only ones putting money
31 # back into education!
32 #################################################################################
38 echo "Please check the messages and fix any problems. If you're still stuck,"
39 echo "then please email all the output and as many details as you can to"
40 echo " projects@drogon.net"
46 if [ x$1 = "xclean" ]; then
48 echo -n "wiringPi: " ; make clean
50 echo -n "DevLib: " ; make clean
52 echo -n "gpio: " ; make clean
54 echo -n "Examples: " ; make clean
56 echo -n "Gertboard: " ; make clean
58 echo -n "PiFace: " ; make clean
60 echo -n "Quick2Wire: " ; make clean
62 echo -n "PiGlow: " ; make clean
66 if [ x$1 = "xuninstall" ]; then
68 echo -n "wiringPi: " ; sudo make uninstall
70 echo -n "DevLib: " ; sudo make uninstall
72 echo -n "gpio: " ; sudo make uninstall
77 echo "wiringPi Build script"
78 echo "====================="
81 hardware=`fgrep Hardware /proc/cpuinfo | head -1 | awk '{ print $3 }'`
83 if [ x$hardware != "xBCM2708" ]; then
85 echo " +------------------------------------------------------------+"
86 echo " | wiringPi is designed to run on the Raspberry Pi only. |"
87 echo " | This processor does not appear to be a Raspberry Pi. |"
88 echo " +------------------------------------------------------------+"
89 echo " | In the unlikely event that you think it is a Raspberry Pi, |"
90 echo " | then please accept my apologies and email the contents of |"
91 echo " | /proc/cpuinfo to projects@drogon.net. |"
92 echo " | - Thanks, Gordon |"
93 echo " +------------------------------------------------------------+"
100 echo "WiringPi Library"
103 if [ x$1 = "xstatic" ]; then
106 sudo make install-static
115 echo "WiringPi Devices Library"
118 if [ x$1 = "xstatic" ]; then
121 sudo make install-static
146 echo "NOTE: To compile programs with wiringPi, you need to add:"
148 echo " to your compile line(s) To use the Gertboard, MaxDetect, etc."
149 echo " code (the devLib), you need to also add:"
150 echo " -lwiringPiDev"
151 echo " to your compile line(s)."