From bf9e40aa2989d9ae6f2055cb91405802cf99c2ff Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Wed, 16 Jan 2013 20:45:42 -0800
Subject: [PATCH] Generate pdf file by default.

o Change default from ps to pdf output.
o Fix pattern for rerunning latex to prevent infinite loop due to
  extraneous occurrences of "Rerun".  (From Carl.)
o Reorder rules for generating pdf so that we generate the indices and
  such before starting the loop.  Otherwise, we're in an infinite loop
  because the indices haven't been generated.
---
 src/docs/cmu-user/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/docs/cmu-user/Makefile b/src/docs/cmu-user/Makefile
index 4a3e34576..25924ef08 100644
--- a/src/docs/cmu-user/Makefile
+++ b/src/docs/cmu-user/Makefile
@@ -43,7 +43,7 @@ FILES = *.tex
 .SUFFIXES: .tex .dvi .ps .ps1 .pdf .html .info
 
 
-all: cmu-user.ps
+all: cmu-user.pdf
 
 
 # Runs LaTeX once, then reruns LaTeX as many times as necessary to get
@@ -53,7 +53,7 @@ all: cmu-user.ps
 # been modified.
 %.dvi : %.tex $(FILES)
 	$(LATEX) $<
-	@while ( grep Rerun $*.log > /dev/null ); do \
+	@while ( grep -q "Rerun to get cross" $*.log > /dev/null ); do \
 	   $(LATEX) $<; \
 	done
 	if [ "$<" = "cmu-user.tex" ]; then $(MAKE) index; else $(MAKE) index-letter; fi
@@ -62,11 +62,11 @@ all: cmu-user.ps
 
 %.pdf : %.tex $(FILES)
 	$(PDFLATEX) $<
-	@while ( grep -v 'Package: rerunfilecheck' $*.log | grep Rerun > /dev/null ); do \
+	if [ "$<" = "cmu-user.tex" ]; then $(MAKE) index; else $(MAKE) index-letter; fi
+	@while ( grep 'Rerun to get cross' $*.log > /dev/null ); do \
 	   $(PDFLATEX) $<; \
+	   if [ "$<" = "cmu-user.tex" ]; then $(MAKE) index; else $(MAKE) index-letter; fi; \
 	done
-	if [ "$<" = "cmu-user.tex" ]; then $(MAKE) index; else $(MAKE) index-letter; fi
-	$(PDFLATEX) $<
 
 # the "-fix" option to hevea makes it run as many times as necessary
 # to resolve all cross-references and generate an index.
-- 
GitLab