Add docbook support for automatic documentation regeneration
[hvgrip.git] / doc / Makefile.am
index ca3e3e7..c61b67f 100644 (file)
@@ -1,11 +1,33 @@
 SUBDIRS = images
 
+XSLTPROC=xsltproc
+XSLTPROC_FLAGS=
+XHTML_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"
+#XHTML_STYLESHEET="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"
+XML_CATALOG_FILES=/etc/xml/catalog
+
 @PACKAGE@_helpdir = $(docdir)
 
 @PACKAGE@_help_DATA =  \
         @PACKAGE@.html \
         @PACKAGE@.xml
 
+if have_docbook
+
+@PACKAGE@.html: ${top_srcdir}/doc/@PACKAGE@.xml
+       XML_CATALOG_FILES=$(XML_CATALOG_FILES) $(XSLTPROC) $(XSLTPROC_FLAGS) -o $@ $(XHTML_STYLESHEET) $<
+
+##.xml.html:
+# XSLTPROC_OPTS=/usr/share/xml/docbook/xsl-stylesheets-/xhtml/docbook.xsl
+###    $(XSLTPROC) --output $@ --nonet $(docbook_styles)/docbook.xsl $<
+
+else
+
+@PACKAGE@.html:
+        touch $@
+
+endif
+
 EXTRA_DIST =           \
        @PACKAGE@.html  \
        @PACKAGE@.xml