circuitpython/ports/esp32/Makefile
Michael O'Cleirigh 0ccd9e08aa esp32: Restore USER_C_MODULE support with new CMake build system.
Support for User C and C++ modules was lost due to upgrading the esp32 to
the latest CMake based IDF from the GNUMakefile build process.

Restore the support for the esp32 port by integrating with the approach
recently added for the rp2 port.

Signed-off-by: Michael O'Cleirigh <michael.ocleirigh@rivulet.ca>
2021-04-01 15:43:15 +11:00

50 lines
1.2 KiB
Makefile

# Makefile for MicroPython on ESP32.
#
# This is a simple, convenience wrapper around idf.py (which uses cmake).
# Select the board to build for, defaulting to GENERIC.
BOARD ?= GENERIC
# If the build directory is not given, make it reflect the board name.
BUILD ?= build-$(BOARD)
# Device serial settings.
PORT ?= /dev/ttyUSB0
BAUD ?= 460800
PYTHON ?= python3
GIT_SUBMODULES = lib/berkeley-db-1.xx
.PHONY: all clean deploy erase submodules FORCE
CMAKE_ARGS =
ifdef USER_C_MODULES
CMAKE_ARGS += -DUSER_C_MODULES=${USER_C_MODULES}
endif
IDFPY_FLAGS += -D MICROPY_BOARD=$(BOARD) -B $(BUILD) $(CMAKE_ARGS)
all:
idf.py $(IDFPY_FLAGS) build
@$(PYTHON) makeimg.py \
$(BUILD)/bootloader/bootloader.bin \
$(BUILD)/partition_table/partition-table.bin \
$(BUILD)/micropython.bin \
$(BUILD)/firmware.bin
$(BUILD)/bootloader/bootloader.bin $(BUILD)/partition_table/partition -table.bin $(BUILD)/micropython.bin: FORCE
clean:
idf.py $(IDFPY_FLAGS) fullclean
deploy:
idf.py $(IDFPY_FLAGS) -p $(PORT) -b $(BAUD) flash
erase:
idf.py $(IDFPY_FLAGS) -p $(PORT) -b $(BAUD) erase_flash
submodules:
git submodule update --init $(addprefix ../../,$(GIT_SUBMODULES))