summaryrefslogtreecommitdiff
path: root/py/mkrules.mk
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-08-01 11:44:18 -0700
committerScott Shawcroft <scott@tannewt.org>2018-08-02 00:51:52 -0700
commit8cf03d2d009141916a7b32b30ec74f8289734f4b (patch)
tree1b086e2cbcab749ba16230e47dbfe3e2ef20c137 /py/mkrules.mk
parent24b4f28b9f605cac182bcbe61609c2e56d1a7435 (diff)
Speed up QSTR creation by pre-filtering files before pre-processing.
Diffstat (limited to 'py/mkrules.mk')
-rw-r--r--py/mkrules.mk5
1 files changed, 2 insertions, 3 deletions
diff --git a/py/mkrules.mk b/py/mkrules.mk
index 57a51194a..c3cb01f21 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -77,9 +77,9 @@ $(OBJ): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/mpversion.h
# - if anything in QSTR_GLOBAL_DEPENDENCIES is newer, then process all source files ($^)
# - else, if list of newer prerequisites ($?) is not empty, then process just these ($?)
# - else, process all source files ($^) [this covers "make -B" which can set $? to empty]
-$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h
+$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(SRC_QSTR_PP) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h
$(ECHO) "GEN $@"
- $(Q)$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) >$(HEADER_BUILD)/qstr.i.last;
+ $(Q)grep -lE "(MP_QSTR|i18n)" $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) | xargs $(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(SRC_QSTR_PP) >$(HEADER_BUILD)/qstr.i.last;
$(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last
$(STEPECHO) "GEN $@"
@@ -210,4 +210,3 @@ tags:
ctags -e -R $(TOP)
-include $(OBJ:.o=.P)
-