Skip to content

Commit 6be0a42

Browse files
committed
Don't run maketranslationdata twice
1 parent 9c11bb2 commit 6be0a42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

py/py.mk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,15 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/
262262
$(STEPECHO) "GEN $@"
263263
$(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --output_type=data $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@
264264

265-
$(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h
265+
# Is generated as a side-effect of building compression.generated.h
266+
# Specifying both in a single rule actually causes the rule to be run twice!
267+
# This alternative makes it run just once.
268+
$(PY_BUILD)/translations-$(TRANSLATION).c: $(HEADER_BUILD)/compression.generated.h
269+
@true
270+
271+
$(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h
266272
$(STEPECHO) "GEN $@"
273+
$(Q)mkdir -p $(PY_BUILD)
267274
$(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
268275

269276
PY_CORE_O += $(PY_BUILD)/translations-$(TRANSLATION).o

0 commit comments

Comments
 (0)