PageRenderTime 56ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/docbook.am

#
Makefile | 105 lines | 69 code | 19 blank | 17 comment | 5 complexity | b7504a7a0ff58abcb4cbadf7e0000a18 MD5 | raw file
  1. #
  2. # Generate output formats for a single DocBook/XML with/without chapters
  3. #
  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.
  8. #
  9. #
  10. # This makefile is intended for Users Documentation and Functional Specifications.
  11. # Do not use for Developer Documentation which is not installed and does not require olink.
  12. # Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
  13. # for an explanation on documents classification.
  14. #
  15. # DocBook/XML generated output formats to be installed
  16. shelf_DATA =
  17. # DocBook/XML file with chapters, appendix and images it includes
  18. dist_shelf_DATA = $(docbook) $(chapters)
  19. if HAVE_XMLTO
  20. if HAVE_STYLESHEETS
  21. XMLTO_SEARCHPATH_FLAGS = \
  22. --searchpath "$(XORG_SGML_PATH)/X11" \
  23. --searchpath "$(abs_top_builddir)"
  24. XMLTO_HTML_OLINK_FLAGS = \
  25. --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
  26. --stringparam current.docid="$(<:.xml=)"
  27. XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
  28. XMLTO_HTML_FLAGS = \
  29. $(XMLTO_SEARCHPATH_FLAGS) \
  30. $(XMLTO_HTML_STYLESHEET_FLAGS) \
  31. $(XMLTO_HTML_OLINK_FLAGS)
  32. shelf_DATA += $(docbook:.xml=.html)
  33. %.html: %.xml $(chapters)
  34. $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
  35. if HAVE_XMLTO_TEXT
  36. shelf_DATA += $(docbook:.xml=.txt)
  37. %.txt: %.xml $(chapters)
  38. $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
  39. endif HAVE_XMLTO_TEXT
  40. if HAVE_FOP
  41. XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
  42. XMLTO_PDF_OLINK_FLAGS = \
  43. --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
  44. --stringparam current.docid="$(<:.xml=)"
  45. XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
  46. XMLTO_FO_FLAGS = \
  47. $(XMLTO_SEARCHPATH_FLAGS) \
  48. $(XMLTO_FO_STYLESHEET_FLAGS) \
  49. $(XMLTO_FO_IMAGEPATH_FLAGS) \
  50. $(XMLTO_PDF_OLINK_FLAGS)
  51. shelf_DATA += $(docbook:.xml=.pdf)
  52. %.pdf: %.xml $(chapters)
  53. $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
  54. shelf_DATA += $(docbook:.xml=.ps)
  55. %.ps: %.xml $(chapters)
  56. $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
  57. endif HAVE_FOP
  58. # Generate documents cross-reference target databases
  59. if HAVE_XSLTPROC
  60. XSLT_SEARCHPATH_FLAGS = \
  61. --path "$(XORG_SGML_PATH)/X11" \
  62. --path "$(abs_top_builddir)"
  63. XSLT_OLINK_FLAGS = \
  64. --stringparam targets.filename "$@" \
  65. --stringparam collect.xref.targets "only" \
  66. --stringparam olink.base.uri "$(@:.db=)"
  67. XSLT_HTML_FLAGS = \
  68. $(XSLT_SEARCHPATH_FLAGS) \
  69. $(XSLT_OLINK_FLAGS) \
  70. --nonet --xinclude \
  71. $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
  72. XSLT_PDF_FLAGS = \
  73. $(XSLT_SEARCHPATH_FLAGS) \
  74. $(XSLT_OLINK_FLAGS) \
  75. --nonet --xinclude \
  76. $(STYLESHEET_SRCDIR)/xorg-fo.xsl
  77. shelf_DATA += $(docbook:.xml=.html.db)
  78. %.html.db: %.xml $(chapters)
  79. $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
  80. shelf_DATA += $(docbook:.xml=.pdf.db)
  81. %.pdf.db: %.xml $(chapters)
  82. $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
  83. endif HAVE_XSLTPROC
  84. endif HAVE_STYLESHEETS
  85. endif HAVE_XMLTO
  86. CLEANFILES = $(shelf_DATA)