mockband/Makefile

50 lines
1.3 KiB
Makefile
Raw Normal View History

2024-01-05 08:37:03 -07:00
DEVICE=/dev/ttyACM0
2024-01-05 09:29:16 -07:00
all: firmwares
2024-01-05 08:37:03 -07:00
2024-01-05 09:29:16 -07:00
firmwares: build/MockBand.guitar-wammy.hex
2024-01-05 08:50:10 -07:00
build/MockBand.guitar-wammy.hex: VID=0x1bad
build/MockBand.guitar-wammy.hex: PID=0x0004
build/MockBand.guitar-wammy.hex: FLAGS=-DWAMMY
2024-01-05 08:37:03 -07:00
2024-01-05 09:29:16 -07:00
firmwares: build/MockBand.guitar.hex
2024-01-05 08:50:10 -07:00
build/MockBand.guitar.hex: VID=0x1bad
build/MockBand.guitar.hex: PID=0x0004
2024-01-05 08:37:03 -07:00
2024-01-05 09:29:16 -07:00
firmwares: build/MockBand.drums.hex
2024-01-05 08:50:10 -07:00
build/MockBand.drums.hex: VID=0x1bad
build/MockBand.drums.hex: PID=0x3110
2024-01-05 08:37:03 -07:00
firmwares: build/MockBand.drums1.hex
build/MockBand.drums1.hex: VID=0x1bad
build/MockBand.drums1.hex: PID=00005
2024-01-05 08:50:10 -07:00
build/MockBand.%.hex: MockBand.ino
2024-01-05 08:37:03 -07:00
mkdir -p build/cache
2024-01-05 08:50:10 -07:00
rm -f build/build.options.json
2024-01-05 08:37:03 -07:00
arduino-builder \
2024-01-05 08:50:10 -07:00
-build-path $(abspath build/) \
-build-cache $(abspath build/cache/) \
2024-01-05 08:37:03 -07:00
-fqbn arduino:avr:leonardo \
-hardware /usr/share/arduino/hardware/ \
-tools /usr/share/arduino/tools/ \
2024-01-05 08:50:10 -07:00
-prefs="build.extra_flags=-DUSB_VID=$(VID) -DUSB_PID=$(PID) '-DUSB_PRODUCT=\"Mockband $*\"' -DUSB_MANUFACTURER=\"woozle.org\" -DCDC_DISABLED $(FLAGS)" \
2024-01-05 08:37:03 -07:00
-compile $<
mv build/MockBand.ino.hex $@
2024-01-05 08:50:10 -07:00
flash-%: build/MockBand.%.hex
2024-01-05 09:10:28 -07:00
echo -n "Waiting for $(DEVICE)..."; while [ ! -e $(DEVICE) ]; do echo -n .; sleep 1; done
2024-01-05 08:37:03 -07:00
avrdude -v -patmega32u4 -cavr109 -P$(DEVICE) -b57600 -D -Uflash:w:$<:i
2024-01-05 09:02:53 -07:00
dist: build/MockBand.zip
2024-01-05 09:29:16 -07:00
build/MockBand.zip: firmwares
2024-01-05 09:02:53 -07:00
rm -f $@
2024-01-05 09:29:16 -07:00
zip -r $@ README.md build/*.hex docs/
2024-01-05 08:37:03 -07:00
clean:
2024-01-05 08:50:10 -07:00
rm -rf build
2024-01-05 08:37:03 -07:00