Created
January 4, 2023 03:22
-
-
Save trevor403/b7c229658320d597e0eb2fb57fa8e9c7 to your computer and use it in GitHub Desktop.
GNU Makefile for arduino-cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: build upload | |
PROJECT := blemon | |
SOURCE := $(PROJECT).ino | |
SKETCH_ID := $(shell pwd | tr -d '\n' | md5sum | awk '{print toupper($$1)}') | |
SKETCH_BUILD_PATH := /tmp/arduino-sketch-$(SKETCH_ID) | |
OUTPUT := $(SKETCH_BUILD_PATH)/$(SOURCE).bin | |
all: build | |
build: $(OUTPUT) | |
$(OUTPUT): $(SOURCE) | |
arduino-cli -v compile -b esp32:esp32:featheresp32 $(BUILD_FLAGS) . | |
upload: $(OUTPUT) | |
arduino-cli upload -p /dev/ttyUSB0 -b esp32:esp32:featheresp32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment