2013-01-31 17:09:26 +01:00
|
|
|
SRC := $(wildcard *.tex)
|
|
|
|
OBJPDF := $(SRC:tex=pdf)
|
|
|
|
RM := rm --force
|
|
|
|
TEXPDFPRG := xelatex
|
2018-12-20 15:24:02 +01:00
|
|
|
TEXPDFOPT := -file-line-error -shell-escape
|
2013-01-31 17:09:26 +01:00
|
|
|
DATE := `date +'%d%m%Y-%H%M%S'`
|
|
|
|
BUILDLOG := build-messages-$(DATE).txt
|
|
|
|
LATEXBUILD := $(TEXPDFPRG) $(TEXPDFOPT)
|
|
|
|
|
|
|
|
define latexbuild
|
2013-05-24 23:36:17 +02:00
|
|
|
@echo "Rerun to get cross-references" > `basename $1.log`
|
|
|
|
@while [ `grep -c "Rerun to get cross-references" \`basename $1.log\`` -ne 0 ] ; \
|
2013-01-31 17:09:26 +01:00
|
|
|
do \
|
|
|
|
echo $(TEXPDFPRG) $(TEXPDFOPT) $2 ; \
|
|
|
|
if ! $(TEXPDFPRG) $(TEXPDFOPT) $2 | tee -a ./$(BUILDLOG) ; then \
|
|
|
|
cat $*.log ; \
|
|
|
|
rm $@ > /dev/null 2>&1 ; \
|
|
|
|
echo "ret: $?" ; \
|
|
|
|
exit 255 ; \
|
|
|
|
fi ; \
|
|
|
|
done
|
|
|
|
endef
|
|
|
|
|
|
|
|
all: $(OBJPDF)
|
|
|
|
|
|
|
|
%.pdf: %.tex
|
|
|
|
$(call latexbuild, $*, $< )
|
2013-05-25 18:19:17 +02:00
|
|
|
$(call latexbuild, $*, $< )
|
2013-01-31 17:09:26 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) *.aux
|
|
|
|
$(RM) *.d
|
|
|
|
$(RM) *.log
|
|
|
|
$(RM) *.nav
|
|
|
|
$(RM) *.out
|
|
|
|
$(RM) *.snm
|
|
|
|
$(RM) *.toc
|
|
|
|
|
|
|
|
fclean: clean
|
|
|
|
$(RM) $(OBJPDF)
|
|
|
|
$(RM) *.txt
|
|
|
|
|
|
|
|
re: fclean all
|