2020-12-27 01:29:42 +00:00
|
|
|
THISDIR = $(realpath $(CURDIR))
|
|
|
|
ROOTDIR = $(realpath $(CURDIR)/../..)
|
2022-08-18 14:57:28 -03:00
|
|
|
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) docker.io/mdashnet/8266
|
|
|
|
CMD ?= make -C src defconfig app
|
|
|
|
PORT ?= /dev/ttyUSB0
|
2020-12-27 01:29:42 +00:00
|
|
|
|
|
|
|
all: example
|
|
|
|
|
2021-07-29 14:21:20 +01:00
|
|
|
example:
|
|
|
|
true
|
|
|
|
|
2022-08-18 14:57:28 -03:00
|
|
|
build: Makefile $(wildcard src/main/*)
|
|
|
|
$(DOCKER) $(CMD)
|
|
|
|
|
|
|
|
flash:
|
|
|
|
flash: CMD = python /esp/components/esptool_py/esptool/esptool.py \
|
|
|
|
--chip esp8266 --port $(PORT) --baud 115200 --before default_reset \
|
|
|
|
--after hard_reset write_flash -z --flash_mode dio --flash_freq 40m \
|
|
|
|
--flash_size 2MB 0x10000 $(THISDIR)/src/build/mongoose-example.bin
|
|
|
|
flash: DA = --device $(PORT)
|
|
|
|
flash: build
|
|
|
|
|
|
|
|
.PHONY: build
|
2020-12-27 01:29:42 +00:00
|
|
|
|
|
|
|
clean:
|
2022-08-18 14:57:28 -03:00
|
|
|
clean: CMD = rm -rf src/build
|
|
|
|
clean: build
|
|
|
|
|