1972599cfSmrg#
2972599cfSmrg# Generate output formats for a single DocBook/XML with/without chapters
3972599cfSmrg#
4972599cfSmrg# Variables set by the calling Makefile:
5972599cfSmrg# shelfdir: the location where the docs/specs are installed. Typically $(docdir)
6972599cfSmrg# docbook:  the main DocBook/XML file, no chapters, appendix or image files
7972599cfSmrg# chapters: all files pulled in by an XInclude statement and images.
8972599cfSmrg#
9972599cfSmrg
10972599cfSmrg#
11972599cfSmrg# This makefile is intended for Users Documentation and Functional Specifications.
12972599cfSmrg# Do not use for Developer Documentation which is not installed and does not require olink.
13972599cfSmrg# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
14972599cfSmrg# for an explanation on documents classification.
15972599cfSmrg#
16972599cfSmrg
17972599cfSmrg# DocBook/XML generated output formats to be installed
18972599cfSmrgshelf_DATA =
19972599cfSmrg
20972599cfSmrg# DocBook/XML file with chapters, appendix and images it includes
21972599cfSmrgdist_shelf_DATA = $(docbook) $(chapters)
22972599cfSmrg
23972599cfSmrgif HAVE_XMLTO
24972599cfSmrgif HAVE_STYLESHEETS
25972599cfSmrg
26972599cfSmrgXMLTO_SEARCHPATH_FLAGS = 				\
27972599cfSmrg	--searchpath "$(XORG_SGML_PATH)/X11" 		\
28972599cfSmrg	--searchpath "$(abs_top_builddir)"
29972599cfSmrgXMLTO_HTML_OLINK_FLAGS = \
30972599cfSmrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
31972599cfSmrg	--stringparam current.docid="$(<:.xml=)"
32972599cfSmrgXMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
33972599cfSmrgXMLTO_HTML_FLAGS = 					\
34972599cfSmrg	$(XMLTO_SEARCHPATH_FLAGS)			\
35972599cfSmrg	$(XMLTO_HTML_STYLESHEET_FLAGS)			\
36972599cfSmrg	$(XMLTO_HTML_OLINK_FLAGS)
37972599cfSmrg
38972599cfSmrgshelf_DATA += $(docbook:.xml=.html)
39972599cfSmrg%.html: %.xml $(chapters)
40972599cfSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
41972599cfSmrg
42972599cfSmrgif HAVE_XMLTO_TEXT
43972599cfSmrg
44972599cfSmrgshelf_DATA += $(docbook:.xml=.txt)
45972599cfSmrg%.txt: %.xml $(chapters)
46972599cfSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
47972599cfSmrgendif HAVE_XMLTO_TEXT
48972599cfSmrg
49972599cfSmrgif HAVE_FOP
50972599cfSmrgXMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
51972599cfSmrgXMLTO_PDF_OLINK_FLAGS = \
52972599cfSmrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
53972599cfSmrg	--stringparam current.docid="$(<:.xml=)"
54972599cfSmrgXMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
55972599cfSmrg
56972599cfSmrgXMLTO_FO_FLAGS = 					\
57972599cfSmrg	$(XMLTO_SEARCHPATH_FLAGS)			\
58972599cfSmrg	$(XMLTO_FO_STYLESHEET_FLAGS)			\
59972599cfSmrg	$(XMLTO_FO_IMAGEPATH_FLAGS)			\
60972599cfSmrg	$(XMLTO_PDF_OLINK_FLAGS)
61972599cfSmrg
62972599cfSmrgshelf_DATA += $(docbook:.xml=.pdf)
63972599cfSmrg%.pdf: %.xml $(chapters)
64972599cfSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
65972599cfSmrg
66972599cfSmrgshelf_DATA += $(docbook:.xml=.ps)
67972599cfSmrg%.ps: %.xml $(chapters)
68972599cfSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
69972599cfSmrgendif HAVE_FOP
70972599cfSmrg
71972599cfSmrg# Generate documents cross-reference target databases
72972599cfSmrgif HAVE_XSLTPROC
73972599cfSmrg
74972599cfSmrgXSLT_SEARCHPATH_FLAGS = 				\
75972599cfSmrg	--path "$(XORG_SGML_PATH)/X11"			\
76972599cfSmrg	--path "$(abs_top_builddir)"
77972599cfSmrgXSLT_OLINK_FLAGS = 					\
78972599cfSmrg	--stringparam targets.filename "$@" 		\
79972599cfSmrg	--stringparam collect.xref.targets "only" 	\
80972599cfSmrg	--stringparam olink.base.uri "$(@:.db=)"
81972599cfSmrg
82972599cfSmrgXSLT_HTML_FLAGS =					\
83972599cfSmrg	$(XSLT_SEARCHPATH_FLAGS) 			\
84972599cfSmrg	$(XSLT_OLINK_FLAGS)				\
85972599cfSmrg	--nonet --xinclude				\
86972599cfSmrg	$(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
87972599cfSmrgXSLT_PDF_FLAGS = 					\
88972599cfSmrg	$(XSLT_SEARCHPATH_FLAGS) 			\
89972599cfSmrg	$(XSLT_OLINK_FLAGS)				\
90972599cfSmrg	--nonet --xinclude				\
91972599cfSmrg	$(STYLESHEET_SRCDIR)/xorg-fo.xsl
92972599cfSmrg
93972599cfSmrgshelf_DATA += $(docbook:.xml=.html.db)
94972599cfSmrg%.html.db: %.xml  $(chapters)
95972599cfSmrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
96972599cfSmrg
97972599cfSmrgshelf_DATA += $(docbook:.xml=.pdf.db)
98972599cfSmrg%.pdf.db: %.xml $(chapters)
99972599cfSmrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
100972599cfSmrg
101972599cfSmrgendif HAVE_XSLTPROC
102972599cfSmrgendif HAVE_STYLESHEETS
103972599cfSmrgendif HAVE_XMLTO
104972599cfSmrg
105972599cfSmrgCLEANFILES = $(shelf_DATA)
106