In the process of writing 420 final reports, SamJansen and Tom Young worked to create some makefiles useful for Latex projects. Latex and Bibtex have some strange properties which makes writing makefiles for them an interesting challenge. This page is currently a work in progress.
TEX=report TARGET=report
.PHONY: clean debug gvshow pdfshow acroshow dvishow LATEX_ARGS=--interaction batchmode LATEX=latex
$(TARGET).ps: $(TARGET).dvi
dvips $(TARGET) -o $(TARGET).ps
$(TARGET).pdf: $(TEX).tex
pdflatex $(LATEX_ARGS) $(TEX)
$(TARGET).dvi: $(TEX).tex
$(LATEX) $(LATEX_ARGS) $(TEX) @mv $(TEX).dvi $(TARGET).dvi
rm *.toc *.aux *.pdf *.ps *.eps *.log *.tex *.lof *.bib *.bbl *.blg *.dvi
latex $(TEX)
gvshow: $(TARGET).ps
gv $(TARGET).ps
pdfshow: $(TARGET).pdf
xpdf $(TARGET).pdf
acroshow: $(TARGET).pdf
acroread $(TARGET).pdf
dvishow: $(TARGET).dvi
xdvi $(TARGET).dvi
Probably the most interesting thing about the above makefile is that it uses --interaction batchmode as an argument to Latex. The rest is a fairly standard makefile. Things get a little more complex when Bibtex and automatic image conversion is added to the makefiles.
4 pages link to LatexMakefiles: