timestamp=$(shell date +%Y-%m-%d_%H:%M) texfile20210922=contrat-independant-romance-martin texfile20210927=clause-remuneration all: 20210922 20210927 20210922: contrat-independant-romance-martin.tex @latexmk -pdf ${texfile20210922}.tex @if ! cmp --silent build/${texfile20210922}.pdf ${texfile20210922}_*.pdf; then \ touch ${texfile20210922}_tmp.pdf; \ rm ${texfile20210922}*.pdf; \ cp build/${texfile20210922}.pdf ${texfile20210922}_${timestamp}.pdf; \ echo "Updated"; \ fi 20210927: clause-remuneration.tex @latexmk -pdf ${texfile20210927}.tex @if ! cmp --silent build/${texfile20210927}.pdf ${texfile20210927}_*.pdf; then \ touch ${texfile20210927}_tmp.pdf; \ rm ${texfile20210927}*.pdf; \ cp build/${texfile20210927}.pdf ${texfile20210927}_${timestamp}.pdf; \ echo "Updated"; \ fi clean: @rm -rf build 2>/dev/null