I recently started using autoconf and automake for a project I'm working on. Project documentation is written in LaTeX. Since I don't want LaTeX to be dependent, I want to check for the pdflatex binary file using autoconf and then use this information in Makefile.am to decide whether to simply copy the .tex file to the documentation directory or to create a PDF file and copy it both of them.
This is the corresponding section in the configure.ac file:
# Check for presence of pdfLaTeX AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex) if test -z "$PDFLATEX"; then AC_MSG_WARN([Unable to create PDF version of the user manual.]) fi AM_CONDITIONAL([HAVE_PDFLATEX], test -n "$PDFLATEX")
In the doc / directory, I have the following Makefile.am:
docfiles = manual.tex QuickStart.txt if HAVE_PDFLATEX docfiles += manual.pdf MANNAME = manual MANTEXSRC = $(MANNAME).tex MANAUX = $(MANNAME).aux MANPDF = $(MANNAME).pdf CLEANFILES = $(MANPDF) $(MANNAME).log $(MANNAME).idx $(MANNAME).out \ $(MANNAME).toc $(MANAUX) $(MANPDF): $(srcdir)/$(MANTEXSRC) $(PDFLATEX) $< endif dist_doc_DATA = $(docfiles)
This setting works when pdflatex is present, but when it does not work, make make works, but make distcheck asks how to create the PDF file:
make[1]: *** No rule to make target `manual.pdf', needed by `distdir'. Stop.
Looking at the makefile generated by automake, I see:
and then I find:
docfiles = manual.tex QuickStart.txt $(am__append_1)
What am I missing here?
source share