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 #
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 #
17 # DocBook/XML generated output formats to be installed
18 shelf_DATA =
20 # DocBook/XML file with chapters, appendix and images it includes
21 dist_shelf_DATA = $(docbook) $(chapters)
23 if HAVE_XMLTO
24 #
25 # Generate DocBook/XML output formats with or without stylesheets
26 #
28 # Stylesheets are available if the package xorg-sgml-doctools is installed
29 if HAVE_STYLESHEETS
31 # The location where all cross reference databases are installed
32 sgmldbsdir = $(XORG_SGML_PATH)/X11/dbs
33 masterdb = "$(sgmldbsdir)/masterdb$(suffix $@).xml"
34 XMLTO_FLAGS = \
35 --searchpath "$(XORG_SGML_PATH)/X11" \
36 --searchpath "$(abs_top_builddir)" \
37 --stringparam target.database.document=$(masterdb) \
38 --stringparam current.docid="$(<:.xml=)" \
39 --stringparam collect.xref.targets="no"
41 XMLTO_XHTML_FLAGS = \
42 -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \
43 --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
45 XMLTO_FO_FLAGS = \
46 -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
47 endif HAVE_STYLESHEETS
49 shelf_DATA += $(docbook:.xml=.html)
50 %.html: %.xml $(chapters)
51 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $<
53 if HAVE_FOP
54 shelf_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
55 %.pdf: %.xml $(chapters)
56 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $<
57 %.ps: %.xml $(chapters)
58 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $<
59 endif HAVE_FOP
61 if HAVE_XMLTO_TEXT
62 shelf_DATA += $(docbook:.xml=.txt)
63 %.txt: %.xml $(chapters)
64 $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $<
65 endif HAVE_XMLTO_TEXT
67 #
68 # Generate documents cross-reference target databases
69 #
71 # This is only possible if the xorg-sgml-doctools package is installed
72 if HAVE_STYLESHEETS
73 if HAVE_XSLTPROC
75 # DocBook/XML generated document cross-reference database
76 shelf_DATA += $(docbook:.xml=.html.db) $(docbook:.xml=.fo.db)
78 # Generate DocBook/XML document cross-reference database
79 # Flags for the XSL Transformation processor generating xref target databases
80 XSLTPROC_FLAGS = \
81 --path "$(XORG_SGML_PATH)/X11" \
82 --path "$(abs_top_builddir)" \
83 --stringparam targets.filename "$@" \
84 --stringparam collect.xref.targets "only" \
85 --nonet --xinclude
87 %.html.db: %.xml $(chapters)
88 $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \
89 http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl $<
91 %.fo.db: %.xml $(chapters)
92 $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \
93 http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $<
95 endif HAVE_XSLTPROC
96 endif HAVE_STYLESHEETS
97 endif HAVE_XMLTO
99 CLEANFILES = $(shelf_DATA)