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.
--- 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