Makefile: create a uf2 file

This commit is contained in:
Neale Pickett 2020-10-24 23:56:09 -06:00
parent e8926fb938
commit 41bbfdc1d7
2 changed files with 30 additions and 6 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.vscode .vscode
build

View File

@ -1,8 +1,31 @@
BOARD = --board adafruit:samd:adafruit_trellis_m4 FQBN = adafruit:samd:adafruit_trellis_m4
verify: uilleann.ino default: build/uilleann.ino.uf2
arduino --verify $(BOARD) $<
# uf2conv.py is covered by an MIT license.
build/uf2conv.py:
mkdir -p build
curl -L https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2conv.py > $@
chmod +x $@
%.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 \
-tools /app/Arduino/tools-builder \
-tools ~/.arduino15/packages \
-hardware /app/Arduino/hardware \
-hardware ~/.arduino15/packages \
-built-in-libraries /app/Arduino/libraries \
-libraries ~/Arduino/libraries \
-compile \
$<
install: uilleann.ino upload: uilleann.ino
arduino --upload $(BOARD) $< arduino --upload --board $(FQBN) $<