circuitpython/tools/build_adafruit_bins.sh

30 lines
1.1 KiB
Bash
Raw Normal View History

rm -rf atmel-samd/build*
rm -rf esp8266/build*
ATMEL_BOARDS="arduino_zero circuitplayground_express feather_m0_basic feather_m0_adalogger feather_m0_express metro_m0_flash trinket_m0 gemma_m0"
for board in $ATMEL_BOARDS; do
make -C atmel-samd BOARD=$board
2017-04-20 17:04:06 -04:00
(( exit_status = exit_status || $? ))
done
make -C esp8266 BOARD=feather_huzzah
2017-04-20 17:04:06 -04:00
(( exit_status = exit_status || $? ))
version=`git describe --tags --exact-match`
if [ $? -ne 0 ]; then
2017-04-20 17:04:06 -04:00
version=`date +%Y%m%d`-`git rev-parse --short HEAD`
fi
for board in $ATMEL_BOARDS; do
2017-04-20 17:04:06 -04:00
mkdir -p bin/$board/
cp atmel-samd/build-$board/firmware.bin bin/$board/adafruit-circuitpython-$board-$version.bin
(( exit_status = exit_status || $? ))
python2 tools/uf2/utils/uf2conv.py -c -o bin/$board/adafruit-circuitpython-$board-$version.uf2 bin/$board/adafruit-circuitpython-$board-$version.bin
(( exit_status = exit_status || $? ))
done
2017-04-20 17:04:06 -04:00
mkdir -p bin/esp8266/
cp esp8266/build/firmware-combined.bin bin/esp8266/adafruit-circuitpython-feather_huzzah-$version.bin
(( exit_status = exit_status || $? ))
exit $exit_status