Skip to content

Commit b440307

Browse files
committed
py/py.mk: Automatically add frozen.c to source list if FROZEN_DIR is defined.
Now frozen modules generation handled fully by py.mk and available for reuse by any port.
1 parent 3f251ef commit b440307

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

esp8266/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ MICROPY_PY_USSL = 1
77
MICROPY_SSL_AXTLS = 1
88
MICROPY_PY_BTREE = 1
99

10+
FROZEN_DIR = scripts
11+
FROZEN_MPY_DIR = modules
12+
1013
# include py core make definitions
1114
include ../py/py.mk
1215

1316
MPY_CROSS = ../mpy-cross/mpy-cross
1417
MPY_TOOL = ../tools/mpy-tool.py
1518

16-
FROZEN_DIR = scripts
17-
FROZEN_MPY_DIR = modules
1819
PORT ?= /dev/ttyACM0
1920
BAUD ?= 115200
2021
FLASH_MODE ?= qio
@@ -90,7 +91,6 @@ SRC_C = \
9091
modmachine.c \
9192
modonewire.c \
9293
ets_alt_task.c \
93-
$(BUILD)/frozen.c \
9494
fatfs_port.c \
9595
axtls_helpers.c \
9696
hspi.c \

py/py.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ PY_O_BASENAME = \
237237
# prepend the build destination prefix to the py object files
238238
PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
239239

240+
ifneq ($(FROZEN_DIR),)
241+
PY_O += $(BUILD)/$(BUILD)/frozen.o
242+
endif
243+
240244
# Sources that may contain qstrings
241245
SRC_QSTR_IGNORE = nlr% emitnx% emitnthumb% emitnarm%
242246
SRC_QSTR = $(SRC_MOD) $(addprefix py/,$(filter-out $(SRC_QSTR_IGNORE),$(PY_O_BASENAME:.o=.c)) emitnative.c)

zephyr/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ SRC_C = main.c \
4141
lib/utils/interrupt_char.c \
4242
lib/utils/pyhelp.c \
4343
lib/mp-readline/readline.c \
44-
$(BUILD)/frozen.c \
4544
$(SRC_MOD)
4645

4746
# List of sources for qstr extraction

0 commit comments

Comments
 (0)