forked from Fri3dCamp/Badge2020_micropython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·32 lines (21 loc) · 959 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
BOARD=FRI3D_BADGE_2020_REV2
source esp-idf/export.sh
FIRMWARE_VERSION=`git describe --always --tags --dirty`
ROOTDIR=`pwd`
FIRMWARE_PACKAGE=$ROOTDIR/micropython-$FIRMWARE_VERSION.zip
cd micropython
make -C mpy-cross
cd ports/esp32
# link our board file into micropython
[ ! -e boards/$BOARD ] && ln -s $ROOTDIR/boards/$BOARD boards/$BOARD
# HACK: make git ignore our board dir in the micropython submodule
MICROPYTHON_DIR=$ROOTDIR/.git/modules/micropython
mkdir -p $MICROPYTHON_DIR/info
echo "ports/esp32/boards/$BOARD" > $MICROPYTHON_DIR/info/exclude
echo $PWD
make BOARD=$BOARD clean
make -j4 BOARD=$BOARD USER_C_MODULES=$ROOTDIR/st7789_mpy/st7789/micropython.cmake FROZEN_MANIFEST="$ROOTDIR/manifest.py"
rm $FIRMWARE_PACKAGE
pushd build-$BOARD && cp $ROOTDIR/flash_args . && zip $FIRMWARE_PACKAGE flash_args $(cat flash_args | while read _ f; do [[ -f $f ]] && echo $f; done) && popd
echo "Firmware package ready: $FIRMWARE_PACKAGE"