Skip to content

Commit 92353c2

Browse files
jimmodpgeorge
authored andcommitted
all: Remove support for FROZEN_DIR and FROZEN_MPY_DIR.
These have been deprecated for over two years in favour of FROZEN_MANIFEST and manifest.py. Signed-off-by: Jim Mussared <[email protected]>
1 parent f241db7 commit 92353c2

File tree

8 files changed

+13
-119
lines changed

8 files changed

+13
-119
lines changed

ports/esp8266/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ AXTLS_DEFS_EXTRA = -Dabort=abort_ -DRT_MAX_PLAIN_LENGTH=1024 -DRT_EXTRA=4096
2727
BTREE_DEFS_EXTRA = -DDEFPSIZE=1024 -DMINCACHE=3
2828

2929
FROZEN_MANIFEST ?= boards/manifest.py
30-
FROZEN_DIR ?=
31-
FROZEN_MPY_DIR ?=
3230

3331
# include py core make definitions
3432
include $(TOP)/py/py.mk
@@ -196,12 +194,9 @@ $(BUILD)/uart.o: $(CONFVARS_FILE)
196194

197195
FROZEN_EXTRA_DEPS = $(CONFVARS_FILE)
198196

199-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
197+
ifneq ($(FROZEN_MANIFEST),)
200198
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
201199
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
202-
endif
203-
204-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_DIR),)
205200
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
206201
endif
207202

ports/javascript/Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ CFLAGS += -std=c99 -Wall -Werror -Wdouble-promotion -Wfloat-conversion
1717
CFLAGS += -O3 -DNDEBUG
1818
CFLAGS += $(INC)
1919

20-
ifneq ($(FROZEN_MPY_DIR),)
21-
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
22-
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
23-
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
24-
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
25-
endif
26-
2720
SRC_SHARED = $(addprefix shared/,\
2821
runtime/interrupt_char.c \
2922
runtime/stdout_helpers.c \

ports/nrf/Makefile

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,6 @@ DRIVERS_SRC_C += $(addprefix modules/,\
340340
SRC_C += \
341341
device/startup_$(MCU_SUB_VARIANT).c \
342342

343-
ifneq ($(FROZEN_MPY_DIR),)
344-
FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py')
345-
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
346-
endif
347-
348343
LIBGCC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
349344
LIBS += -L $(dir $(LIBGCC_FILE_NAME)) -lgcc
350345

@@ -542,17 +537,10 @@ GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
542537
GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h
543538
GEN_PINS_AF_PY = $(BUILD)/pins_af.py
544539

545-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_DIR),)
546-
# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
547-
# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
548-
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
549-
endif
550-
551-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
552-
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
553-
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
540+
ifneq ($(FROZEN_MANIFEST),)
554541
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
555542
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
543+
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
556544
endif
557545

558546
$(PY_BUILD)/nlr%.o: CFLAGS += -Os -fno-lto

ports/nrf/README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,6 @@ The **make sd** will trigger a flash of the bluetooth stack before that applicat
9696

9797
Note: further tuning of features to include in bluetooth or even setting up the device to use REPL over Bluetooth can be configured in the `bluetooth_conf.h`.
9898

99-
## Compile with frozen modules
100-
101-
Frozen modules are Python modules compiled to bytecode and added to the firmware
102-
image, as part of MicroPython. They can be imported as usual, using the `import`
103-
statement. The advantage is that frozen modules use a lot less RAM as the
104-
bytecode is stored in flash, not in RAM like when importing from a filesystem.
105-
Also, frozen modules are available even when no filesystem is present to import
106-
from.
107-
108-
To use frozen modules, put them in a directory (e.g. `freeze/`) and supply
109-
`make` with the given directory. For example:
110-
111-
make BOARD=pca10040 FROZEN_MPY_DIR=freeze
112-
11399
## Compile with freeze manifest
114100

115101
Freeze manifests can be used by definining `FROZEN_MANIFEST` pointing to a

ports/stm32/Makefile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -596,17 +596,10 @@ $(TOP)/lib/stm32lib/README.md:
596596
$(ECHO) "stm32lib submodule not found, fetching it now..."
597597
(cd $(TOP) && git submodule update --init lib/stm32lib)
598598

