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.
14 # @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
15 # @license http://framework.zend.com/license/new-bsd New BSD License
19 # Makefile - build Zend Framework product and documentation
22 # all - render DocBook manual in HTML.
23 # clean - remove staged files.
24 # check - validate DocBook manual using xmllint.
25 # check1 - validate one DocBook XML file using xmllint.
26 # Requires that you set the XMLFILE variable.
27 # pdf-print - PDF version of manual, in two volumes; requires Apache FOP
30 # -- parameters you are likely to want to change --
32 # XMLFILE is the name of one DocBook XML file that you want to
33 # test with xmllint, using the 'check1' target.
41 DOCBOOK_DTD?
=http
://framework.zend.com
/docbook
/xml
/4.5/docbookx.dtd
42 DOCBOOK_XSL?
=http
://framework.zend.com
/docbook-xsl
/htmlhelp
/htmlhelp.xsl
43 DOCBOOK_FO_XSL?
=http
://framework.zend.com
/docbook-xsl
/fo
/docbook.xsl
46 MANUAL_PRINT1_XML
=manual-print1.xml
47 MANUAL_PRINT2_XML
=manual-print2.xml
48 MANUAL_LINT_XML
=..
/en
/manual-lint.xml.in
50 PDF_XSL
=pdf-manual.xsl
53 all: $(MANUAL_XML
) html
55 # Build the docs in HTML format
59 html
/index.html
: $(MANUAL_XML
) $(HTML_XSL
)
60 @echo
"Rendering the whole manual with $(XSLTPROC)..."
61 $(XMLLINT
) --xinclude
--output _temp_manual.xml
$(MANUAL_XML
)
62 $(XSLTPROC
) --xinclude
--output html
/index.html
$(HTML_XSL
) _temp_manual.xml
63 @echo
"Copying manual figures (recursively)..."
64 -[ -d figures
] && cp
-r figures html
/
66 $(MANUAL_XML
): ..
/en
/$(MANUAL_XML
).in
67 sed
-e
's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $< > $@
69 $(HTML_XSL
): ..
/en
/$(HTML_XSL
).in
70 sed
-e
's!@DOCBOOK_XSL@!$(DOCBOOK_XSL)!' $< > $@
72 # Build the docs in PDF format
74 pdf-print
: pdf-print-volume1 pdf-print-volume2
77 @if
[ ! -e pdf
]; then \
81 pdf
: pdf-dir
$(MANUAL_XML
) $(PDF_XSL
)
82 @echo
"Rendering of the PDF manual with $(FOP)..."
83 $(XMLLINT
) --xinclude
--output _temp_manual.xml
$(MANUAL_XML
)
84 $(XSLTPROC
) --xinclude
--output ZendFramework.fo
$(PDF_XSL
) _temp_manual.xml
85 "$(FOP)" -fo ZendFramework.fo
-pdf pdf
/ZendFramework.pdf
87 pdf-print-volume1
: pdf-dir
$(PDF_XSL
) $(MANUAL_PRINT1_XML
)
88 @echo
"Rendering volume 1 of the PDF manual with $(FOP)..."
89 $(XMLLINT
) --xinclude
--output _temp_manual_1.xml
$(MANUAL_PRINT1_XML
)
90 $(XSLTPROC
) --xinclude
--output ZendFramework.fo
$(PDF_XSL
) _temp_manual_1.xml
91 "$(FOP)" -fo ZendFramework.fo
-pdf pdf
/ZendFrameworkVolume1.pdf
93 pdf-print-volume2
: pdf-dir
$(PDF_XSL
) $(MANUAL_PRINT2_XML
)
94 @echo
"Rendering volume 2 of the PDF manual with $(FOP)..."
95 $(XMLLINT
) --xinclude
--output _temp_manual_2.xml
$(MANUAL_PRINT1_XML
)
96 $(XSLTPROC
) --xinclude
--output ZendFramework.fo
$(PDF_XSL
) _temp_manual_2.xml
97 "$(FOP)" -fo ZendFramework.fo
-pdf pdf
/ZendFrameworkVolume2.pdf
99 $(MANUAL_PRINT1_XML
): ..
/en
/$(MANUAL_PRINT1_XML
).in
100 sed
-e
's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $< > $@
102 $(MANUAL_PRINT2_XML
): ..
/en
/$(MANUAL_PRINT2_XML
).in
103 sed
-e
's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $< > $@
105 $(PDF_XSL
): ..
/en
/$(PDF_XSL
).in
106 sed
-e
's!@DOCBOOK_FO_XSL@!$(DOCBOOK_FO_XSL)!' $< > $@
111 @echo
"Checking the whole manual with $(XMLLINT)..."
112 @
$(XMLLINT
) --xinclude
--output _temp_manual.xml
$(MANUAL_XML
)
113 @
$(XMLLINT
) --valid
--noout
--postvalid _temp_manual.xml \
116 check1
: $(MANUAL_LINT_XML
)
117 @if
[ -n
"$(XMLFILE)" ] ; then \
118 if
[ -f
"$(MODULE)/$(XMLFILE)" ] ; then \
119 echo
"Checking $(XMLFILE) with $(XMLLINT)..." ; \
120 sed
-e
's!@XMLFILE@!$(MODULE)/$(XMLFILE)!' -e
's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $(MANUAL_LINT_XML
) \
121 |
$(XMLLINT
) --xinclude
--output _temp_
$(XMLFILE
) - ; \
122 $(XMLLINT
) --valid
--noout
--postvalid _temp_
$(XMLFILE
) \
125 echo
"File $(MODULE)/$(XMLFILE) not found." ; \
128 echo
"Please specify a filename, e.g. 'make XMLFILE=filename.xml lint'" ; \
132 -rm -f html
/*.html html
/HTML.manifest
133 @if
[ -f html
/figures
] ; then \
134 rm -Rf html
/figures
; \
138 -rm -f ZendFramework.fo
141 -rm -f config.
* configure
142 -rm -rf autom4te.cache
144 -rm -f
$(HTML_XSL
) $(MANUAL_XML
) $(MANUAL_PRINT1_XML
) $(MANUAL_PRINT2_XML
)