doc/Makefile: detect rst2man errors
authorMads Kiilerich <mads@kiilerich.com>
Thu, 20 Aug 2009 23:35:37 +0200
changeset 9400 a6747ba27d22
parent 9399 f60f6f41978e
child 9401 2a5144687727
doc/Makefile: detect rst2man errors Make couldn't detect rst2man errors when it wasn't the last command, so empty man page files would be installed.
doc/Makefile
--- a/doc/Makefile	Wed Aug 19 00:45:24 2009 +0200
+++ b/doc/Makefile	Thu Aug 20 23:35:37 2009 +0200
@@ -21,11 +21,13 @@
 	${PYTHON} gendoc.py > $@
 
 %: %.txt common.txt
+	$(RST2MAN) $*.txt > $*.tmp
 	# add newline after all literal blocks and fix backslash escape
-	$(RST2MAN) $*.txt \
-	  | sed -e 's/^\.fi$$/.fi\n/' \
-	  | sed -e 's/\\fB\\\\fP/\\fB\\e\\fP/' \
-	  > $*
+	sed \
+	  -e 's/^\.fi$$/.fi\n/' \
+	  -e 's/\\fB\\\\fP/\\fB\\e\\fP/' \
+	  $*.tmp > $*
+	rm $*.tmp
 
 %.html: %.txt common.txt
 	$(RST2HTML) $*.txt > $*.html