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>
This commit is contained in:
parent
1e9a92f84f
commit
b98c162c52
|
@ -53,13 +53,20 @@ $(BUILD)/%.pp: %.c
|
|||
# prerequisites only get built if they don't exist. They don't cause timestamp
|
||||
# checking to be performed.
|
||||
#
|
||||
# We don't know which source files actually need the generated.h (since
|
||||
# it is #included from str.h). The compiler generated dependencies will cause
|
||||
# the right .o's to get recompiled if the generated.h file changes. Adding
|
||||
# an order-only dependendency to all of the .o's will cause the generated .h
|
||||
# to get built before we try to compile any of them.
|
||||
$(OBJ): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/py-version.h
|
||||
|
||||
# $(sort $(var)) removes duplicates
|
||||
#
|
||||
# The net effect of this, is it causes the objects to depend on the
|
||||
# object directories (but only for existence), and the object directories
|
||||
# will be created if they don't exist.
|
||||
OBJ_DIRS = $(sort $(dir $(OBJ)))
|
||||
$(OBJ): $(HEADER_BUILD)/qstrdefs.generated.h | $(OBJ_DIRS)
|
||||
$(OBJ): | $(OBJ_DIRS)
|
||||
$(OBJ_DIRS):
|
||||
$(MKDIR) -p $@
|
||||
|
||||
|
|
7
py/py.mk
7
py/py.mk
|
@ -137,13 +137,6 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(PY_SRC)/mak
|
|||
$(ECHO) "makeqstrdata $(PY_QSTR_DEFS) $(QSTR_DEFS)"
|
||||
$(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h $(QSTR_DEFS) > $@
|
||||
|
||||
# We don't know which source files actually need the generated.h (since
|
||||
# it is #included from str.h). The compiler generated dependencies will cause
|
||||
# the right .o's to get recompiled if the generated.h file changes. Adding
|
||||
# an order-only dependendency to all of the .o's will cause the generated .h
|
||||
# to get built before we try to compile any of them.
|
||||
$(PY_O): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/py-version.h
|
||||
|
||||
# emitters
|
||||
|
||||
$(PY_BUILD)/emitnx64.o: CFLAGS += -DN_X64
|
||||
|
|
Loading…
Reference in New Issue