chiark / gitweb /
Sorted a variable initialisation issue that was giving incorrect results
[wiringPi.git] / build
diff --git a/build b/build
index cbb1a4fd31cb6e2d344d239cd7512cbbc41ec447..f578d4a54b879fe910de6c9acd4e4f18bc8e09f5 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,30 @@ 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
   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 +45,31 @@ 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
-  fi
-
   echo
-  echo "WiringPi library"
+  echo "WiringPi Library"
   cd wiringPi
   sudo make uninstall
-  make $target
-  check-make-ok
+  make
+  check_make_ok
+  sudo make install
+  check_make_ok
+
+  echo
+  echo "WiringPi Devices Library"
+  cd ../devLib
+  sudo make uninstall
+  make
+  check_make_ok
   sudo make install
-  check-make-ok
+  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 +79,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 ""