29 lines
539 B
Makefile
29 lines
539 B
Makefile
WHOLE=whole
|
|
LAST=last
|
|
|
|
HEADER=header.tex
|
|
|
|
all: whole last
|
|
|
|
whole: $(WHOLE:=.pdf)
|
|
|
|
last: $(LAST:=.pdf)
|
|
|
|
#######
|
|
|
|
%.pdf: %.tex
|
|
latexmk -pdf $<
|
|
|
|
$(WHOLE).tex: $(HEADER) recettes/*.tex
|
|
cp $(HEADER) $@
|
|
for recipe in recettes/*.tex; do echo -e "\t\\input{$$recipe"} >> $@; done
|
|
echo "\end{document}" >> $@
|
|
|
|
$(LAST).tex: $(HEADER) recettes/*.tex
|
|
cp $(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
|