Skip to content

Commit b98c162

Browse files
swegenerdpgeorge
authored andcommitted
py: Fix order-only dependencies in mkrules.mk and py.mk.
Currently compilation sporadically fails, because the automatic dependency gets created *during* the compilation of objects. OBJ is a auperset of PY_O and the dependencies apply to all objects. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
1 parent 1e9a92f commit b98c162

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

py/mkrules.mk

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,20 @@ $(BUILD)/%.pp: %.c
5353
# prerequisites only get built if they don't exist. They don't cause timestamp
5454
# checking to be performed.
5555
#
56+
# We don't know which source files actually need the generated.h (since
57+
# it is #included from str.h). The compiler generated dependencies will cause
58+
# the right .o's to get recompiled if the generated.h file changes. Adding
59+
# an order-only dependendency to all of the .o's will cause the generated .h
60+
# to get built before we try to compile any of them.
61+
$(OBJ): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/py-version.h
62+
5663
# $(sort $(var)) removes duplicates
5764
#
5865
# The net effect of this, is it causes the objects to depend on the
5966
# object directories (but only for existence), and the object directories
6067
# will be created if they don't exist.
6168
OBJ_DIRS = $(sort $(dir $(OBJ)))
62-
$(OBJ): $(HEADER_BUILD)/qstrdefs.generated.h | $(OBJ_DIRS)
69+
$(OBJ): | $(OBJ_DIRS)
6370
$(OBJ_DIRS):
6471
$(MKDIR) -p $@
6572

py/py.mk

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(PY_SRC)/mak
137137
$(ECHO) "makeqstrdata $(PY_QSTR_DEFS) $(QSTR_DEFS)"
138138
$(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h $(QSTR_DEFS) > $@
139139

140-
# We don't know which source files actually need the generated.h (since
141-
# it is #included from str.h). The compiler generated dependencies will cause
142-
# the right .o's to get recompiled if the generated.h file changes. Adding
143-
# an order-only dependendency to all of the .o's will cause the generated .h
144-
# to get built before we try to compile any of them.
145-
$(PY_O): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/py-version.h
146-
147140
# emitters
148141

149142
$(PY_BUILD)/emitnx64.o: CFLAGS += -DN_X64

0 commit comments

Comments
 (0)