add makefile, rename main

This commit is contained in:
Kyle Isom 2023-10-06 03:19:12 +00:00
parent 4d4da676c6
commit bec470f6d7
2 changed files with 37 additions and 0 deletions

37
Makefile Normal file
View File

@ -0,0 +1,37 @@
BOARD := sparkfun_esp32micromod
FIRMWARE := .pioenvs/$(BOARD)/firmware.bin
SOURCES := \
src/main.cc
PIO := pio run -e $(BOARD)
$(FIRMWARE): $(SOURCES)
$(PIO)
PHONY: all
all: $(FIRMWARE)
.PHONY: upload
upload: $(FIRMWARE)
$(PIO) -t upload
.PHONY: monitor
monitor:
$(PIO) -t monitor
.PHONY: deploy
deploy: $(FIRMWARE)
$(PIO) -t upload && sleep 0.5 && $(PIO) -t monitor
.PHONY: clean
clean:
$(PIO) -t clean
.PHONY: cloc
cloc:
cloc include lib src
.PHONY: test
test:
$(PIO) -t test