stmhal: Add support for building frozen files.

This allows FROZEN_DIR=some-directory to be specified on the make
command line, which will then add all of the files contained within
the indicated frozen directory as frozen files in the image.

There is no change in flash/ram usage if not using the feature.

This is especially useful on smaller MCUs (like the 401) which only
has 64K flash file system.
eager-mp_stack_ctrl
Dave Hylands 2016-01-21 12:41:47 -08:00 committed by Damien George
parent 6c8b3a7fee
commit 42a6364a31
1 changed files with 13 additions and 0 deletions

View File

@ -264,6 +264,19 @@ $(BUILD)/$(HAL_DIR)/src/stm32$(MCU_SERIES)xx_hal_sd.o: COPT += -Os
all: $(BUILD)/firmware.dfu $(BUILD)/firmware.hex
ifneq ($(FROZEN_DIR),)
CFLAGS += -DMICROPY_MODULE_FROZEN
OBJ += $(BUILD)/frozen-files.o
MAKE_FROZEN = ../tools/make-frozen.py
$(BUILD)/frozen-files.o: $(BUILD)/frozen-files.c
$(call compile_c)
$(BUILD)/frozen-files.c: $(shell find $(FROZEN_DIR) -type f)
@$(ECHO) "Creating $@"
$(Q)$(PYTHON) $(MAKE_FROZEN) $(FROZEN_DIR) > $@
endif
.PHONY: deploy
deploy: $(BUILD)/firmware.dfu