SOURCES = $(wildcard *.tex) PNGS = $(SOURCES:.tex=.png) PDFS = $(SOURCES:.tex=.pdf) png: $(PNGS) pdf: $(PDFS) %.pdf: %.tex pdflatex $< rm $(<:.tex=.aux) $(<:.tex=.log) %.png: %.pdf convert -density 600 $< -flatten $@ .PHONY: clean clean: rm -rf auto *.aux *.log *.synctex.gz .PHONY: cleanall cleanall: clean rm -rf *.png *.pdf