build_example 880 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. if [ "$1" != "internal" ]; then
  3. echo "Don't call this script directly, use build_all_examples instead."
  4. exit 1
  5. fi
  6. SED=$(which gsed || which sed)
  7. HERE=`dirname "$0"`
  8. echo "Testing $3:"
  9. shopt -s nullglob
  10. for sub in find $2/config/examples/$3 -type d; do
  11. [[ -d $sub ]] || continue
  12. base=`basename "$sub"`
  13. if [[ ! -f $sub/Configuration.h ]] && [[ ! -f $sub/Configuration_adv.h ]]; then
  14. echo "No configuration files found in $sub"
  15. continue
  16. fi
  17. echo "Getting configuration files from $sub"
  18. cp "$2/config/default"/*.h Marlin/
  19. cp "$sub"/Configuration.h Marlin/ 2>/dev/null
  20. cp "$sub"/Configuration_adv.h Marlin/ 2>/dev/null
  21. cp "$sub"/_Bootscreen.h Marlin/ 2>/dev/null
  22. cp "$sub"/_Statusscreen.h Marlin/ 2>/dev/null
  23. echo "Building the firmware now..."
  24. echo "$HERE/mftest" -a || exit 1
  25. done
  26. echo "Success"
  27. exit 0