summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-02-22 11:13:04 +1100
committerDamien George <damien.p.george@gmail.com>2018-02-22 12:48:15 +1100
commit8ca469cae299f8e93dfe721bb915adb217dc4cfe (patch)
treed099d8336d1d40f22639c3bf118b7dc8156c55db /py
parent6e675c1baaf0de0d56a2345376d6b5600bfab3aa (diff)
py/py.mk: Split list of uPy sources into core and extmod files.
If a port only needs the core files then it can now use the $(PY_CORE_O) variable instead of $(PY_O). $(PY_EXTMOD_O) contains the list of extmod files (including some files from lib/). $(PY_O) retains its original definition as the list of all object file (including those for frozen code) and is a convenience variable for ports that want everything.
Diffstat (limited to 'py')
-rw-r--r--py/py.mk12
1 files changed, 9 insertions, 3 deletions
diff --git a/py/py.mk b/py/py.mk
index 6cfe21ca9..20574d2c5 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -101,7 +101,7 @@ $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS)
endif
# py object files
-PY_O_BASENAME = \
+PY_CORE_O_BASENAME = \
mpstate.o \
nlr.o \
nlrx86.o \
@@ -214,6 +214,8 @@ PY_O_BASENAME = \
repl.o \
smallint.o \
frozenmod.o \
+
+PY_EXTMOD_O_BASENAME = \
../extmod/moductypes.o \
../extmod/modujson.o \
../extmod/modure.o \
@@ -248,7 +250,11 @@ PY_O_BASENAME = \
../lib/utils/printf.o \
# prepend the build destination prefix to the py object files
-PY_O = $(addprefix $(PY_BUILD)/, $(PY_O_BASENAME))
+PY_CORE_O = $(addprefix $(PY_BUILD)/, $(PY_CORE_O_BASENAME))
+PY_EXTMOD_O = $(addprefix $(PY_BUILD)/, $(PY_EXTMOD_O_BASENAME))
+
+# this is a convenience variable for ports that want core, extmod and frozen code
+PY_O = $(PY_CORE_O) $(PY_EXTMOD_O)
# object file for frozen files
ifneq ($(FROZEN_DIR),)
@@ -262,7 +268,7 @@ endif
# Sources that may contain qstrings
SRC_QSTR_IGNORE = nlr% emitnx86% emitnx64% emitnthumb% emitnarm% emitnxtensa%
-SRC_QSTR = $(SRC_MOD) $(addprefix py/,$(filter-out $(SRC_QSTR_IGNORE),$(PY_O_BASENAME:.o=.c)) emitnative.c)
+SRC_QSTR = $(SRC_MOD) $(addprefix py/,$(filter-out $(SRC_QSTR_IGNORE),$(PY_CORE_O_BASENAME:.o=.c)) emitnative.c $(PY_EXTMOD_O_BASENAME:.o=.c))
# Anything that depends on FORCE will be considered out-of-date
FORCE: