summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Ruben Bakke <glennbakke@gmail.com>2019-12-04 07:37:19 +0100
committerDamien George <damien@micropython.org>2021-08-08 23:17:55 +1000
commit990341d18e72636c300e1880dd11500c07bd9f46 (patch)
tree8d4b90713a53c24249ac113cca2536909d34d4b3
parent4326e0880273431d5ee8fcc0b9b081e848fdc736 (diff)
nrf: Facilitate use of freeze manifest.
Update the Makefile to handle FROZEN_MANIFEST, and the README with some small samples on how to use freeze manifests. And add BOARD_DIR to the Makefile which can be referenced in boards/<board>/mpconfigboard.mk to include a board specific manifest.
-rw-r--r--ports/nrf/Makefile6
-rw-r--r--ports/nrf/README.md16
2 files changed, 20 insertions, 2 deletions
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index fb7eb5c59..0e46885ea 100644
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -5,6 +5,8 @@ ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified)
endif
+BOARD_DIR ?= boards/$(BOARD)
+
# If SoftDevice is selected, try to use that one.
SD ?=
SD_LOWER = $(shell echo $(SD) | tr '[:upper:]' '[:lower:]')
@@ -537,13 +539,13 @@ GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h
GEN_PINS_AF_PY = $(BUILD)/pins_af.py
-ifneq ($(FROZEN_DIR),)
+ifneq ($(FROZEN_MANIFEST)$(FROZEN_DIR),)
# To use frozen source modules, put your .py files in a subdirectory (eg scripts/)
# and then invoke make with FROZEN_DIR=scripts (be sure to build from scratch).
CFLAGS += -DMICROPY_MODULE_FROZEN_STR
endif
-ifneq ($(FROZEN_MPY_DIR),)
+ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
# To use frozen bytecode, put your .py files in a subdirectory (eg frozen/) and
# then invoke make with FROZEN_MPY_DIR=frozen (be sure to build from scratch).
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
diff --git a/ports/nrf/README.md b/ports/nrf/README.md
index a4509cc6e..aa8968ff9 100644
--- a/ports/nrf/README.md
+++ b/ports/nrf/README.md
@@ -110,6 +110,22 @@ To use frozen modules, put them in a directory (e.g. `freeze/`) and supply
make BOARD=pca10040 FROZEN_MPY_DIR=freeze
+## Compile with freeze manifest
+
+Freeze manifests can be used by definining `FROZEN_MANIFEST` pointing to a
+`manifest.py`. This can either be done by a `make` invocation or by defining
+it in the specific target board's `mpconfigboard.mk`.
+
+For example:
+
+ make BOARD=pca10040 FROZEN_MANIFEST=path/to/manifest.py
+
+In case of using the target board's makefile, add a line similar to this:
+
+ FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py
+
+In these two examples, the manual `make` invocation will have precedence.
+
## Enable MICROPY_VFS_FAT
As the `oofatfs` module is not having header guards that can exclude the implementation compile time, this port provides a flag to enable it explicitly. The MICROPY_VFS_FAT is by default set to 0 and has to be set to 1 if `oofatfs` files should be compiled. This will be in addition of setting `MICROPY_VFS` in mpconfigport.h.