comparison doc/Makefile @ 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 ec26d6986d85
children f0105f2c424c
comparison
equal deleted inserted replaced
9443:7805b27e92b1 9444:2f7f6e43d52b
15 15
16 hg.1.txt: hg.1.gendoc.txt 16 hg.1.txt: hg.1.gendoc.txt
17 touch hg.1.txt 17 touch hg.1.txt
18 18
19 hg.1.gendoc.txt: gendoc.py ../mercurial/commands.py ../mercurial/help.py 19 hg.1.gendoc.txt: gendoc.py ../mercurial/commands.py ../mercurial/help.py
20 ${PYTHON} gendoc.py > $@ 20 ${PYTHON} gendoc.py > $@.tmp
21 mv $@.tmp $@
21 22
22 %: %.txt common.txt 23 %: %.txt common.txt
23 $(PYTHON) rst2man.py --strip-elements-with-class htmlonly $*.txt > $* 24 $(PYTHON) rst2man.py --strip-elements-with-class htmlonly $*.txt $*
24 25
25 %.html: %.txt common.txt 26 %.html: %.txt common.txt
26 $(RST2HTML) $*.txt > $*.html 27 $(RST2HTML) $*.txt $*.html
27 28
28 MANIFEST: man html 29 MANIFEST: man html
29 # tracked files are already in the main MANIFEST 30 # tracked files are already in the main MANIFEST
30 $(RM) $@ 31 $(RM) $@
31 for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \ 32 for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \