From: Michael Olbrich Date: Wed, 11 Aug 2010 10:44:06 +0200 Subject: [PATCH] fix parallel building Producing two target with on command results in a race condition: Both targets are requested, the command is executed twice, and the target are overwritten randomly. Solution: Run the command for on target and let the second depend on it. Then touch the second to make sure it's newer. Signed-off-by: Michael Olbrich --- Makefile.pre.in | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/Makefile.pre.in b/Makefile.pre.in index 8e49d84..aced68e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -546,7 +546,10 @@ Modules/python.o: $(srcdir)/Modules/python.c $(IO_OBJS): $(IO_H) -$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) +$(GRAMMAR_H): $(GRAMMAR_C) + @touch $@ + +$(GRAMMAR_C): $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) -@$(INSTALL) -d Include -$(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) -- 1.7.1