Skip to content

Instantly share code, notes, and snippets.

@trevor403
Created January 4, 2023 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevor403/b7c229658320d597e0eb2fb57fa8e9c7 to your computer and use it in GitHub Desktop.
Save trevor403/b7c229658320d597e0eb2fb57fa8e9c7 to your computer and use it in GitHub Desktop.
GNU Makefile for arduino-cli
.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