# 8 October 2000 Nick Urbanik # Some ideas in this Makefile are based on an old makefile from CTAN # called make_latex by David Beasley December 1992 # But don't call David if you find mistakes--tell Nick! BIBTEX = bibtex LATEX = latex PDFLATEX = pdflatex SED = /bin/sed # Pattern(s) to match for old versions of files to be deleted by 'make clean' OLDVERSIONS = *~ *.fig.bak TIDYFILES = $(FILES:%=%.out) $(FILES:%=%.toc) # names of all DVI files DVIFILES = $(FILES:%=%.dvi) PDFFILES = $(FILES:%=%.pdf) # assume that all dvi files named depend on all bib files named $(FILES:%=%.bbl) : $(BIBFILES) # create all dvi files all: $(DVIFILES) $(PDFFILES) dvi: $(DVIFILES) # ensure that the bbl file gets regenerated if the bib file is changed %.bbl : $(BIBFILES) @# if there is no aux file, skip this, it will get done later -@if [ -r $*.aux ] ;\ then $(BIBTEX) $* ; \ fi # create a dvi file from a tex file # % %.dvi: %.tex %.dvi: %.tex $(LATEX) $* -@egrep -c 'Citation .* undefined.' $*.log && ($(BIBTEX) $*;$(LATEX) $*) -@grep 'Rerun to get cross-references right' $*.log && $(LATEX) $* -@egrep -c 'Citation .* undefined.' $*.log && ($(BIBTEX) $*;$(LATEX) $*) -@grep 'Rerun to get cross-references right' $*.log && $(LATEX) $* -@egrep -c 'Citation .* undefined.' $*.log && ($(BIBTEX) $*;$(LATEX) $*) -@grep 'Rerun to get cross-references right' $*.log && $(LATEX) $* # create a pdf file from a tex file # % %.dvi: %.tex %.pdf: %.tex $(PDFLATEX) $* -@egrep -c 'Citation .* undefined.' $*.log && ($(BIBTEX) $*;$(PDFLATEX) $*) -@grep 'Rerun to get cross-references right' $*.log && $(PDFLATEX) $* -@egrep -c 'Citation .* undefined.' $*.log && ($(BIBTEX) $*;$(PDFLATEX) $*) -@grep 'Rerun to get cross-references right' $*.log && $(PDFLATEX) $* -@egrep -c 'Citation .* undefined.' $*.log && ($(BIBTEX) $*;$(PDFLATEX) $*) -@grep 'Rerun to get cross-references right' $*.log && $(PDFLATEX) $* # delete all files which can easily be regenerated tidy: -rm -f $(DVIFILES) $(TIDYFILES) -rm -f $(FILES:%=%.ps) $(FILES:%=%.log) $(FILES:%=%.blg) # delete all files which can be regenerated clean: tidy -rm -f $(FILES:%=%.aux) $(FILES:%=%.bbl) $(CLEANFILES) $(FILES:%=%.pdf) @# delete editor old-version files -rm -f $(OLDVERSIONS)