1a5602400Smrg#
2a5602400Smrg# Generate output formats for a single DocBook/XML with/without chapters
3a5602400Smrg#
4a5602400Smrg# Variables set by the calling Makefile:
5a5602400Smrg# shelfdir: the location where the docs/specs are installed. Typically $(docdir)
6a5602400Smrg# docbook:  the main DocBook/XML file, no chapters, appendix or image files
7a5602400Smrg# chapters: all files pulled in by an XInclude statement and images.
8a5602400Smrg#
9a5602400Smrg
10a5602400Smrg#
11a5602400Smrg# This makefile is intended for Users Documentation and Functional Specifications.
12a5602400Smrg# Do not use for Developer Documentation which is not installed and does not require olink.
13a5602400Smrg# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
14a5602400Smrg# for an explanation on documents classification.
15a5602400Smrg#
16a5602400Smrg
17a5602400Smrg# DocBook/XML generated output formats to be installed
18a5602400Smrgshelf_DATA =
19a5602400Smrg
20a5602400Smrg# DocBook/XML file with chapters, appendix and images it includes
21a5602400Smrgdist_shelf_DATA = $(docbook) $(chapters)
22a5602400Smrg
23af9a7ee5Smrgif HAVE_XMLTO
24a5602400Smrgif HAVE_STYLESHEETS
25a5602400Smrg
26af9a7ee5SmrgXMLTO_SEARCHPATH_FLAGS = 				\
27af9a7ee5Smrg	--searchpath "$(XORG_SGML_PATH)/X11" 		\
28af9a7ee5Smrg	--searchpath "$(abs_top_builddir)"
29af9a7ee5SmrgXMLTO_HTML_OLINK_FLAGS = \
30af9a7ee5Smrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
31af9a7ee5Smrg	--stringparam current.docid="$(<:.xml=)"
32af9a7ee5SmrgXMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
33af9a7ee5SmrgXMLTO_HTML_FLAGS = 					\
34af9a7ee5Smrg	$(XMLTO_SEARCHPATH_FLAGS)			\
35af9a7ee5Smrg	$(XMLTO_HTML_STYLESHEET_FLAGS)			\
36af9a7ee5Smrg	$(XMLTO_HTML_OLINK_FLAGS)
37a5602400Smrg
38a5602400Smrgshelf_DATA += $(docbook:.xml=.html)
39af9a7ee5Smrg%.html: %.xml $(chapters)
40af9a7ee5Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
41a5602400Smrg
42a5602400Smrgif HAVE_XMLTO_TEXT
43af9a7ee5Smrg
44a5602400Smrgshelf_DATA += $(docbook:.xml=.txt)
45a5602400Smrg%.txt: %.xml $(chapters)
46af9a7ee5Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
47a5602400Smrgendif HAVE_XMLTO_TEXT
48a5602400Smrg
49af9a7ee5Smrgif HAVE_FOP
50af9a7ee5SmrgXMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
51af9a7ee5SmrgXMLTO_PDF_OLINK_FLAGS = \
52af9a7ee5Smrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
53af9a7ee5Smrg	--stringparam current.docid="$(<:.xml=)"
54af9a7ee5SmrgXMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
55af9a7ee5Smrg
56af9a7ee5SmrgXMLTO_FO_FLAGS = 					\
57af9a7ee5Smrg	$(XMLTO_SEARCHPATH_FLAGS)			\
58af9a7ee5Smrg	$(XMLTO_FO_STYLESHEET_FLAGS)			\
59af9a7ee5Smrg	$(XMLTO_FO_IMAGEPATH_FLAGS)			\
60af9a7ee5Smrg	$(XMLTO_PDF_OLINK_FLAGS)
61af9a7ee5Smrg
62af9a7ee5Smrgshelf_DATA += $(docbook:.xml=.pdf)
63af9a7ee5Smrg%.pdf: %.xml $(chapters)
64af9a7ee5Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
65a5602400Smrg
66af9a7ee5Smrgshelf_DATA += $(docbook:.xml=.ps)
67af9a7ee5Smrg%.ps: %.xml $(chapters)
68af9a7ee5Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
69af9a7ee5Smrgendif HAVE_FOP
70a5602400Smrg
71af9a7ee5Smrg# Generate documents cross-reference target databases
72af9a7ee5Smrgif HAVE_XSLTPROC
73a5602400Smrg
74af9a7ee5SmrgXSLT_SEARCHPATH_FLAGS = 				\
75a5602400Smrg	--path "$(XORG_SGML_PATH)/X11"			\
76af9a7ee5Smrg	--path "$(abs_top_builddir)"
77af9a7ee5SmrgXSLT_OLINK_FLAGS = 					\
78af9a7ee5Smrg	--stringparam targets.filename "$@" 		\
79af9a7ee5Smrg	--stringparam collect.xref.targets "only" 	\
80af9a7ee5Smrg	--stringparam olink.base.uri "$(@:.db=)"
81af9a7ee5Smrg
82af9a7ee5SmrgXSLT_HTML_FLAGS =					\
83af9a7ee5Smrg	$(XSLT_SEARCHPATH_FLAGS) 			\
84af9a7ee5Smrg	$(XSLT_OLINK_FLAGS)				\
85af9a7ee5Smrg	--nonet --xinclude				\
86af9a7ee5Smrg	$(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
87af9a7ee5SmrgXSLT_PDF_FLAGS = 					\
88af9a7ee5Smrg	$(XSLT_SEARCHPATH_FLAGS) 			\
89af9a7ee5Smrg	$(XSLT_OLINK_FLAGS)				\
90af9a7ee5Smrg	--nonet --xinclude				\
91af9a7ee5Smrg	$(STYLESHEET_SRCDIR)/xorg-fo.xsl
92af9a7ee5Smrg
93af9a7ee5Smrgshelf_DATA += $(docbook:.xml=.html.db)
94a5602400Smrg%.html.db: %.xml  $(chapters)
95af9a7ee5Smrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
96a5602400Smrg
97af9a7ee5Smrgshelf_DATA += $(docbook:.xml=.pdf.db)
98af9a7ee5Smrg%.pdf.db: %.xml $(chapters)
99af9a7ee5Smrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
100a5602400Smrg
101a5602400Smrgendif HAVE_XSLTPROC
102a5602400Smrgendif HAVE_STYLESHEETS
103af9a7ee5Smrgendif HAVE_XMLTO
104a5602400Smrg
105af9a7ee5SmrgCLEANFILES = $(shelf_DATA)
106