doc/Makefile: do not create files in case of errors
authorMartin Geisler <mg@lazybytes.net>
Sun, 13 Sep 2009 17:05:38 +0200
changeset 9444 2f7f6e43d52b
parent 9443 7805b27e92b1
child 9445 f0105f2c424c
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.
doc/Makefile
--- 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