# A template Makefile. Clone and own. # see these links: # http://geosoft.no/development/javamake.html # http://www.cs.swarthmore.edu/~newhall/unixhelp/javamakefiles.html .SUFFIXES: .pdf .tex .dot .bib .PHONY : clean TEX = $(shell find . -type f -name '*.tex' | sort) DOT = $(shell find . -type f -name '*.dot' | sort) BIB = $(shell find . -type f -name '*.bib' | sort) #INC = $(shell find -name '*.tex' | xargs grep 'includegraphics.*{.*}' | sed -e 's/.*{//' -e 's/}.*//') main.pdf: $(TEX) $(DOT) $(BIB) pdflatex -interaction=batchmode main.tex @if [ `grep -c bibdata main.aux` -gt 0 ] ; then bibtex -min-crossrefs=9000 main ; else echo "not running bibtex"; fi pdflatex -interaction=batchmode main.tex @# pipe to cat so the exit code is 0 even if no lines selected @# grep usually exits with 1 if no lines selected @# non-zero exits cause Make to terminate with an error @grep 'LaTeX Warning:' main.log | grep -v 'Marginpar.*moved' | cat @grep 'Output written' main.log | cat clean: rm -rf *.aux *.bak *.bbl *.blg *.brf *.drv *.dvi *.glo *.gls *.idx *.ilg *.ind *.lof *.lot *.log *.nav *.nlo *.out *.snm *.tdo *.toc *.vrb rm -f main.pdf