From 25a917dc81313d1ff9f144d8029a5c70fc4132ae Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 4 Jan 2024 22:42:11 -0700 Subject: [PATCH] directly specify gcc flags --- .gitea/build.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitea/build.sh b/.gitea/build.sh index 3cf12c5..c0701bf 100755 --- a/.gitea/build.sh +++ b/.gitea/build.sh @@ -11,7 +11,7 @@ cd $(dirname $0)/.. mkdir -p out/ -while read vid pid variant; do +while read variant vid pid flags; do log log Building $vid $pid $product log @@ -19,23 +19,28 @@ while read vid pid variant; do 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.vid=$vid" \ - -prefs="build.pid=$pid" \ - -prefs="build.usb_product=\"Mockband $variant\"" \ - -prefs="build.extra_flags=\"{build.usb_flags} -DCDC_DISABLED\"" \ + -prefs="build.extra_flags=$flags" \ -compile MockBand.ino mv build/MockBand.ino.hex out/MockBand.$variant.hex find out build/cache done << EOD -0x1bad 0x0004 guitar -0x1bad 0x3110 drums +guitar 0x1bad 0x0004 +guitar-wammy 0x1bad 0x0004 -DWAMMY +drums 0x1bad 0x3110 EOD ls -l out/