chiark / gitweb /
Change to the build script to check for the presence of the I2C development
[wiringPi.git] / build
1 #!/bin/bash
2
3 if [ x$1 = "xclean" ]; then
4   echo Cleaning
5   echo
6   cd wiringPi
7   make clean
8   cd ../gpio
9   make clean
10   cd ../examples
11   make clean
12   cd ..
13 elif [ x$1 = "xuninstall" ]; then
14   echo Uninstalling
15   echo
16   echo "WiringPi library"
17   cd wiringPi
18   sudo make uninstall
19   echo
20   echo "GPIO Utility"
21   cd ../gpio
22   sudo make uninstall
23   cd ..
24 else
25   echo wiringPi Build script - please wait...
26
27   echo
28   if [ ! -f /usr/include/linux/i2c-dev.h ]; then
29     echo "* wiringPi needs the I2C Development Libraires installing."
30     echo ""
31     echo "If using Debian/Raspbian, then type this command:"
32     echo "  sudo apt-get install libi2c-dev"
33     echo "then run ./build again."
34     echo ""
35     echo "If using another Linux distribution, then you will have to"
36     echo "work out how to install the I2C Developmen Libraries for your"
37     echo "system."
38     echo ""
39     exit 1
40   fi
41
42   echo "WiringPi library"
43   cd wiringPi
44   sudo make uninstall
45   make 
46   sudo make install
47   echo
48   echo "GPIO Utility"
49   cd ../gpio
50   make
51   sudo make install
52   echo
53   echo "Examples"
54   cd ../examples
55   make
56   cd ..
57 fi
58
59 echo
60 echo All Done.