summaryrefslogtreecommitdiffstats
path: root/patches/Python-3.1.2/0021-fix-parallel-building.patch
blob: 924352785323e270ac4a86be336510977f8b63bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From: Michael Olbrich <m.olbrich@pengutronix.de>
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 <m.olbrich@pengutronix.de>
---
 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