aboutsummaryrefslogtreecommitdiff
path: root/py/mkrules.mk
diff options
context:
space:
mode:
authorDamien George2018-06-09 15:23:13 +1000
committerDamien George2018-06-12 13:53:43 +1000
commit7ad04d17dabd503b0a79426166bcdc9e8ea4bf91 (patch)
tree93a6c3f2e84d407eeb1a6e31b174cf0cb1bbe89a /py/mkrules.mk
parent0501427907283a29cf61bf5fba3ab17ac81b89df (diff)
py/mkrules.mk: Regenerate all qstrs when config files change.
A port can define QSTR_GLOBAL_DEPENDENCIES to add extra files.
Diffstat (limited to 'py/mkrules.mk')
-rw-r--r--py/mkrules.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/py/mkrules.mk b/py/mkrules.mk
index 850c2aa3a..30ac520aa 100644
--- a/py/mkrules.mk
+++ b/py/mkrules.mk
@@ -66,9 +66,13 @@ $(BUILD)/%.pp: %.c
# to get built before we try to compile any of them.
$(OBJ): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/mpversion.h
-$(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) | $(HEADER_BUILD)/mpversion.h
+# The logic for qstr regeneration is:
+# - 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
$(ECHO) "GEN $@"
- $(Q)$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(if $?,$?,$^) >$(HEADER_BUILD)/qstr.i.last;
+ $(Q)$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(if $(filter $?,$(QSTR_GLOBAL_DEPENDENCIES)),$^,$(if $?,$?,$^)) >$(HEADER_BUILD)/qstr.i.last;
$(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last
$(ECHO) "GEN $@"