Author: dylan
Date: 2004-08-07 19:28:16 -0400 (Sat, 07 Aug 2004)
New Revision: 338

Modified:
   branches/protocol-v4/docs/manual/Makefile
   branches/protocol-v4/docs/manual/buildlatex
   branches/protocol-v4/docs/manual/config.m4
Log:
Okay, the document compiles now.
Updated Makefile and removed LINKS option
in the config.m4 file.

Added sanity check to buildlatex, so we
won't try more than six times to re-run latex.


Modified: branches/protocol-v4/docs/manual/Makefile
===================================================================
--- branches/protocol-v4/docs/manual/Makefile   2004-08-07 23:13:49 UTC (rev 
337)
+++ branches/protocol-v4/docs/manual/Makefile   2004-08-07 23:28:16 UTC (rev 
338)
@@ -1,6 +1,6 @@
 
-export RERUN=Rerun to get cross-references right
 
+
 clean=-name '*.aux' \
          -or -name '*.log' \
          -or -name '*.bbl' \
@@ -8,13 +8,11 @@
          -or -name '*.toc' \
          -or -name 'config.tex'
 base=haver
-tex=$(wildcard chap/*.tex) $(filter-out haver.tex,$(wildcard *.tex)) haver.bib
+tex=$(wildcard chap/*.tex) $(filter-out haver.tex,$(wildcard *.tex)) haver.bib 
config.m4
 
-have=
-defhave=$(patsubst %,-D %,$(have))
 
 ifdef DRAFT
-have += DRAFT
+ARGS += -f DRAFT
 endif
 
 all:
@@ -36,26 +34,14 @@
        -rm $(base).dvi $(base).pdf
 
 
-$(base).dvi: have += DVI
 $(base).dvi: $(base).tex $(tex)
-       m4 $(defhave) config.m4 > config.tex
-       latex $<
-       bibtex $(base)
-       latex $<
-       latex $<
-       
+       ./buildlatex -f PDF $(ARGS) $<
 
 
-$(base).pdf: have += PDF
 $(base).pdf: $(base).tex $(tex)
-       m4 $(defhave) config.m4 > config.tex
-       pdflatex $<
-       bibtex $(base)
-       pdflatex $<
-       pdflatex $<
+       ./buildlatex -f DVI $(ARGS) -l pdflatex $<
 
-$(base)/$(base).html: have += HTML
-$(base)/$(base).html: $(base).tex $(tex)
-       latex2html -local_icons -split 3   $<
+#$(base)/$(base).html: $(base).tex $(tex)
+#      latex2html -local_icons -split 3   $<
 
 .PHONY: all clean dvi

Modified: branches/protocol-v4/docs/manual/buildlatex
===================================================================
--- branches/protocol-v4/docs/manual/buildlatex 2004-08-07 23:13:49 UTC (rev 
337)
+++ branches/protocol-v4/docs/manual/buildlatex 2004-08-07 23:28:16 UTC (rev 
338)
@@ -4,21 +4,23 @@
 use Getopt::Long;
 use File::Basename;
 
+use constant RERUN_MAX => 6;
 sub spoon (&);
 
 my ($latex, @feature, %define, $config, $texfile);
 $latex     = "latex";
 $config    = "config.m4";
-$texfile   = shift or die "Usage: $0 [options] file\n";
 
 Getopt::Long::Configure('gnu_getopt');
 GetOptions(
-       'latex|l=s' => $latex,
+       'latex|l=s' => \$latex,
        'feature|have|f=s' => [EMAIL PROTECTED],
        'define|d|D=s' => \%define,
        'config|c=s'   => \$config,
 );
 
+$texfile   = shift or die "Usage: $0 [options] file\n";
+
 my $code = spoon {
        open STDOUT, ">config.tex" or die "$0: can't open config.tex: $!";
        my @args;
@@ -37,8 +39,9 @@
 
 if (defined $code and $code == 0) {
        my $rerun = 0;
+       my $count = 0;
 
-       do {
+       do { $count++;
                my $pipe;
                my $pid = open $pipe, '-|', $latex, $texfile or die "Can't 
start $latex: $!\n";
                $rerun = 0;
@@ -58,6 +61,11 @@
                        }
                }
                close $pipe;
+
+               if ($count > RERUN_MAX) {
+                       die "RERUN_MAX reached, bailing out!";
+               }
+               
        } while $rerun;
        
 } else {

Modified: branches/protocol-v4/docs/manual/config.m4
===================================================================
--- branches/protocol-v4/docs/manual/config.m4  2004-08-07 23:13:49 UTC (rev 
337)
+++ branches/protocol-v4/docs/manual/config.m4  2004-08-07 23:28:16 UTC (rev 
338)
@@ -4,5 +4,4 @@
 
 have(`COLOR')
 have(`DRAFT')
-have(`LINKS')
 have(`PDF')


Reply via email to