build 2.0 KB

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