599-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_DIR),)
600-
# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
601-
# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
602-
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
603-
endif
604-
605-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
606-
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
607-
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
599+
ifneq ($(FROZEN_MANIFEST),)
608600
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
609601
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
602+
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
610603
endif
611604

612605
define RUN_DFU

ports/unix/Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ include ../../py/mkenv.mk
1313
-include mpconfigport.mk
1414
include $(VARIANT_DIR)/mpconfigvariant.mk
1515

16-
# use FROZEN_MANIFEST for new projects, others are legacy
16+
# Use the default frozen manifest, variants may override this.
1717
FROZEN_MANIFEST ?= variants/manifest.py
18-
FROZEN_DIR =
19-
FROZEN_MPY_DIR =
2018

2119
# This should be configured by the mpconfigvariant.mk
2220
PROG ?= micropython
@@ -263,15 +261,12 @@ SRC_QSTR += $(SRC_C) $(SRC_CXX) $(SHARED_SRC_C) $(EXTMOD_SRC_C)
263261
# SRC_QSTR
264262
SRC_QSTR_AUTO_DEPS +=
265263

266-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
264+
ifneq ($(FROZEN_MANIFEST),)
267265
# To use frozen code create a manifest.py file with a description of files to
268266
# freeze, then invoke make with FROZEN_MANIFEST=manifest.py (be sure to build from scratch).
269267
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
270268
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
271269
CFLAGS += -DMPZ_DIG_SIZE=16 # force 16 bits to work on both 32 and 64 bit archs
272-
endif
273-
274-
ifneq ($(FROZEN_MANIFEST)$(FROZEN_DIR),)
275270
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
276271
endif
277272

py/mkrules.mk

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -142,43 +142,18 @@ $(MICROPY_MPYCROSS_DEPENDENCY):
142142
$(MAKE) -C $(dir $@)
143143
endif
144144

