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
|
2022-04-17 18:34:57 -06:00
|
|
|
ARDUINO_DIR = /app/Arduino
|
|
|
|
BUILDER = flatpak run --command ${ARDUINO_DIR}/arduino-builder cc.arduino.arduinoide
|
2020-10-24 20:15:18 -06:00
|
|
|
|
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 20:15:18 -06:00
|
|
|
|
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) $<
|