ALL := $(shell find src/ -type f | sed -e 's/src/build/g;s/tex/pdf/g') all: $(ALL) build/%.pdf: src/%.tex mkdir -p $(shell dirname $@) rm -rf .tmp mkdir .tmp cp $< .tmp/input.tex cd .tmp ; pdflatex input.tex cp .tmp/input.pdf $@ clean: rm -rf build