2023-11-03 09:19:45 +08:00
|
|
|
|
|
|
|
THISDIR = $(realpath $(CURDIR))
|
|
|
|
ROOTDIR = $(realpath $(CURDIR)/../../..)
|
|
|
|
PORT ?= /dev/ttyUSB0
|
|
|
|
DOCKER ?= docker run --rm $(DA) -v $(ROOTDIR):$(ROOTDIR) -w $(THISDIR) espressif/idf:v5.0.2
|
|
|
|
# Note that the esp32 port needs the extra .. for relative paths due to the location of its main CMakeLists.txt file
|
|
|
|
CMD ?= bash -c '$(MAKE) -C micropython/ports/esp32 submodules && $(MAKE) -C micropython/ports/esp32 USER_C_MODULES=../../../../mongoose/micropython.cmake'
|
|
|
|
|
|
|
|
all: example
|
|
|
|
|
|
|
|
example:
|
|
|
|
true
|
|
|
|
|
|
|
|
build: micropython
|
|
|
|
$(DOCKER) $(CMD)
|
|
|
|
|
|
|
|
micropython:
|
|
|
|
$(DOCKER) git clone https://github.com/micropython/micropython.git
|
|
|
|
|
|
|
|
clean:
|
2023-11-13 09:56:50 +08:00
|
|
|
test -d micropython && $(DOCKER) rm -rf micropython || true
|
2023-11-03 09:19:45 +08:00
|
|
|
|
|
|
|
flash:
|
|
|
|
flash: DA = --device $(PORT)
|
|
|
|
flash: CMD = bash -c '$(MAKE) -C micropython/ports/esp32 erase deploy'
|
|
|
|
flash: build
|