build-stm-latest.sh 938 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # function for building firmware
  3. function do_build() {
  4. descr=$1
  5. board=$2
  6. shift
  7. shift
  8. echo "building $descr $board"
  9. build_dir=/tmp/stm-build-$board
  10. make -B $@ BOARD=$board BUILD=$build_dir || exit 1
  11. mv $build_dir/firmware.dfu $dest_dir/$descr-$date-$git_tag.dfu
  12. rm -rf $build_dir
  13. }
  14. # check/get parameters
  15. if [ $# != 1 ]; then
  16. echo "usage: $0 <dest-dir>"
  17. exit 1
  18. fi
  19. dest_dir=$1
  20. # check we are in the correct directory
  21. if [ ! -r modpyb.c ]; then
  22. echo "must be in stm directory"
  23. exit 1
  24. fi
  25. # get the date
  26. date=$(date '+%Y-%m-%d')
  27. # get the git tag
  28. git_tag="$(git describe --dirty || echo unknown)"
  29. # build the versions
  30. do_build pybv3 PYBV3
  31. do_build pybv3-network PYBV3 MICROPY_PY_WIZNET5K=1 MICROPY_PY_CC3K=1
  32. do_build pybv10 PYBV10
  33. do_build pybv10-network PYBV10 MICROPY_PY_WIZNET5K=1 MICROPY_PY_CC3K=1
  34. do_build stm32f4disc STM32F4DISC
  35. do_build espruino-pico ESPRUINO_PICO