I have the following part of a Makefile
#.SILENT:
#.PHONY:
SHELL := /bin/bash
################################################################
## Colordefinition
################################################################
NO_COLOR = \x1b[0m
OK_COLOR = \x1b[32;01m
ERROR_COLOR = \x1b[31;01m
%.pdf: %.tex
NAME=`basename $< .tex` ;\
echo -e "\t$(OK_COLOR)Typesetting $$NAME$(NO_COLOR)" ;\
pdflatex -draftmode -interaction=nonstopmode $< > /dev/null ;\
if [ $$? = 0 ] ; then \
echo -e "\t$(OK_COLOR)compilation in draftmode without erros$(NO_COLOR)" ;\
pdflatex -interaction=nonstopmode $< > /dev/null ;\
if [ -e $$NAME.glo ] ; then \
echo -e "$(OK_COLOR)Typesetting $$NAME.glo$(NO_COLOR)" ;\
makeindex -s gglo.ist -o $$NAME.gls $$NAME.glo ;\
fi ;\
if [ -e $$NAME.idx ] ; then \
echo -e "$(OK_COLOR)Typesetting $$NAME.idx$(NO_COLOR)" ;\
makeinde -s gind.ist $$NAME.idx ;\
fi ;\
else \
echo -e "\t$(ERROR_COLOR)compilation in draftmode with erros$(NO_COLOR)" ;\
exit 0;\
fi ;\
echo -e "\t$(OK_COLOR)Typesetting $$NAME finished $(NO_COLOR)" ;\
The makefile doens’t work and I can’t find the error.
My goal is to type:
make test.pdf
The following example can be used for testing (test.tex):
\documentclass{article}
\begin{document}
Hello World!
\end{document}
How must the Makefile improve?
You have a superfluous space after the backslash in the line 14 (
fi ;\) directly before theelse.