LATEX = latex PDFLATEX = pdflatex DVIPS = dvips BIBTEX = bibtex SRC := $(shell egrep -l '^[^%]*\\begin\{document\}' *.tex) DVI = $(SRC:%.tex=%.dvi) PDF = $(SRC:%.tex=%.pdf) PS = $(SRC:%.tex=%.ps) all: pdf $(DVI): %.dvi : %.tex # call two time because of toc etc @$(LATEX) $< @$(LATEX) $< $(PDF): %.pdf : %.tex # call two time because of toc etc @$(PDFLATEX) $< @$(PDFLATEX) $< dvi: $(DVI) pdf: $(PDF) clean: -rm -f $(DVI) $(PDF) $(DVI:%.dvi=%.aux) $(DVI:%.dvi=%.log) $(DVI:%.dvi=%.out) $(DVI:%.dvi=%.toc) $(DVI:%.dvi=%.nav) $(DVI:%.dvi=%.snm) -rm -f *.vrb