changeset 9444:2f7f6e43d52b

doc/Makefile: do not create files in case of errors When stdout is redirected to the target file directly, the file is created as an empty file even when an error occurs. Since the file is there, 'make' wont try to re-create it in subsequent runs. This fix is similar to the one in a6747ba27d22, but it also takes care of rst2html and gendoc.py.
author Martin Geisler <mg@lazybytes.net>
date Sun, 13 Sep 2009 17:05:38 +0200
parents 7805b27e92b1
children f0105f2c424c
files doc/Makefile
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/doc/Makefile	Sun Sep 13 17:53:09 2009 +0200
+++ b/doc/Makefile	Sun Sep 13 17:05:38 2009 +0200
@@ -17,13 +17,14 @@
 	touch hg.1.txt
 
 hg.1.gendoc.txt: gendoc.py ../mercurial/commands.py ../mercurial/help.py
-	${PYTHON} gendoc.py > $@
+	${PYTHON} gendoc.py > $@.tmp
+	mv $@.tmp $@
 
 %: %.txt common.txt
-	$(PYTHON) rst2man.py --strip-elements-with-class htmlonly $*.txt > $*
+	$(PYTHON) rst2man.py --strip-elements-with-class htmlonly $*.txt $*
 
 %.html: %.txt common.txt
-	$(RST2HTML) $*.txt > $*.html
+	$(RST2HTML) $*.txt $*.html
 
 MANIFEST: man html
 # tracked files are already in the main MANIFEST