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