targets := $(patsubst %.tex,%.pdf,$(wildcard *.tex)) all: $(targets) %.pdf : %.tex %/*.tex pdflatex $< clean: rm -f *.aux *.log *.pdf