2 # Generate output formats for a single DocBook/XML with/without chapters
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.
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.
17 # DocBook/XML generated output formats to be installed
20 # DocBook/XML file with chapters, appendix and images it includes
21 dist_shelf_DATA = $(docbook) $(chapters)
26 XMLTO_SEARCHPATH_FLAGS = \
27 --searchpath "$(XORG_SGML_PATH)/X11" \
28 --searchpath "$(abs_top_builddir)"
29 XMLTO_HTML_OLINK_FLAGS = \
30 --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
31 --stringparam current.docid="$(<:.xml=)"
32 XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
34 $(XMLTO_SEARCHPATH_FLAGS) \
35 $(XMLTO_HTML_STYLESHEET_FLAGS) \
36 $(XMLTO_HTML_OLINK_FLAGS)
38 shelf_DATA += $(docbook:.xml=.html)
39 %.html: %.xml $(chapters)
40 $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
44 shelf_DATA += $(docbook:.xml=.txt)
45 %.txt: %.xml $(chapters)
46 $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
50 XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
51 XMLTO_PDF_OLINK_FLAGS = \
52 --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
53 --stringparam current.docid="$(<:.xml=)"
54 XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
57 $(XMLTO_SEARCHPATH_FLAGS) \
58 $(XMLTO_FO_STYLESHEET_FLAGS) \
59 $(XMLTO_FO_IMAGEPATH_FLAGS) \
60 $(XMLTO_PDF_OLINK_FLAGS)
62 shelf_DATA += $(docbook:.xml=.pdf)
63 %.pdf: %.xml $(chapters)
64 $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
66 shelf_DATA += $(docbook:.xml=.ps)
67 %.ps: %.xml $(chapters)
68 $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
71 # Generate documents cross-reference target databases
74 XSLT_SEARCHPATH_FLAGS = \
75 --path "$(XORG_SGML_PATH)/X11" \
76 --path "$(abs_top_builddir)"
78 --stringparam targets.filename "$@" \
79 --stringparam collect.xref.targets "only" \
80 --stringparam olink.base.uri "$(@:.db=)"
83 $(XSLT_SEARCHPATH_FLAGS) \
86 $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
88 $(XSLT_SEARCHPATH_FLAGS) \
91 $(STYLESHEET_SRCDIR)/xorg-fo.xsl
93 shelf_DATA += $(docbook:.xml=.html.db)
94 %.html.db: %.xml $(chapters)
95 $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
97 shelf_DATA += $(docbook:.xml=.pdf.db)
98 %.pdf.db: %.xml $(chapters)
99 $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
102 endif HAVE_STYLESHEETS
105 CLEANFILES = $(shelf_DATA)