Generate pdf file by default.
authorRaymond Toy <toy.raymond@gmail.com>
Thu, 17 Jan 2013 04:45:42 +0000 (20:45 -0800)
committerRaymond Toy <toy.raymond@gmail.com>
Thu, 17 Jan 2013 04:45:42 +0000 (20:45 -0800)
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

index 4a3e345..25924ef 100644 (file)
@@ -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.