-
Notifications
You must be signed in to change notification settings - Fork 78
/
Makefile
47 lines (33 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 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)
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)
ifdef FROZEN_MANIFEST
IDFPY_FLAGS += -D MICROPY_FROZEN_MANIFEST=$(FROZEN_MANIFEST)
endif
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))