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