TARGET = paper TARGETLIST = $(TARGET).pdf INTERMEDIATES = $(TARGET).dvi all: $(TARGETLIST) OPT = -file-line-error-style -interaction=nonstopmode .SILENT: define run-latex @echo " - Producing $@ from" $< latex $(OPT) $< > /dev/null latex $(OPT) $< > /dev/null (latex $(OPT) $< ) endef #define run-latex # @echo " - Producing $@ from" $< # ! (latex $(OPT) $< | grep -E \.tex:[0-9]*:\ ) # bibtex --terse $(<:.tex=) # latex $(OPT) $< > /dev/null # latex $(OPT) $< > /dev/null # ! (latex $(OPT) $< | grep ^LaTeX\ Warning:\ ) #endef %.dvi: %.dtx $(run-latex) %.dvi: %.tex %.bib $(run-latex) %.ps: %.dvi @echo " - Producing $@ from" $< dvips -q $< $@~ && mv $@~ $@ %.pdf: %.dvi @echo " - Producing $@ from" $< dvipdf -q $< $@~ && mv $@~ $@ %: %.dvi @echo " - Producing $@.pdf from" $< dvipdf -q $< %.ps.gz: %.ps @echo " - Producing booklet $@ from" $< psbook -q $< | psnup -q -2 | pstops -q 2:0,1VH | gzip -c -9 > $@ %.bdf: %.ps.gz @echo " - Producing booklet $@ from" $< gzip -cd $< | ps2pdf - $@ clean: @rm -f $(INTERMEDIATES) $(TARGETLIST) *.dvi *.aux *.blg *.lof *.log *.lot *.toc *.bbl *.bdf mrproper: clean @rm -f *~