efrei/theorie-graphes/Makefile

34 lines
817 B
Makefile

filename=$(shell basename $(shell pwd))
timestamp=$(shell date +%Y-%m-%d_%H:%M)
all: snapshot exercice dm1
exercice: exercice.tex
@latexmk -pdf exercice.tex
@if ! cmp --silent build/exercice.pdf exercice_*.pdf; then \
touch exercice_tmp.pdf; \
rm exercice*.pdf; \
cp build/exercice.pdf exercice_${timestamp}.pdf; \
echo "Updated"; \
fi
dm1: dm1.tex
@latexmk -pdf dm1.tex
@if ! cmp --silent build/dm1.pdf dm1_*.pdf; then \
touch dm1_tmp.pdf; \
rm dm1*.pdf; \
cp build/dm1.pdf dm1_${timestamp}.pdf; \
echo "Updated"; \
fi
snapshot: main.tex
@latexmk -pdf main.tex
@if ! cmp --silent build/main.pdf ${filename}_*.pdf; then \
touch ${filename}_tmp.pdf; \
rm ${filename}*.pdf; \
cp build/main.pdf ${filename}_${timestamp}.pdf; \
echo "Updated"; \
fi
clean:
@rm -rf build 2>/dev/null