Browse Source

[trac3520] add a "make pdf" target in the doc/guide directory

If dblatex is detected at configure time, the guide and log messages
documentation can be made in PDF format.
Jeremy C. Reed 10 years ago
parent
commit
22c1fc6faf
2 changed files with 29 additions and 3 deletions
  1. 3 0
      configure.ac
  2. 26 3
      doc/guide/Makefile.am

+ 3 - 0
configure.ac

@@ -1293,6 +1293,9 @@ if test "x$enable_generate_docs" != xno ; then
   fi
   fi
 fi
 fi
 
 
+# Don't fail here if not found, used to generate PDF documentation.
+AC_PATH_PROG([DBLATEX], [dblatex])
+AM_CONDITIONAL(HAVE_DBLATEX, test "x$DBLATEX" != "x")
 
 
 AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
 AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
 
 

+ 26 - 3
doc/guide/Makefile.am

@@ -12,6 +12,9 @@ DOCBOOK += libdhcp.xml
 EXTRA_DIST = $(DOCBOOK)
 EXTRA_DIST = $(DOCBOOK)
 DISTCLEANFILES = $(HTMLDOCS) $(DOCS) kea-messages.xml
 DISTCLEANFILES = $(HTMLDOCS) $(DOCS) kea-messages.xml
 
 
+kea-messages.xml:
+	$(PYTHON) $(top_srcdir)/tools/system_messages.py -o $@ $(top_srcdir)
+
 # This is not a "man" manual, but reuse this for now for docbook.
 # This is not a "man" manual, but reuse this for now for docbook.
 if GENERATE_DOCS
 if GENERATE_DOCS
 
 
@@ -36,13 +39,33 @@ kea-messages.html: kea-messages.xml
 		http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
 		http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
 		kea-messages.xml
 		kea-messages.xml
 
 
-kea-messages.xml:
-	$(PYTHON) $(top_srcdir)/tools/system_messages.py -o $@ $(top_srcdir)
-
 else
 else
 
 
 $(HTMLDOCS) $(DOCS):
 $(HTMLDOCS) $(DOCS):
 	@echo Doc generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
 	@echo Doc generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
 	@echo Doc generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild Kea > $@
 	@echo Doc generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild Kea > $@
 
 
+endif 
+
+if HAVE_DBLATEX
+
+CLEANFILES = kea-guide.pdf kea-messages.pdf
+
+DBLATEX_FLAGS = --xslt-opts=--path --xslt-opts=$(abs_top_builddir)/doc \
+	-P doc.collab.show=0 -P latex.output.revhistory=0 \
+	--param=term.breakline=1
+
+pdf: kea-guide.pdf kea-messages.pdf
+
+kea-guide.pdf: $(DOCBOOK)
+	@DBLATEX@ $(DBLATEX_FLAGS) kea-guide.xml
+
+kea-messages.pdf: kea-messages.xml
+	@DBLATEX@ $(DBLATEX_FLAGS) kea-messages.xml
+
+else
+
+pdf kea-guide.pdf kea-messages.pdf:
+	@echo Install dblatex tool and rerun ./configure to be able to generate documentation in PDF format.
+
 endif
 endif