recettes/Makefile

33 lines
692 B
Makefile

WHOLE=whole
LAST=last
SHELL:=/bin/bash
HEADER=header.tex
all: whole last
whole: $(WHOLE:=.pdf)
last: $(LAST:=.pdf)
#######
%.pdf: %.tex
latexmk -pdf $<
$(WHOLE).tex: $(HEADER) recettes/*.tex
sed 's/<>/version complète/g' $(HEADER) > $@
for recipe in recettes/*.tex; do echo -e "\t\\input{$$recipe"} >> $@; done
echo "\end{document}" >> $@
$(LAST).tex: $(HEADER) recettes/*.tex
sed 's/<>/dernière recette/g' $(HEADER) > $@
echo -e "\t\input{$$(ls -1t recettes/*.tex | head -n 1)}" >> $@
echo "\end{document}" >> $@
clean:
rm -f $(WHOLE).{tex,pdf} $(LAST).{tex,pdf} *.aux *.fdb_latexmk *.fls *.log
upload-last: last
scp $(LAST).pdf www.tobast:~/files/recettes_arcoloc.pdf