Commit b75e6778 authored by Eric Duminil's avatar Eric Duminil
Browse files

Define make targets

parent 6e2b57ce
# TODO: Add default targets
################################################################################
# CO2 Ampel Firmware - Makefile #
################################################################################
all:
## Run `make` to show available targets
help: ## Show this help.
@egrep -h '(\s##\s|^##\s)' $(MAKEFILE_LIST) | egrep -v '^--' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m %-35s\033[0m %s\n", $$1, $$2}'
build: ## Build. (board should be defined)
ifdef board
pio -f -c vim run -e $(board)
else
pio -f -c vim run
@echo "Please define board parameter:"
@echo "make build board=esp8266"
@echo "or"
@echo "make build board=esp32"
@exit 1
endif
upload:
build_all: ## Build for all boards
pio -f -c vim run
upload: ## Upload to ESP. (board should be defined)
ifdef board
pio -f -c vim run --target upload -e $(board)
else
@echo "Please define board parameter:"
@echo "make upload board=esp8266"
@exit 1
endif
clean:
clean: ## Clean code
pio -f -c vim run --target clean
program:
......@@ -22,5 +43,5 @@ uploadfs:
update:
pio -f -c vim update
monitor:
monitor: ## Monitor ESP output
pio device monitor --filter colorize
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment