#!/bin/bash

mkdir -p workspace/src/dimensioner
cp -r ../src/dimensioner/* workspace/src/dimensioner/
cd workspace
git clone https://github.com/micropython/micropython.git --branch=master --depth=1
cd micropython
make -C ports/rp2 clean
make -C ports/rp2 submodules
make -j 4 -C mpy-cross
cd ports/rp2
make -j 4 FROZEN_MANIFEST=../../../../src/dimensioner/manifest.py
cd ../../../../
mkdir -p out
mv workspace/micropython/ports/rp2/build-RPI_PICO/firmware.uf2 out/dimensioner.uf2
