chiark / gitweb /
Updated mostly to the gpio readall command to support the Raspberry Pi B+
[wiringPi.git] / build
diff --git a/build b/build
index cbb1a4fd31cb6e2d344d239cd7512cbbc41ec447..e17cf18737abb5d81ae9f603e7c8b11bf4258843 100755 (executable)
--- a/build
+++ b/build
@@ -1,7 +1,6 @@
-#!/bin/bash
+#!/bin/sh
 
-check-make-ok()
-{
+check_make_ok() {
   if [ $? != 0 ]; then
     echo ""
     echo "Make Failed..."
@@ -14,28 +13,32 @@ check-make-ok()
 }
 
 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
 
@@ -44,36 +47,43 @@ 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"
@@ -83,3 +93,8 @@ fi
 
 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 ""