uilleann/Makefile

40 lines
1.1 KiB
Makefile
Raw Normal View History

2020-10-24 23:56:09 -06:00
FQBN = adafruit:samd:adafruit_trellis_m4
2020-11-15 14:49:05 -07:00
UF2_MOUNT = /media/neale/TRELM4BOOT
ARDUINO_DIR = /app/Arduino
BUILDER = flatpak run --command ${ARDUINO_DIR}/arduino-builder cc.arduino.arduinoide
2020-10-24 23:56:09 -06:00
default: build/uilleann.ino.uf2
2020-10-25 11:36:58 -06:00
install: build/uilleann.ino.uf2
./install.sh $< $(UF2_MOUNT)
2020-10-24 23:56:09 -06:00
# uf2conv.py is covered by an MIT license.
2023-04-19 20:06:38 -06:00
build/uf2conv.py: build/uf2families.json
2020-10-24 23:56:09 -06:00
mkdir -p build
2023-04-19 20:06:38 -06:00
curl -L https://raw.githubusercontent.com/microsoft/uf2/master/utils/$(@F) > $@
2020-10-24 23:56:09 -06:00
chmod +x $@
2023-04-19 20:06:38 -06:00
build/uf2families.json:
mkdir -p build
curl -L https://raw.githubusercontent.com/microsoft/uf2/master/utils/$(@F) > $@
2020-10-24 23:56:09 -06:00
%.uf2: %.bin build/uf2conv.py
build/uf2conv.py -b 0x4000 -c -o $@ $<
build/%.bin: % *.cpp *.h
arduino-builder \
-build-cache ~/.cache/arduino \
-build-path build \
-core-api-version 10813 \
-fqbn $(FQBN) \
-hardware ~/.arduino15/packages \
2020-11-15 14:49:05 -07:00
-tools $(ARDUINO_DIR)/tools-builder \
2020-10-24 23:56:09 -06:00
-tools ~/.arduino15/packages \
2020-11-15 14:49:05 -07:00
-hardware $(ARDUINO_DIR)/hardware \
2020-10-24 23:56:09 -06:00
-hardware ~/.arduino15/packages \
2020-11-15 14:49:05 -07:00
-built-in-libraries $(ARDUINO_DIR)/libraries \
2020-10-24 23:56:09 -06:00
-libraries ~/Arduino/libraries \
-compile \
$<
upload: uilleann.ino
arduino --upload --board $(FQBN) $<