-#!/bin/bash
+#!/bin/sh
-check-make-ok()
-{
+check_make_ok() {
if [ $? != 0 ]; then
echo ""
echo "Make Failed..."
}
if [ x$1 = "xclean" ]; then
- echo Cleaning
- echo
cd wiringPi
- make clean
+ echo -n "wiringPi: " ; make clean
+ cd ../devLib
+ echo -n "DevLib: " ; make clean
cd ../gpio
- make clean
+ echo -n "gpio: " ; make clean
cd ../examples
- make clean
+ echo -n "Examples: " ; make clean
+ cd Gertboard
+ echo -n "Gertboard: " ; make clean
+ cd ../PiFace
+ echo -n "PiFace: " ; make clean
+ cd ../q2w
+ echo -n "Quick2Wire: " ; make clean
+ cd ../PiGlow
+ echo -n "PiGlow: " ; make clean
exit
fi
if [ x$1 = "xuninstall" ]; then
- echo Uninstalling
- echo
- echo "WiringPi library"
cd wiringPi
- sudo make uninstall
- echo
- echo "GPIO Utility"
+ echo -n "wiringPi: " ; sudo make uninstall
+ cd ../devLib
+ echo -n "DevLib: " ; sudo make uninstall
cd ../gpio
- sudo make uninstall
- cd ..
+ echo -n "gpio: " ; sudo make uninstall
exit
fi
echo "====================="
echo
-# Check for I2C being installed...
-# ... and if-so, then automatically make the I2C helpers
-
- if [ -f /usr/include/linux/i2c-dev.h ]; then
- grep -q i2c_smbus_read_byte /usr/include/linux/i2c-dev.h
- if [ $? = 0 ]; then
- target=i2c
- echo "Building wiringPi with the I2C helper libraries."
- else
- target=all
- echo "The wiringPi I2C helper libraries will not be built."
- fi
+ echo
+ echo "WiringPi Library"
+ cd wiringPi
+ sudo make uninstall
+ if [ x$1 = "xstatic" ]; then
+ make static
+ check_make_ok
+ sudo make install-static
+ else
+ make
+ check_make_ok
+ sudo make install
fi
+ check_make_ok
echo
- echo "WiringPi library"
- cd wiringPi
+ echo "WiringPi Devices Library"
+ cd ../devLib
sudo make uninstall
- make $target
- check-make-ok
- sudo make install
- check-make-ok
+ if [ x$1 = "xstatic" ]; then
+ make static
+ check_make_ok
+ sudo make install-static
+ else
+ make
+ check_make_ok
+ sudo make install
+ fi
+ check_make_ok
echo
echo "GPIO Utility"
cd ../gpio
make
- check-make-ok
+ check_make_ok
sudo make install
- check-make-ok
+ check_make_ok
# echo
# echo "Examples"
echo
echo All Done.
+echo ""
+echo "NOTE: This is wiringPi v2, and if you need to use the lcd, Piface,"
+echo " Gertboard, MaxDetext, etc. routines then you must change your"
+echo " compile scripts to add -lwiringPiDev"
+echo ""