rst=rst
latex=latex
html=html
rstopts= --section-subtitles --language=es
latexopts=--use-latex-footnotes --use-latex-citations --use-latex-docinfo \
--use-latex-toc --documentclass=book --use-verbatim-when-possible
htmlopts=--footnote-references=superscript --cloak-email-addresses
docname=propuesta
targets=$(docname).pdf $(docname).$(html)
all: $(targets) clean-tmp
$(docname).$(latex): $(docname).$(rst)
@echo "Generando $@..."
@rst2latex $(rstopts) $(latexopts) "$(basename $@).$(rst)" > "$@"
$(docname).$(html): $(docname).$(rst)
@echo "Generando $@..."
@rst2html $(rstopts) $(htmlopts) "$(basename $@).$(rst)" > "$@"
$(docname).pdf: $(docname).$(latex)
@echo "Generando $@..."
@pdflatex "$(basename $@).$(latex)" > /dev/null
@pdflatex "$(basename $@).$(latex)" > /dev/null
clean-tmp:
@$(RM) $(docname).aux $(docname).out $(docname).log
@$(RM) $(docname).toc texput.log
clean: clean-tmp
@$(RM) -fv $(targets) $(docname).latex
.PHONY: clean all