mockband/.gitea/build.sh

47 lines
994 B
Bash
Executable File

#! /bin/sh
set -e
log () {
echo "=== $*"
}
# Make sure we're in the project directory
cd $(dirname $0)/..
mkdir -p out/
while read variant vid pid flags; do
log
log Building $vid $pid $product
log
rm -rf build/
mkdir -p build/cache/
# We can overload build.extra_flags from boards.txt,
# so just specify the -D flags to gcc
flags="$flags -DUSB_VID=$vid -DUSB_PID=$pid"
flags="$flags -DUSB_MANUFACTURER='woozle.org'"
flags="$flags -DUSB_PRODUCT='Mockband $variant'"
flags="$flags -DCDC_DISABLED"
arduino-builder \
-build-path $(pwd)/build/ \
-build-cache $(pwd)/build/cache/ \
-fqbn arduino:avr:leonardo \
-hardware /usr/share/arduino/hardware \
-tools /usr/share/arduino/tools \
-prefs="build.extra_flags=$flags" \
-compile MockBand.ino
mv build/MockBand.ino.hex out/MockBand.$variant.hex
find out build/cache
done << EOD
guitar 0x1bad 0x0004
guitar-wammy 0x1bad 0x0004 -DWAMMY
drums 0x1bad 0x3110
EOD
ls -l out/