aboutsummaryrefslogtreecommitdiff
path: root/py/mkrules.mk
diff options
context:
space:
mode:
authorPaul Sokolovsky2016-04-19 14:39:08 +0300
committerPaul Sokolovsky2016-04-19 14:39:08 +0300
commit1b60a6dc4e755e14453e024364c8ef5f07780d80 (patch)
tree4e1efeb0ec28a40a66ed101e3f3fcaa9ed785299 /py/mkrules.mk
parent8dd704b019e5c065ced8842e143081be2b7c9a59 (diff)
py: Divide "split" and "cat" phases of qstr extraction for better efficiency.
E.g. for stmhal, accumulated preprocessed output may grow large due to bloated vendor headers, and then reprocessing tens of megabytes on each build make take couple of seconds on fast hardware (=> potentially dozens of seconds on slow hardware). So instead, split once after each change, and only cat repetitively (guaranteed to be fast, as there're thousands of lines involved at most).
Diffstat (limited to 'py/mkrules.mk')
-rw-r--r--py/mkrules.mk9
1 files changed, 7 insertions, 2 deletions
diff --git a/py/mkrules.mk b/py/mkrules.mk
index 7f1bbe868..fd68a75b1 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -90,9 +90,14 @@ $(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) | $(HEADER_BUILD)/mpversion.h
$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $? >$(HEADER_BUILD)/qstr.i.last; \
fi
-$(QSTR_DEFS_COLLECTED): $(HEADER_BUILD)/qstr.i.last
+$(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last
$(ECHO) "GEN $@"
- $(Q)$(PYTHON) $(PY_SRC)/makeqstrdefs.py $(HEADER_BUILD)/qstr.i.last $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED)
+ $(Q)$(PYTHON) $(PY_SRC)/makeqstrdefs.py split $(HEADER_BUILD)/qstr.i.last $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED)
+ $(Q)touch $@
+
+$(QSTR_DEFS_COLLECTED): $(HEADER_BUILD)/qstr.split
+ $(ECHO) "GEN $@"
+ $(Q)$(PYTHON) $(PY_SRC)/makeqstrdefs.py cat $(HEADER_BUILD)/qstr.i.last $(HEADER_BUILD)/qstr $(QSTR_DEFS_COLLECTED)
# $(sort $(var)) removes duplicates
#