Makefile.in 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #
  2. # Zend Framework
  3. #
  4. # LICENSE
  5. #
  6. # This source file is subject to the new BSD license that is bundled
  7. # with this package in the file LICENSE.txt.
  8. # It is also available through the world-wide-web at this URL:
  9. # http://framework.zend.com/license/new-bsd
  10. # If you did not receive a copy of the license and are unable to
  11. # obtain it through the world-wide-web, please send an email
  12. # to license@zend.com so we can send you a copy immediately.
  13. #
  14. # @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  15. # @license http://framework.zend.com/license/new-bsd New BSD License
  16. #
  17. #
  18. # Makefile - build Zend Framework product and documentation
  19. #
  20. # Main targets:
  21. # all - render DocBook manual in HTML.
  22. # clean - remove staged files.
  23. # check - validate DocBook manual using xmllint.
  24. # check1 - validate one DocBook XML file using xmllint.
  25. # Requires that you set the XMLFILE variable.
  26. # pdf-print - PDF version of manual, in two volumes; requires Apache FOP
  27. #
  28. # -- parameters you are likely to want to change --
  29. # XMLFILE is the name of one DocBook XML file that you want to
  30. # test with xmllint, using the 'check1' target.
  31. XSLTPROC=@XSLTPROC@
  32. XMLLINT=@XMLLINT@
  33. FOP=@FOP@
  34. ECSRC=@ECSRC@
  35. HERE=@HERE@
  36. DOCBOOK_DTD?=http://framework.zend.com/docbook/xml/4.5/docbookx.dtd
  37. DOCBOOK_XSL?=http://framework.zend.com/docbook-xsl/htmlhelp/htmlhelp.xsl
  38. DOCBOOK_FO_XSL?=http://framework.zend.com/docbook-xsl/fo/docbook.xsl
  39. HTML_XSL=html.xsl
  40. MANUAL_XML=manual.xml
  41. MANUAL_PRINT1_XML=manual-print1.xml
  42. MANUAL_PRINT2_XML=manual-print2.xml
  43. MANUAL_LINT_XML=manual-lint.xml.in
  44. MODULE=module_specs
  45. PDF_XSL=pdf-manual.xsl
  46. XMLFILE=
  47. all: $(MANUAL_XML) html
  48. # Build the docs in HTML format
  49. html: html/index.html
  50. html/index.html: $(MANUAL_XML) $(HTML_XSL)
  51. @echo "Rendering the whole manual with $(XSLTPROC)..."
  52. $(XSLTPROC) --xinclude --output html/index.html $(HTML_XSL) $(MANUAL_XML)
  53. @echo "Copying manual figures (recursively)..."
  54. -[ -d figures ] && cp -r figures html/figures
  55. $(MANUAL_XML): $(MANUAL_XML).in
  56. sed -e 's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $< > $@
  57. $(HTML_XSL): $(HTML_XSL).in
  58. sed -e 's!@DOCBOOK_XSL@!$(DOCBOOK_XSL)!' $< > $@
  59. # Build the docs in PDF format
  60. pdf-print: pdf-print-volume1 pdf-print-volume2
  61. pdf-dir:
  62. @if [ ! -e pdf ]; then \
  63. mkdir pdf; \
  64. fi
  65. pdf: pdf-dir $(MANUAL_XML) $(PDF_XSL)
  66. @echo "Rendering of the PDF manual with $(FOP)..."
  67. $(XMLLINT) --xinclude --output _temp_manual.xml $(MANUAL_XML)
  68. $(XSLTPROC) --xinclude --output ZendFramework.fo $(PDF_XSL) _temp_manual.xml
  69. "$(FOP)" -fo ZendFramework.fo -pdf pdf/ZendFramework.pdf
  70. pdf-print-volume1: pdf-dir $(PDF_XSL) $(MANUAL_PRINT1_XML)
  71. @echo "Rendering volume 1 of the PDF manual with $(FOP)..."
  72. $(XMLLINT) --xinclude --output _temp_manual_1.xml $(MANUAL_PRINT1_XML)
  73. $(XSLTPROC) --xinclude --output ZendFramework.fo $(PDF_XSL) _temp_manual_1.xml
  74. "$(FOP)" -fo ZendFramework.fo -pdf pdf/ZendFrameworkVolume1.pdf
  75. pdf-print-volume2: pdf-dir $(PDF_XSL) $(MANUAL_PRINT2_XML)
  76. @echo "Rendering volume 2 of the PDF manual with $(FOP)..."
  77. $(XMLLINT) --xinclude --output _temp_manual_2.xml $(MANUAL_PRINT1_XML)
  78. $(XSLTPROC) --xinclude --output ZendFramework.fo $(PDF_XSL) _temp_manual_2.xml
  79. "$(FOP)" -fo ZendFramework.fo -pdf pdf/ZendFrameworkVolume2.pdf
  80. $(MANUAL_PRINT1_XML): $(MANUAL_PRINT1_XML).in
  81. sed -e 's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $< > $@
  82. $(MANUAL_PRINT2_XML): $(MANUAL_PRINT2_XML).in
  83. sed -e 's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $< > $@
  84. $(PDF_XSL): $(PDF_XSL).in
  85. sed -e 's!@DOCBOOK_FO_XSL@!$(DOCBOOK_FO_XSL)!' $< > $@
  86. # Cleanup
  87. check: $(MANUAL_XML)
  88. @echo "Checking the whole manual with $(XMLLINT)..."
  89. @$(XMLLINT) --xinclude --output _temp_manual.xml $(MANUAL_XML)
  90. @$(XMLLINT) --valid --noout --postvalid _temp_manual.xml \
  91. && echo "OK"
  92. check1: $(MANUAL_LINT_XML)
  93. @if [ -n "$(XMLFILE)" ] ; then \
  94. if [ -f "$(MODULE)/$(XMLFILE)" ] ; then \
  95. echo "Checking $(XMLFILE) with $(XMLLINT)..." ; \
  96. sed -e 's!@XMLFILE@!$(MODULE)/$(XMLFILE)!' -e 's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $(MANUAL_LINT_XML) \
  97. | $(XMLLINT) --xinclude --output _temp_$(XMLFILE) - ; \
  98. $(XMLLINT) --valid --noout --postvalid _temp_$(XMLFILE) \
  99. && echo "OK" ; \
  100. else \
  101. echo "File $(MODULE)/$(XMLFILE) not found." ; \
  102. fi ; \
  103. else \
  104. echo "Please specify a filename, e.g. 'make XMLFILE=filename.xml lint'" ; \
  105. fi
  106. clean:
  107. -rm -f html/*.html html/HTML.manifest
  108. @if [ -f html/figures ] ; then \
  109. rm -Rf html/figures ; \
  110. fi
  111. -rm -f _temp_*.xml
  112. -rm -f /*.pdf
  113. -rm -f ZendFramework.fo
  114. cleanall: clean
  115. -rm -f config.* configure
  116. -rm -rf autom4te.cache
  117. -rm -f Makefile
  118. -rm -f $(HTML_XSL) $(MANUAL_XML) $(MANUAL_PRINT1_XML) $(MANUAL_PRINT2_XML)