145-
ifneq ($(FROZEN_MANIFEST),)
146-
# to build frozen_content.c from a manifest
147-
$(BUILD)/frozen_content.c: FORCE $(BUILD)/genhdr/qstrdefs.generated.h | $(MICROPY_MPYCROSS_DEPENDENCY)
148-
$(Q)$(MAKE_MANIFEST) -o $@ -v "MPY_DIR=$(TOP)" -v "MPY_LIB_DIR=$(MPY_LIB_DIR)" -v "PORT_DIR=$(shell pwd)" -v "BOARD_DIR=$(BOARD_DIR)" -b "$(BUILD)" $(if $(MPY_CROSS_FLAGS),-f"$(MPY_CROSS_FLAGS)",) --mpy-tool-flags="$(MPY_TOOL_FLAGS)" $(FROZEN_MANIFEST)
149-
150145
ifneq ($(FROZEN_DIR),)
151-
$(error FROZEN_DIR cannot be used in conjunction with FROZEN_MANIFEST)
146+
$(error Support for FROZEN_DIR was removed. Please use manifest.py instead, see https://docs.micropython.org/en/latest/reference/manifest.html)
152147
endif
153148

154149
ifneq ($(FROZEN_MPY_DIR),)
155-
$(error FROZEN_MPY_DIR cannot be used in conjunction with FROZEN_MANIFEST)
156-
endif
157-
endif
158-
159-
ifneq ($(FROZEN_DIR),)
160-
$(info Warning: FROZEN_DIR is deprecated in favour of FROZEN_MANIFEST)
161-
$(BUILD)/frozen.c: $(wildcard $(FROZEN_DIR)/*) $(HEADER_BUILD) $(FROZEN_EXTRA_DEPS)
162-
$(ECHO) "GEN $@"
163-
$(Q)$(MAKE_FROZEN) $(FROZEN_DIR) > $@
150+
$(error Support for FROZEN_MPY_DIR was removed. Please use manifest.py instead, see https://docs.micropython.org/en/latest/reference/manifest.html)
164151
endif
165152

166-
ifneq ($(FROZEN_MPY_DIR),)
167-
$(info Warning: FROZEN_MPY_DIR is deprecated in favour of FROZEN_MANIFEST)
168-
# make a list of all the .py files that need compiling and freezing
169-
FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py' | $(SED) -e 's=^$(FROZEN_MPY_DIR)/==')
170-
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/frozen_mpy/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
171-
172-
# to build .mpy files from .py files
173-
$(BUILD)/frozen_mpy/%.mpy: $(FROZEN_MPY_DIR)/%.py | $(MICROPY_MPYCROSS_DEPENDENCY)
174-
@$(ECHO) "MPY $<"
175-
$(Q)$(MKDIR) -p $(dir $@)
176-
$(Q)$(MICROPY_MPYCROSS) -o $@ -s $(<:$(FROZEN_MPY_DIR)/%=%) $(MPY_CROSS_FLAGS) $<
177-
178-
# to build frozen_mpy.c from all .mpy files
179-
$(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generated.h
180-
@$(ECHO) "GEN $@"
181-
$(Q)$(MPY_TOOL) -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h $(FROZEN_MPY_MPY_FILES) > $@
153+
ifneq ($(FROZEN_MANIFEST),)
154+
# to build frozen_content.c from a manifest
155+
$(BUILD)/frozen_content.c: FORCE $(BUILD)/genhdr/qstrdefs.generated.h | $(MICROPY_MPYCROSS_DEPENDENCY)
156+
$(Q)$(MAKE_MANIFEST) -o $@ -v "MPY_DIR=$(TOP)" -v "MPY_LIB_DIR=$(MPY_LIB_DIR)" -v "PORT_DIR=$(shell pwd)" -v "BOARD_DIR=$(BOARD_DIR)" -b "$(BUILD)" $(if $(MPY_CROSS_FLAGS),-f"$(MPY_CROSS_FLAGS)",) --mpy-tool-flags="$(MPY_TOOL_FLAGS)" $(FROZEN_MANIFEST)
182157
endif
183158

184159
ifneq ($(PROG),)
@@ -234,27 +209,6 @@ clean:
234209
$(RM) -rf $(BUILD) $(CLEAN_EXTRA)
235210
.PHONY: clean
236211

237-
# Clean every non-git file from FROZEN_DIR/FROZEN_MPY_DIR, but making a backup.
238-
# We run rmdir below to avoid empty backup dir (it will silently fail if backup
239-
# is non-empty).
240-
clean-frozen:
241-
if [ -n "$(FROZEN_MPY_DIR)" ]; then \
242-
backup_dir=$(FROZEN_MPY_DIR).$$(date +%Y%m%dT%H%M%S); mkdir $$backup_dir; \
243-
cd $(FROZEN_MPY_DIR); git status --ignored -u all -s . | awk ' {print $$2}' \
244-
| xargs --no-run-if-empty cp --parents -t ../$$backup_dir; \
245-
rmdir ../$$backup_dir 2>/dev/null || true; \
246-
git clean -d -f .; \
247-
fi
248-
249-
if [ -n "$(FROZEN_DIR)" ]; then \
250-
backup_dir=$(FROZEN_DIR).$$(date +%Y%m%dT%H%M%S); mkdir $$backup_dir; \
251-
cd $(FROZEN_DIR); git status --ignored -u all -s . | awk ' {print $$2}' \
252-
| xargs --no-run-if-empty cp --parents -t ../$$backup_dir; \
253-
rmdir ../$$backup_dir 2>/dev/null || true; \
254-
git clean -d -f .; \
255-
fi
256-
.PHONY: clean-frozen
257-
258212
print-cfg:
259213
$(ECHO) "PY_SRC = $(PY_SRC)"
260214
$(ECHO) "BUILD = $(BUILD)"

py/py.mk

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,6 @@ ifneq ($(FROZEN_MANIFEST),)
227227
PY_O += $(BUILD)/$(BUILD)/frozen_content.o
228228
endif
229229

230-
# object file for frozen files
231-
ifneq ($(FROZEN_DIR),)
232-
PY_O += $(BUILD)/$(BUILD)/frozen.o
233-
endif
234-
235-
# object file for frozen bytecode (frozen .mpy files)
236-
ifneq ($(FROZEN_MPY_DIR),)
237-
PY_O += $(BUILD)/$(BUILD)/frozen_mpy.o
238-
endif
239-
240230
# Sources that may contain qstrings
241231
SRC_QSTR_IGNORE = py/nlr%
242232
SRC_QSTR += $(SRC_MOD) $(filter-out $(SRC_QSTR_IGNORE),$(PY_CORE_O_BASENAME:.o=.c)) $(PY_EXTMOD_O_BASENAME:.o=.c)

0 commit comments

Comments
 (0)