diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-06-07 00:27:17 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-06-07 00:27:17 (GMT) |
commit | 9c2a8f97da41e230bcd25bf169d254ee74be2f6a (patch) | |
tree | 59e26303fdf4966c477dcb548afaf7f873711765 /Makefile.pre.in | |
parent | 8f5798edfb71342fa4b3070a7f69386f7b229cd0 (diff) | |
download | cpython-9c2a8f97da41e230bcd25bf169d254ee74be2f6a.zip cpython-9c2a8f97da41e230bcd25bf169d254ee74be2f6a.tar.gz cpython-9c2a8f97da41e230bcd25bf169d254ee74be2f6a.tar.bz2 |
Issue #27229: Fix in-tree cross-build rule, by Xavier de Gaye
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r-- | Makefile.pre.in | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index dee1263..eb88f5f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -793,13 +793,16 @@ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN) if test "$(cross_compiling)" != "yes"; then \ $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C); \ else \ - cp $(srcdir)/Include/graminit.h $(GRAMMAR_H); \ + # Avoid copying the file onto itself for an in-tree build \ + cp $(srcdir)/Include/graminit.h $(GRAMMAR_H).tmp; \ + mv $(GRAMMAR_H).tmp $(GRAMMAR_H); \ fi $(GRAMMAR_C): $(GRAMMAR_H) if test "$(cross_compiling)" != "yes"; then \ touch $(GRAMMAR_C); \ else \ - cp $(srcdir)/Python/graminit.c $(GRAMMAR_C); \ + cp $(srcdir)/Python/graminit.c $(GRAMMAR_C).tmp; \ + mv $(GRAMMAR_C).tmp $(GRAMMAR_C); \ fi $(PGEN): $(PGENOBJS) |