timestamp=$(shell date +%Y-%m-%d_%H:%M) all: td1 td1: td1.tex @latexmk -pdf td1.tex @if ! cmp --silent build/td1.pdf td1_*.pdf; then \ touch td1_tmp.pdf; \ rm td1*.pdf; \ cp build/td1.pdf td1_${timestamp}.pdf; \ echo "Updated"; \ fi clean: @rm -rf build 2>/dev/null