Index: /trunk/doc/Makefile
===================================================================
--- /trunk/doc/Makefile	(revision 502)
+++ /trunk/doc/Makefile	(revision 503)
@@ -1,2 +1,5 @@
+# Runs pdflatex twice if it works, otherwise deletes the pdf output which isn't valid.
+# It deletes the pdf because that way you can fix the error and re-run make without
+# deleting the broken pdf yourself.
 %.pdf : %.tex
 	@find . -name $*.aux -cnewer $*.tex -exec rm {} \;
@@ -4,6 +7,5 @@
 		echo $(PDFLATEX) $*.tex; \
 		env TEXINPUTS=.:LaTeX:: $(PDFLATEX) $*.tex; \
-	fi; \
-	env TEXINPUTS=.:LaTeX:: $(PDFLATEX) $*.tex
+	fi && env TEXINPUTS=.:LaTeX:: $(PDFLATEX) $*.tex || $(RM) $*.pdf
 #
 PDFLATEX = pdflatex
