summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/unix/Makefile16
-rw-r--r--ports/unix/manifest.py2
-rw-r--r--ports/unix/manifest_coverage.py2
l---------ports/unix/modules/upip.py1
l---------ports/unix/modules/upip_utarfile.py1
5 files changed, 13 insertions, 9 deletions
diff --git a/ports/unix/Makefile b/ports/unix/Makefile
index 134502b4d..b840856ff 100644
--- a/ports/unix/Makefile
+++ b/ports/unix/Makefile
@@ -1,8 +1,10 @@
-include mpconfigport.mk
include ../../py/mkenv.mk
-FROZEN_DIR = scripts
-FROZEN_MPY_DIR = modules
+# use FROZEN_MANIFEST for new projects, others are legacy
+FROZEN_MANIFEST ?= manifest.py
+FROZEN_DIR =
+FROZEN_MPY_DIR =
# define main target
PROG = micropython
@@ -177,9 +179,9 @@ SRC_QSTR += $(SRC_C) $(LIB_SRC_C)
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
-ifneq ($(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).
+ifneq ($(FROZEN_MANIFEST)$(FROZEN_MPY_DIR),)
+# To use frozen code create a manifest.py file with a description of files to
+# freeze, then invoke make with FROZEN_MANIFEST=manifest.py (be sure to build from scratch).
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
CFLAGS += -DMPZ_DIG_SIZE=16 # force 16 bits to work on both 32 and 64 bit archs
@@ -215,7 +217,7 @@ fast:
# build a minimal interpreter
minimal:
$(MAKE) COPT="-Os -DNDEBUG" CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_minimal.h>"' \
- BUILD=build-minimal PROG=micropython_minimal FROZEN_DIR= FROZEN_MPY_DIR= \
+ BUILD=build-minimal PROG=micropython_minimal FROZEN_MANIFEST= \
MICROPY_PY_BTREE=0 MICROPY_PY_FFI=0 MICROPY_PY_SOCKET=0 MICROPY_PY_THREAD=0 \
MICROPY_PY_TERMIOS=0 MICROPY_PY_USSL=0 \
MICROPY_USE_READLINE=0
@@ -252,7 +254,7 @@ coverage:
-Wold-style-definition -Wpointer-arith -Wshadow -Wuninitialized -Wunused-parameter \
-DMICROPY_UNIX_COVERAGE' \
LDFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' \
- FROZEN_DIR=coverage-frzstr FROZEN_MPY_DIR=coverage-frzmpy \
+ FROZEN_MANIFEST=manifest_coverage.py \
BUILD=build-coverage PROG=micropython_coverage
coverage_test: coverage
diff --git a/ports/unix/manifest.py b/ports/unix/manifest.py
new file mode 100644
index 000000000..3f332446d
--- /dev/null
+++ b/ports/unix/manifest.py
@@ -0,0 +1,2 @@
+freeze_as_mpy('$(MPY)/tools', 'upip.py')
+freeze_as_mpy('$(MPY)/tools', 'upip_utarfile.py', opt=3)
diff --git a/ports/unix/manifest_coverage.py b/ports/unix/manifest_coverage.py
new file mode 100644
index 000000000..0c32d0857
--- /dev/null
+++ b/ports/unix/manifest_coverage.py
@@ -0,0 +1,2 @@
+freeze_as_str('coverage-frzstr')
+freeze_as_mpy('coverage-frzmpy')
diff --git a/ports/unix/modules/upip.py b/ports/unix/modules/upip.py
deleted file mode 120000
index 130eb6901..000000000
--- a/ports/unix/modules/upip.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../tools/upip.py \ No newline at end of file
diff --git a/ports/unix/modules/upip_utarfile.py b/ports/unix/modules/upip_utarfile.py
deleted file mode 120000
index d9653d6a6..000000000
--- a/ports/unix/modules/upip_utarfile.py
+++ /dev/null
@@ -1 +0,0 @@
-../../../tools/upip_utarfile.py \ No newline at end of file