157f47464Smrg#
257f47464Smrg# Generate output formats for a single DocBook/XML with/without chapters
357f47464Smrg#
457f47464Smrg# Variables set by the calling Makefile:
557f47464Smrg# shelfdir: the location where the docs/specs are installed. Typically $(docdir)
657f47464Smrg# docbook:  the main DocBook/XML file, no chapters, appendix or image files
757f47464Smrg# chapters: all files pulled in by an XInclude statement and images.
857f47464Smrg#
957f47464Smrg
1057f47464Smrg#
1157f47464Smrg# This makefile is intended for Users Documentation and Functional Specifications.
1257f47464Smrg# Do not use for Developer Documentation which is not installed and does not require olink.
1357f47464Smrg# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
1457f47464Smrg# for an explanation on documents classification.
1557f47464Smrg#
1657f47464Smrg
1757f47464Smrg# DocBook/XML generated output formats to be installed
1857f47464Smrgshelf_DATA =
1957f47464Smrg
2057f47464Smrg# DocBook/XML file with chapters, appendix and images it includes
2157f47464Smrgdist_shelf_DATA = $(docbook) $(chapters)
2257f47464Smrg
236cc2b21fSmrgif HAVE_XMLTO
2457f47464Smrgif HAVE_STYLESHEETS
2557f47464Smrg
26eb411b4bSmrgXMLTO_SEARCHPATH_FLAGS = 				\
27eb411b4bSmrg	--searchpath "$(XORG_SGML_PATH)/X11" 		\
28eb411b4bSmrg	--searchpath "$(abs_top_builddir)"
29eb411b4bSmrgXMLTO_HTML_OLINK_FLAGS = \
30eb411b4bSmrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
31eb411b4bSmrg	--stringparam current.docid="$(<:.xml=)"
32eb411b4bSmrgXMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
33eb411b4bSmrgXMLTO_HTML_FLAGS = 					\
34eb411b4bSmrg	$(XMLTO_SEARCHPATH_FLAGS)			\
35eb411b4bSmrg	$(XMLTO_HTML_STYLESHEET_FLAGS)			\
36eb411b4bSmrg	$(XMLTO_HTML_OLINK_FLAGS)
3757f47464Smrg
3857f47464Smrgshelf_DATA += $(docbook:.xml=.html)
39eb411b4bSmrg%.html: %.xml $(chapters)
40eb411b4bSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
4157f47464Smrg
4257f47464Smrgif HAVE_XMLTO_TEXT
43eb411b4bSmrg
4457f47464Smrgshelf_DATA += $(docbook:.xml=.txt)
4557f47464Smrg%.txt: %.xml $(chapters)
46eb411b4bSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
4757f47464Smrgendif HAVE_XMLTO_TEXT
4857f47464Smrg
49eb411b4bSmrgif HAVE_FOP
50eb411b4bSmrgXMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
51eb411b4bSmrgXMLTO_PDF_OLINK_FLAGS = \
52eb411b4bSmrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
53eb411b4bSmrg	--stringparam current.docid="$(<:.xml=)"
54eb411b4bSmrgXMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
55eb411b4bSmrg
56eb411b4bSmrgXMLTO_FO_FLAGS = 					\
57eb411b4bSmrg	$(XMLTO_SEARCHPATH_FLAGS)			\
58eb411b4bSmrg	$(XMLTO_FO_STYLESHEET_FLAGS)			\
59eb411b4bSmrg	$(XMLTO_FO_IMAGEPATH_FLAGS)			\
60eb411b4bSmrg	$(XMLTO_PDF_OLINK_FLAGS)
61eb411b4bSmrg
62eb411b4bSmrgshelf_DATA += $(docbook:.xml=.pdf)
63eb411b4bSmrg%.pdf: %.xml $(chapters)
64eb411b4bSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
6557f47464Smrg
66eb411b4bSmrgshelf_DATA += $(docbook:.xml=.ps)
67eb411b4bSmrg%.ps: %.xml $(chapters)
68eb411b4bSmrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
69eb411b4bSmrgendif HAVE_FOP
7057f47464Smrg
71eb411b4bSmrg# Generate documents cross-reference target databases
72eb411b4bSmrgif HAVE_XSLTPROC
7357f47464Smrg
74eb411b4bSmrgXSLT_SEARCHPATH_FLAGS = 				\
7557f47464Smrg	--path "$(XORG_SGML_PATH)/X11"			\
76eb411b4bSmrg	--path "$(abs_top_builddir)"
77eb411b4bSmrgXSLT_OLINK_FLAGS = 					\
78eb411b4bSmrg	--stringparam targets.filename "$@" 		\
79eb411b4bSmrg	--stringparam collect.xref.targets "only" 	\
80eb411b4bSmrg	--stringparam olink.base.uri "$(@:.db=)"
81eb411b4bSmrg
82eb411b4bSmrgXSLT_HTML_FLAGS =					\
83eb411b4bSmrg	$(XSLT_SEARCHPATH_FLAGS) 			\
84eb411b4bSmrg	$(XSLT_OLINK_FLAGS)				\
85eb411b4bSmrg	--nonet --xinclude				\
86eb411b4bSmrg	$(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
87eb411b4bSmrgXSLT_PDF_FLAGS = 					\
88eb411b4bSmrg	$(XSLT_SEARCHPATH_FLAGS) 			\
89eb411b4bSmrg	$(XSLT_OLINK_FLAGS)				\
90eb411b4bSmrg	--nonet --xinclude				\
91eb411b4bSmrg	$(STYLESHEET_SRCDIR)/xorg-fo.xsl
92eb411b4bSmrg
93eb411b4bSmrgshelf_DATA += $(docbook:.xml=.html.db)
9457f47464Smrg%.html.db: %.xml  $(chapters)
95eb411b4bSmrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
9657f47464Smrg
97eb411b4bSmrgshelf_DATA += $(docbook:.xml=.pdf.db)
98eb411b4bSmrg%.pdf.db: %.xml $(chapters)
99eb411b4bSmrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
10057f47464Smrg
10157f47464Smrgendif HAVE_XSLTPROC
10257f47464Smrgendif HAVE_STYLESHEETS
1036cc2b21fSmrgendif HAVE_XMLTO
10457f47464Smrg
1056cc2b21fSmrgCLEANFILES = $(shelf_DATA)
106