diff options
author | Dave Hylands <dhylands@gmail.com> | 2016-01-21 12:41:47 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-01-23 21:53:04 +0000 |
commit | 42a6364a311a96e376f3f1e2677007ee603b2ad6 (patch) | |
tree | 019d034307825bed615d367a3af8a66ebefdb167 | |
parent | 6c8b3a7feeb85b8d94f9035e972372b848fa2e74 (diff) |
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.
-rw-r--r-- | stmhal/Makefile | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile index 9f8c13a87..1edc31daa 100644 --- a/stmhal/Makefile +++ b/stmhal/Makefile @@ -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 |