summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-10-21 01:08:43 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-10-21 01:08:43 +0300
commitb440307b4a15a540413a7a9f699d388c7428a63c (patch)
treecb63d67fd8b5e386d0cb74464768723b9d158e13
parent3f251efb9bb22fe45ef5392b8ed9d6f9148415e7 (diff)
downloadmicropython-b440307b4a15a540413a7a9f699d388c7428a63c.tar.gz
micropython-b440307b4a15a540413a7a9f699d388c7428a63c.zip
py/py.mk: Automatically add frozen.c to source list if FROZEN_DIR is defined.
Now frozen modules generation handled fully by py.mk and available for reuse by any port.
-rw-r--r--esp8266/Makefile6
-rw-r--r--py/py.mk4
-rw-r--r--zephyr/Makefile1
3 files changed, 7 insertions, 4 deletions
diff --git a/esp8266/Makefile b/esp8266/Makefile
index c57206c4dc..5f0044df05 100644
--- a/esp8266/Makefile
+++ b/esp8266/Makefile
@@ -7,14 +7,15 @@ MICROPY_PY_USSL = 1
MICROPY_SSL_AXTLS = 1
MICROPY_PY_BTREE = 1
+FROZEN_DIR = scripts
+FROZEN_MPY_DIR = modules
+
# include py core make definitions
include ../py/py.mk
MPY_CROSS = ../mpy-cross/mpy-cross
MPY_TOOL = ../tools/mpy-tool.py
-FROZEN_DIR = scripts
-FROZEN_MPY_DIR = modules
PORT ?= /dev/ttyACM0
BAUD ?= 115200
FLASH_MODE ?= qio
@@ -90,7 +91,6 @@ SRC_C = \
modmachine.c \
modonewire.c \
ets_alt_task.c \
- $(BUILD)/frozen.c \
fatfs_port.c \
axtls_helpers.c \
hspi.c \
diff --git a/py/py.mk b/py/py.mk
index 8caa37f8aa..ab07bbbdec 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -237,6 +237,10 @@ PY_O_BASENAME = \
# prepend the build destination prefix to the py object files
PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
+ifneq ($(FROZEN_DIR),)
+PY_O += $(BUILD)/$(BUILD)/frozen.o
+endif
+
# Sources that may contain qstrings
SRC_QSTR_IGNORE = nlr% emitnx% emitnthumb% emitnarm%
SRC_QSTR = $(SRC_MOD) $(addprefix py/,$(filter-out $(SRC_QSTR_IGNORE),$(PY_O_BASENAME:.o=.c)) emitnative.c)
diff --git a/zephyr/Makefile b/zephyr/Makefile
index 1db84cb320..9682dc5ccf 100644
--- a/zephyr/Makefile
+++ b/zephyr/Makefile
@@ -41,7 +41,6 @@ SRC_C = main.c \
lib/utils/interrupt_char.c \
lib/utils/pyhelp.c \
lib/mp-readline/readline.c \
- $(BUILD)/frozen.c \
$(SRC_MOD)
# List of sources for qstr extraction