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.
This commit is contained in:
Glenn Ruben Bakke 2019-12-04 07:37:19 +01:00 committed by Damien George
parent 4326e08802
commit 990341d18e
2 changed files with 20 additions and 2 deletions

View File

@ -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

View File

@ -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.