From 6be0a425c751574074ff92637303c1236a8754ab Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 17:05:09 -0600 Subject: [PATCH] Don't run maketranslationdata twice --- py/py.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index 6827fbe786..0cbfd252f2 100644 --- a/py/py.mk +++ b/py/py.mk @@ -262,8 +262,15 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/ $(STEPECHO) "GEN $@" $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --output_type=data $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ -$(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h +# Is generated as a side-effect of building compression.generated.h +# Specifying both in a single rule actually causes the rule to be run twice! +# This alternative makes it run just once. +$(PY_BUILD)/translations-$(TRANSLATION).c: $(HEADER_BUILD)/compression.generated.h + @true + +$(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h $(STEPECHO) "GEN $@" + $(Q)mkdir -p $(PY_BUILD) $(Q)$(PYTHON) $(PY_SRC)/maketranslationdata.py --compression_filename $(HEADER_BUILD)/compression.generated.h --translation $(HEADER_BUILD)/$(TRANSLATION).mo --translation_filename $(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/qstrdefs.preprocessed.h PY_CORE_O += $(PY_BUILD)/translations-$(TRANSLATION).o