mongoose/examples/esp32/device-dashboard/Makefile

39 lines
1.0 KiB
Makefile
Raw Normal View History

2020-12-14 20:58:27 +08:00
THISDIR = $(realpath $(CURDIR))
2022-06-08 20:54:20 +08:00
ROOTDIR = $(realpath $(CURDIR)/../../..)
2022-07-01 02:59:23 +08:00
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) espressif/idf
CMD ?= idf.py build
PORT ?= /dev/ttyUSB0
2020-12-14 20:58:27 +08:00
all: example
2021-07-29 21:21:20 +08:00
example:
true
build: Makefile $(wildcard main/*)
2022-07-01 02:59:23 +08:00
$(DOCKER) $(CMD)
2020-12-14 20:58:27 +08:00
2020-12-25 00:52:12 +08:00
flash:
flash: CMD = idf.py flash
flash: DA = --device $(PORT)
flash: build
.PHONY: build
dashboard.hex: build
esputil mkhex \
0x8000 build/partition_table/partition-table.bin \
0x1000 build/bootloader/bootloader.bin \
0x100000 build/mongoose-esp32-example.bin > $@
flash2: dashboard.hex
esputil -p $(PORT) -b 921600 -fp 0x220 flash dashboard.hex
esputil -p $(PORT) monitor
ESPTOOL ?= esptool.py
flash3:
cd build && $(ESPTOOL) --chip esp32 -p $(PORT) -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x100000 mongoose-esp32-example.bin
2020-12-25 00:52:12 +08:00
2020-12-14 20:58:27 +08:00
clean:
test -d build && $(DOCKER) rm -rf build sdkconfig || true