# This makefile was created by Peter Harvey to compile LaTeX papers # and slides. # # We assume that all diagrams are used in both paper and slides. # This is most likely not the case, but it's easy to change this # makefile so that it is the case. # List all original PDF or EPS diagrams here. PDF_FIGURES := EPS_FIGURES := # List all Dia diagrams, and then generate their .eps and .pdf results. DIA_FIGURES := PDF_FIGURES := $(PDF_FIGURES) $(addsuffix .pdf, $(basename $(DIA_FIGURES))) EPS_FIGURES := $(EPS_FIGURES) $(addsuffix .eps, $(basename $(DIA_FIGURES))) # List all the default targets TARGETS := paper.pdf paper.ps slides.pdf slides.ps all: $(TARGETS) clean: rm -f *~ *.bak *.log *.lg *.tmp *.xref *.dvi *.idv *.4ct *.4tc *.aux *.bbl *.blg rm -f $(addsuffix .pdf, $(basename $(DIA_FIGURES))) $(addsuffix .eps, $(basename $(DIA_FIGURES))) realclean: clean rm -f $(TARGETS) paper.pdf: $(PDF_FIGURES) paper.dvi: $(EPS_FIGURES) slides.pdf: $(PDF_FIGURES) slides.dvi: $(EPS_FIGURES) # Custom dvips line to ensure that landscape mode is handled properly slides.ps: slides.dvi dvips -t landscape -o slides.ps slides.dvi # If we have no bibfile, then create one to stop any whinging bibfile.bib : touch bibfile.bib %.dvi : %.tex %.eps : %.dia dia $< --nosplash -e $@ %.pdf : %.eps epstopdf $*.eps %.aux : %.tex @latex $*.tex # Long and complicated stuff to generate the PDF without any missing references %.pdf : %.tex bibfile.bib @-pdflatex --interaction batchmode $*.tex @-bibtex $* @-rm -f $*.blg $*.log @-until [ -f $*.log ] && [ -z "`grep '$LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.' $*.log`" ]; do pdflatex --interaction batchmode $*.tex ; done @-sed -n -e '/^LaTeX[^:]*Error:/,/\.$$/p' $*.log @-sed -n -e '/^LaTeX[^:]*Warning:/,/\.$$/p' $*.log @-sed -n -e '/^! /p' -e '/^l\.[0-9]*/,/^$$/p' $*.log @-rm -f $*.aux $*.bbl $*.out # Long and complicated stuff to generate the DVI without any missing references %.dvi : %.tex bibfile.bib @-latex --interaction batchmode $*.tex @-bibtex $* @-rm -f $*.blg $*.log @-until [ -f $*.log ] && [ -z "`grep '$LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.' $*.log`" ]; do latex --interaction batchmode $*.tex ; done @-sed -n -e '/^LaTeX[^:]*Error:/,/\.$$/p' $*.log @-sed -n -e '/^LaTeX[^:]*Warning:/,/\.$$/p' $*.log @-sed -n -e '/^! /p' -e '/^l\.[0-9]*/,/^$$/p' $*.log @-rm -f $*.aux $*.bbl %.ps : %.dvi @dvips -o $*.ps $*.dvi 2>/dev/null %2.ps : %.ps @psnup -2 -r $*.ps $*2.ps %4.ps : %.ps @psnup -4 -r $*.ps $*4.ps %9.ps : %.ps @psnup -9 -r $*.ps $*9.ps %16.ps : %.ps @psnup -16 -r $*.ps $*16.ps