2024-01-04 19:28:50 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
2024-01-04 19:37:25 -07:00
|
|
|
set -e
|
|
|
|
|
2024-01-04 19:28:50 -07:00
|
|
|
log () {
|
|
|
|
echo "=== $*"
|
|
|
|
}
|
|
|
|
|
2024-01-04 19:37:06 -07:00
|
|
|
# Make sure we're in the project directory
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
|
2024-01-04 19:28:50 -07:00
|
|
|
## This is bananas.
|
2024-01-04 19:32:58 -07:00
|
|
|
mkdir -p build/ out/ build/cache/
|
2024-01-04 19:28:50 -07:00
|
|
|
cp -rL /usr/share/arduino /usr/share/arduino-builder build/
|
|
|
|
|
|
|
|
while read vid pid variant; do
|
|
|
|
log
|
|
|
|
log Building $vid $pid $product
|
|
|
|
log
|
|
|
|
|
|
|
|
sed -i "
|
|
|
|
/leonardo.build.vid/ s/=.*/=$vid/
|
|
|
|
/leonardo.build.pid/ s/=.*/=$pid/
|
|
|
|
/leonardo.build.usb_product/ s/=.*/=\"Mockband $variant\"/
|
|
|
|
" build/arduino/hardware/arduino/avr/boards.txt
|
|
|
|
grep 'leonardo.build' build/arduino/hardware/arduino/avr/boards.txt
|
|
|
|
|
2024-01-04 19:37:06 -07:00
|
|
|
# I told you not to use this directory, Arduino.
|
|
|
|
rm -rf $HOME/.cache
|
|
|
|
|
2024-01-04 19:28:50 -07:00
|
|
|
arduino-builder \
|
|
|
|
-fqbn arduino:avr:leonardo \
|
|
|
|
-build-path $(pwd)/build/ \
|
2024-01-04 19:32:58 -07:00
|
|
|
-build-cache $(pwd)/build/cache/ \
|
2024-01-04 19:28:50 -07:00
|
|
|
-hardware build/arduino/hardware \
|
|
|
|
-tools build/arduino/tools \
|
|
|
|
-compile MockBand.ino
|
|
|
|
|
|
|
|
mv build/MockBand.ino.hex out/MockBand.$variant.hex
|
|
|
|
done << EOD
|
|
|
|
0x1bad 0x0004 guitar
|
|
|
|
0x1bad 0x3110 drums
|
|
|
|
EOD
|
|
|
|
|
|
|
|
ls -l out/
|