docbook.am revision 6cc2b21f
1# 2# Generate output formats for a single DocBook/XML with/without chapters 3# 4# Variables set by the calling Makefile: 5# shelfdir: the location where the docs/specs are installed. Typically $(docdir) 6# docbook: the main DocBook/XML file, no chapters, appendix or image files 7# chapters: all files pulled in by an XInclude statement and images. 8# 9 10# 11# This makefile is intended for Users Documentation and Functional Specifications. 12# Do not use for Developer Documentation which is not installed and does not require olink. 13# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 14# for an explanation on documents classification. 15# 16 17# DocBook/XML generated output formats to be installed 18shelf_DATA = 19 20# DocBook/XML file with chapters, appendix and images it includes 21dist_shelf_DATA = $(docbook) $(chapters) 22 23if HAVE_XMLTO 24# 25# Generate DocBook/XML output formats with or without stylesheets 26# 27 28# Stylesheets are available if the package xorg-sgml-doctools is installed 29if HAVE_STYLESHEETS 30 31# The location where all cross reference databases are installed 32sgmldbsdir = $(XORG_SGML_PATH)/X11/dbs 33masterdb = "$(sgmldbsdir)/masterdb$(suffix $@).xml" 34XMLTO_FLAGS = \ 35 --searchpath "$(XORG_SGML_PATH)/X11" \ 36 --stringparam target.database.document=$(masterdb) \ 37 --stringparam current.docid="$(<:.xml=)" \ 38 --stringparam collect.xref.targets="no" 39 40XMLTO_XHTML_FLAGS = \ 41 -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \ 42 --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css 43 44XMLTO_FO_FLAGS = \ 45 -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl 46endif HAVE_STYLESHEETS 47 48shelf_DATA += $(docbook:.xml=.html) 49%.html: %.xml $(chapters) 50 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $< 51 52if HAVE_FOP 53shelf_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps) 54%.pdf: %.xml $(chapters) 55 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $< 56%.ps: %.xml $(chapters) 57 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $< 58endif HAVE_FOP 59 60if HAVE_XMLTO_TEXT 61shelf_DATA += $(docbook:.xml=.txt) 62%.txt: %.xml $(chapters) 63 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $< 64endif HAVE_XMLTO_TEXT 65 66# 67# Generate documents cross-reference target databases 68# 69 70# This is only possible if the xorg-sgml-doctools package is installed 71if HAVE_STYLESHEETS 72if HAVE_XSLTPROC 73 74# DocBook/XML generated document cross-reference database 75shelf_DATA += $(docbook:.xml=.html.db) $(docbook:.xml=.fo.db) 76 77# Generate DocBook/XML document cross-reference database 78# Flags for the XSL Transformation processor generating xref target databases 79XSLTPROC_FLAGS = \ 80 --path "$(XORG_SGML_PATH)/X11" \ 81 --stringparam targets.filename "$@" \ 82 --stringparam collect.xref.targets "only" \ 83 --nonet --xinclude 84 85%.html.db: %.xml $(chapters) 86 $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \ 87 http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl $< 88 89%.fo.db: %.xml $(chapters) 90 $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \ 91 http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $< 92 93endif HAVE_XSLTPROC 94endif HAVE_STYLESHEETS 95endif HAVE_XMLTO 96 97CLEANFILES = $(shelf_DATA) 98