From da45584955a4a5ae13e7aebcac4570c95a312243 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Fri, 5 Jan 2024 08:37:03 -0700 Subject: [PATCH] Makefile --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..875b198 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +DEVICE=/dev/ttyACM0 + +all: $(firmwares) + +firmwares += out/MockBand.guitar-wammy.hex +out/MockBand.guitar-wammy.hex: VID=0x1bad +out/MockBand.guitar-wammy.hex: PID=0x000f +out/MockBand.guitar-wammy.hex: FLAGS=-DWAMMY + +firmwares += out/MockBand.guitar.hex +out/MockBand.guitar.hex: VID=0x1bad +out/MockBand.guitar.hex: PID=0x000f + +firmwares += out/MockBand.drums.hex +out/MockBand.guitar.hex: VID=0x1bad +out/MockBand.guitar.hex: PID=0x3110 + +out/MockBand.%.hex: MockBand.ino + rm -rf build + mkdir -p build/cache + arduino-builder \ + -build-path $(path)/build/ \ + -build-cache $(path)/build/cache/ \ + -fqbn arduino:avr:leonardo \ + -hardware /usr/share/arduino/hardware/ \ + -tools /usr/share/arduino/tools/ \ + -prefs="build.extra_flags=-DUSB_VID=$(VID) -DUSB_PID=$(PID) -DUSB_PRODUCT=\"Mockband $*\" -DUSB_MANUFACTURER=\"woozle.org\" -DCDC_DISABLED $(FLAGS)" \ + -compile $< + mkdir -p out + mv build/MockBand.ino.hex $@ + +flash-%: out/MockBand.%.hex + while [ ! -e $(DEVICE) ]; do echo Waiting for $(DEVICE)...; sleep 1; done + avrdude -v -patmega32u4 -cavr109 -P$(DEVICE) -b57600 -D -Uflash:w:$<:i + +publish: $(firmwares) + .gitea/publish.sh $^ + +clean: + rm -rf out build +