8000 Speed up QSTR creation by pre-filtering files before pre-processing. · sparkfun/circuitpython@8cf03d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8cf03d2

Browse files
committed
Speed up QSTR creation by pre-filtering files before pre-processing.
1 parent 24b4f28 commit 8cf03d2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

ports/atmel-samd/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ endif
427427
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
428428

429429
SRC_QSTR += $(SRC_C) $(SRC_SUPERVISOR) $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED) $(STM_SRC_C)
430+
SRC_QSTR_PP += peripherals/samd/$(CHIP_FAMILY)/clocks.c
430431

431432
all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2
432433

py/mkrules.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ $(OBJ): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/mpversion.h
7777
# - if anything in QSTR_GLOBAL_DEPENDENCIES is newer, then process all source files ($^)
7878
# - else, if list of newer prerequisites ($?) is not empty, then process just these ($?)
7979
# - else, process all source files ($^) [this covers "make -B" which can set $? to empty]
80-
$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h
80+
$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) $(SRC_QSTR_PP) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h
8181
$(ECHO) "GEN $@"
82-
$(Q)$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) >$(HEADER_BUILD)/qstr.i.last;
82+
$(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;
8383

8484
$(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last
8585
$(STEPECHO) "GEN $@"
@@ -210,4 +210,3 @@ tags:
210210
ctags -e -R $(TOP)
211211

212212
-include $(OBJ:.o=.P)
213-

py/py.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ endif
279279
# Sources that may contain qstrings
280280
SRC_QSTR_IGNORE = py/nlr%
281281
SRC_QSTR = $(SRC_MOD) $(filter-out $(SRC_QSTR_IGNORE),$(PY_CORE_O_BASENAME:.o=.c)) $(PY_EXTMOD_O_BASENAME:.o=.c)
282+
# Sources that only hold QSTRs after pre-processing.
283+
SRC_QSTR_PP =
282284

283285
# Anything that depends on FORCE will be considered out-of-date
284286
FORCE:

0 commit comments

Comments
 (0)
0