10cc2eac3Smrg#
20cc2eac3Smrg# Generate output formats for a single DocBook/XML with/without chapters
30cc2eac3Smrg#
40cc2eac3Smrg# Variables set by the calling Makefile:
50cc2eac3Smrg# shelfdir: the location where the docs/specs are installed. Typically $(docdir)
60cc2eac3Smrg# docbook:  the main DocBook/XML file, no chapters, appendix or image files
70cc2eac3Smrg# chapters: all files pulled in by an XInclude statement and images.
80cc2eac3Smrg#
90cc2eac3Smrg
100cc2eac3Smrg#
110cc2eac3Smrg# This makefile is intended for Users Documentation and Functional Specifications.
120cc2eac3Smrg# Do not use for Developer Documentation which is not installed and does not require olink.
130cc2eac3Smrg# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
140cc2eac3Smrg# for an explanation on documents classification.
150cc2eac3Smrg#
160cc2eac3Smrg
170cc2eac3Smrg# DocBook/XML generated output formats to be installed
180cc2eac3Smrgshelf_DATA =
190cc2eac3Smrg
200cc2eac3Smrg# DocBook/XML file with chapters, appendix and images it includes
210cc2eac3Smrgdist_shelf_DATA = $(docbook) $(chapters)
220cc2eac3Smrg
230cc2eac3Smrgif HAVE_XMLTO
240cc2eac3Smrgif HAVE_STYLESHEETS
250cc2eac3Smrg
260cc2eac3SmrgXMLTO_SEARCHPATH_FLAGS = 				\
270cc2eac3Smrg	--searchpath "$(XORG_SGML_PATH)/X11" 		\
280cc2eac3Smrg	--searchpath "$(abs_top_builddir)"
290cc2eac3SmrgXMLTO_HTML_OLINK_FLAGS = \
300cc2eac3Smrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
310cc2eac3Smrg	--stringparam current.docid="$(<:.xml=)"
320cc2eac3SmrgXMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
330cc2eac3SmrgXMLTO_HTML_FLAGS = 					\
340cc2eac3Smrg	$(XMLTO_SEARCHPATH_FLAGS)			\
350cc2eac3Smrg	$(XMLTO_HTML_STYLESHEET_FLAGS)			\
360cc2eac3Smrg	$(XMLTO_HTML_OLINK_FLAGS)
370cc2eac3Smrg
380cc2eac3Smrgshelf_DATA += $(docbook:.xml=.html)
390cc2eac3Smrg%.html: %.xml $(chapters)
400cc2eac3Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
410cc2eac3Smrg
420cc2eac3Smrgif HAVE_XMLTO_TEXT
430cc2eac3Smrg
440cc2eac3Smrgshelf_DATA += $(docbook:.xml=.txt)
450cc2eac3Smrg%.txt: %.xml $(chapters)
460cc2eac3Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
470cc2eac3Smrgendif HAVE_XMLTO_TEXT
480cc2eac3Smrg
490cc2eac3Smrgif HAVE_FOP
500cc2eac3SmrgXMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
510cc2eac3SmrgXMLTO_PDF_OLINK_FLAGS = \
520cc2eac3Smrg	--stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
530cc2eac3Smrg	--stringparam current.docid="$(<:.xml=)"
540cc2eac3SmrgXMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
550cc2eac3Smrg
560cc2eac3SmrgXMLTO_FO_FLAGS = 					\
570cc2eac3Smrg	$(XMLTO_SEARCHPATH_FLAGS)			\
580cc2eac3Smrg	$(XMLTO_FO_STYLESHEET_FLAGS)			\
590cc2eac3Smrg	$(XMLTO_FO_IMAGEPATH_FLAGS)			\
600cc2eac3Smrg	$(XMLTO_PDF_OLINK_FLAGS)
610cc2eac3Smrg
620cc2eac3Smrgshelf_DATA += $(docbook:.xml=.pdf)
630cc2eac3Smrg%.pdf: %.xml $(chapters)
640cc2eac3Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
650cc2eac3Smrg
660cc2eac3Smrgshelf_DATA += $(docbook:.xml=.ps)
670cc2eac3Smrg%.ps: %.xml $(chapters)
680cc2eac3Smrg	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
690cc2eac3Smrgendif HAVE_FOP
700cc2eac3Smrg
710cc2eac3Smrg# Generate documents cross-reference target databases
720cc2eac3Smrgif HAVE_XSLTPROC
730cc2eac3Smrg
740cc2eac3SmrgXSLT_SEARCHPATH_FLAGS = 				\
750cc2eac3Smrg	--path "$(XORG_SGML_PATH)/X11"			\
760cc2eac3Smrg	--path "$(abs_top_builddir)"
770cc2eac3SmrgXSLT_OLINK_FLAGS = 					\
780cc2eac3Smrg	--stringparam targets.filename "$@" 		\
790cc2eac3Smrg	--stringparam collect.xref.targets "only" 	\
800cc2eac3Smrg	--stringparam olink.base.uri "$(@:.db=)"
810cc2eac3Smrg
820cc2eac3SmrgXSLT_HTML_FLAGS =					\
830cc2eac3Smrg	$(XSLT_SEARCHPATH_FLAGS) 			\
840cc2eac3Smrg	$(XSLT_OLINK_FLAGS)				\
850cc2eac3Smrg	--nonet --xinclude				\
860cc2eac3Smrg	$(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
870cc2eac3SmrgXSLT_PDF_FLAGS = 					\
880cc2eac3Smrg	$(XSLT_SEARCHPATH_FLAGS) 			\
890cc2eac3Smrg	$(XSLT_OLINK_FLAGS)				\
900cc2eac3Smrg	--nonet --xinclude				\
910cc2eac3Smrg	$(STYLESHEET_SRCDIR)/xorg-fo.xsl
920cc2eac3Smrg
930cc2eac3Smrgshelf_DATA += $(docbook:.xml=.html.db)
940cc2eac3Smrg%.html.db: %.xml  $(chapters)
950cc2eac3Smrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
960cc2eac3Smrg
970cc2eac3Smrgshelf_DATA += $(docbook:.xml=.pdf.db)
980cc2eac3Smrg%.pdf.db: %.xml $(chapters)
990cc2eac3Smrg	$(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
1000cc2eac3Smrg
1010cc2eac3Smrgendif HAVE_XSLTPROC
1020cc2eac3Smrgendif HAVE_STYLESHEETS
1030cc2eac3Smrgendif HAVE_XMLTO
1040cc2eac3Smrg
1050cc2eac3SmrgCLEANFILES = $(shelf_DATA)
106