chiark / gitweb /
776c756fa0703eae0ab3420c11dd09e651348e5e
[wiringPi.git] / build
1 #!/bin/bash
2
3 check-make-ok()
4 {
5   if [ $? != 0 ]; then
6     echo ""
7     echo "Make Failed..."
8     echo "Please check the messages and fix any problems. If you're still stuck,"
9     echo "then please email all the output and as many details as you can to"
10     echo "  projects@drogon.net"
11     echo ""
12     exit 1
13   fi
14 }
15
16 if [ x$1 = "xclean" ]; then
17   cd wiringPi
18   echo -n "wiringPi:   "        ; make clean
19   cd ../devLib
20   echo -n "DevLib:     "        ; make clean
21   cd ../gpio
22   echo -n "gpio:       "        ; make clean
23   cd ../examples
24   echo -n "Examples:   "        ; make clean
25   cd Gertboard
26   echo -n "Gertboard:  "        ; make clean
27   cd ../PiFace
28   echo -n "PiFace:     "        ; make clean
29   cd ../q2w
30   echo -n "Quick2Wire: "        ; make clean
31   exit
32 fi
33
34 if [ x$1 = "xuninstall" ]; then
35   cd wiringPi
36   echo -n "wiringPi: " ; sudo make uninstall
37   cd ../devLib
38   echo -n "DevLib:   " ; sudo make uninstall
39   cd ../gpio
40   echo -n "gpio:     " ; sudo make uninstall
41   exit
42 fi
43
44
45   echo "wiringPi Build script"
46   echo "====================="
47   echo
48
49   echo
50   echo "WiringPi Library"
51   cd wiringPi
52   sudo make uninstall
53   make
54   check-make-ok
55   sudo make install
56   check-make-ok
57
58   echo
59   echo "WiringPi Devices Library"
60   cd ../devLib
61   sudo make uninstall
62   make
63   check-make-ok
64   sudo make install
65   check-make-ok
66
67   echo
68   echo "GPIO Utility"
69   cd ../gpio
70   make
71   check-make-ok
72   sudo make install
73   check-make-ok
74
75 # echo
76 # echo "Examples"
77 # cd ../examples
78 # make
79 # cd ..
80
81 echo
82 echo All Done.
83 echo ""
84 echo "NOTE: This is wiringPi v2, and if you need to use the lcd, Piface,"
85 echo "  Gertboard, MaxDetext, etc. routines then you must change your"
86 echo "  compile scripts to add -lwiringPiDev"
87 echo ""