-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
executable file
·202 lines (177 loc) · 9.29 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# ZFDocumentor
#
# LICENSE
#
# This source file is subject to the new BSD license that is bundled
# with this package in the file LICENSE.txt.
# If you did not receive a copy of the license and are unable to
# obtain it through the world-wide-web, please send an email
# to [email protected] so we can send you a copy immediately.
#
# @category Documentation
# @author Mickael Perraud <[email protected]>
# @copyright Copyright (c) 2010-2011 Mickael Perraud <[email protected]>
# @license http://framework.zend.com/license/new-bsd New BSD License
#
# Makefile - build Zend Framework documentation
#
# Main targets:
# all - render DocBook manual in HTML.
# clean - remove staged files.
# check - validate DocBook manual using xmllint.
# check1 - validate one DocBook XML file using xmllint.
# Requires that you set the XMLFILE variable.
#
# -- parameters you are likely to want to change --
# XMLFILE is the name of one DocBook XML file that you want to
# test with xmllint, using the 'check1' target.
FOP=@FOP@
XSLTPROC=@XSLTPROC@
XMLLINT=@XMLLINT@
ECSRC=@ECSRC@
HERE=@HERE@
#HHC=@HHC@
HHC=wine /home/mikaelkael/.wine/drive_c/htmlhelp/hhc.exe
# External link (could be set via ENVIRONMENT variable)
DOCBOOK_DTD=http://framework.zend.com/docbook/xml/4.5/docbookx.dtd
MANUAL_XML=manual.xml
MANUAL_LINT_XML=manual-lint.xml.in
MODULE=module_specs
XMLFILE=
ZF_LANG=en
ZF_VERSION=1.11
# "make" or "make -e"
all: html
$(MANUAL_XML): ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/$(MANUAL_XML).in rev-svn version-zf
@echo "Creating temporary manual and preprocessing it..."
@rm -Rf ./temp/files/
@rm -Rf ./temp/en/
@mkdir ./temp/files/
@sed -e 's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' -e 's!"../en/!"!' $< > ./temp/files/$@
@mkdir ./temp/en/
@mkdir ./temp/en/ref/
@mkdir ./temp/files/ref/
@mkdir ./temp/files/module_specs/
@mkdir ./temp/files/tutorials/
@cp ./xinclude.mod ./temp/files/xinclude.mod
@cp ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/ref/* ./temp/en/ref/
@cp ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/ref/* ./temp/files/ref/
@cp ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/module_specs/* ./temp/files/module_specs/
@[ -d ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/tutorials ] || mkdir ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/tutorials
@touch ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/tutorials/remove
@cp ../standard/branches/release-$(ZF_VERSION)/documentation/manual/en/tutorials/* ./temp/files/tutorials/
@[ -d ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/ref ] || mkdir ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/ref
@cp ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/ref/* ./temp/files/ref/
@[ -d ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/module_specs ] || mkdir ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/module_specs
@cp ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/module_specs/* ./temp/files/module_specs/
@[ -d ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/tutorials ] || mkdir ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/tutorials
@touch ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/tutorials/to_remove
@cp ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG)/tutorials/* ./temp/files/tutorials/
@find . -wholename './temp/files/*.xml' -print0 | xargs -0 sed --regexp-extended --in-place 's#../../en/module_specs/##g'
@php -f tools/IntegrateExtras.php $(ZF_LANG) $(ZF_VERSION)
@[ -d output ] || mkdir output
@$(XMLLINT) --xinclude --output ./temp/manual.xml ./temp/files/$(MANUAL_XML)
@php -f tools/ManualXML.php $(ZF_VERSION)
@rm -Rf ./temp/files/
test:
@[ -d temp ] || mkdir temp
echo $(ZF_LANG) | tr [:lower:] [:upper:] > temp/lang
echo "toto" > temp/`cat temp/lang`
docbook-migration: $(MANUAL_XML)
$(XSLTPROC) --xinclude ./tools/db4-upgrade.xsl ./temp/manual.xml > ./temp/manual-db5.xml
figures:
@[ -d figures ] || mkdir figures
@cp -f ../standard/trunk/documentation/manual/en/figures/*.jpg figures
@cp -f ../standard/trunk/documentation/manual/en/figures/*.png figures
rev-svn:
@[ -d temp ] || mkdir temp
@export LANG=en_US.UTF8
@svn info ../standard/branches/release-$(ZF_VERSION)/documentation/manual/$(ZF_LANG) | grep '^Last Changed Rev' | sed -e 's!Last Changed Rev: !!m' | tr -d '\n'> ./temp/svn_rev \
|| @echo "Impossible to read svn revision"
version-zf:
@[ -d temp ] || mkdir temp
@php -r "include_once '../standard/branches/release-$(ZF_VERSION)/library/Zend/Version.php'; echo Zend_Version::VERSION;" > ./temp/zf_version
# Build the docs in HTML format
website: html zipdoc
html: docbook-migration figures
@rm -Rf output/website/$(ZF_VERSION)/$(ZF_LANG)/
@./phd --xinclude --forceindex -f xhtml -P Mkk -L $(ZF_LANG) -o output/website/$(ZF_VERSION)/$(ZF_LANG) -d ./temp/manual-db5.xml
@[ -f output/website/$(ZF_VERSION)/$(ZF_LANG)/index.sqlite ] && rm output/website/$(ZF_VERSION)/$(ZF_LANG)/index.sqlite
@[ -d output/website/images ] || mkdir output/website/images
@[ -d output/website/scripts ] || mkdir output/website/scripts
@[ -d output/website/styles ] || mkdir output/website/styles
@cp -f images/*.* output/website/images
@cp -f styles/*.* output/website/styles
@cp -f javascripts/*.* output/website/scripts
zipdoc:
@[ -d docs ] || mkdir docs
@rm -Rf temp/zfdoc
@mkdir temp/zfdoc
@mkdir temp/zfdoc/figures
@mkdir temp/zfdoc/images
@mkdir temp/zfdoc/scripts
@mkdir temp/zfdoc/styles
@cp -R output/website/$(ZF_VERSION)/$(ZF_LANG)/* temp/zfdoc
@cp -R output/website/figures/*.* temp/zfdoc/figures
@cp -f images/*.* temp/zfdoc/images
@cp -f styles/*.* temp/zfdoc/styles
@cp -f javascripts/*.* temp/zfdoc/scripts
@(cd temp; find -name '*.html' -print0 | xargs -0 sed --regexp-extended --in-place 's/src="\/images\//src="images\//;s/href="\/styles\//href="styles\//;s/src="\/scripts\//src="scripts\//')
@echo '#alternateDoc{display:none;}' >> temp/zfdoc/styles/zfdocumentor.css
@echo '.editions{display:none;}' >> temp/zfdoc/styles/zfdocumentor.css
@echo '#searchZf{display:none;}' >> temp/zfdoc/styles/zfdocumentor.css
@echo '#header{height:60px;}' >> temp/zfdoc/styles/zfdocumentor.css
@(cd temp ; zip -q -r ../docs/Zend_Framework_$(ZF_VERSION).x_`echo $(ZF_LANG) | tr [:lower:] [:upper:]`.zip zfdoc)
lucene:
@php -f tools/IndexLucene.php $(ZF_VERSION) $(ZF_LANG)
htmlhelp: docbook-migration figures
@rm -Rf output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/
@./phd --xinclude --forceindex -f chm -P Mkk -L $(ZF_LANG) -o output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG) -d ./temp/manual-db5.xml
@cp -f figures/*.* output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res
@cp -f images/*.* output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res
@cp -f styles/*.* output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res
@cp -f javascripts/*.* output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res
@(cd output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res; find -name '*.html' -print0 | xargs -0 sed --regexp-extended --in-place 's/src="..\/..\/figures\//src="/;s/src="..\/..\/images\//src="/;s/src="\/images\//src="/;s/href="\/styles\//href="/;s/src="\/scripts\//src="/')
@echo '#alternateDoc{display:none;}' >> output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res/zfdocumentor.css
@echo '.editions{display:none;}' >> output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res/zfdocumentor.css
@echo '#searchZf{display:none;}' >> output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res/zfdocumentor.css
@echo 'body div#header{height:60px;background-image:url(zf-logo-45.png)}' >> output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res/zfdocumentor.css
@echo 'div.colleft div.col2 {display:none}' >> output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res/zfdocumentor.css
@echo '.leftmenu .col1 {left: 102%;width: 96%;}' >> output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res/zfdocumentor.css
@echo '.leftmenu .colleft {right: 100%;}' >> output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/res/zfdocumentor.css
chm: htmlhelp
$(HHC) ./output/htmlhelp/$(ZF_VERSION)/$(ZF_LANG)/zf.hhp
# Build the docs in PDF format
pdf: docbook-migration figures
@rm -Rf output/pdf/$(ZF_VERSION)/$(ZF_LANG)/
@./phd --xinclude --forceindex -g 'phpdotnet\phd\Highlighter_GeSHi' -f pdf -P Mkk -L $(ZF_LANG) -o output/pdf/$(ZF_VERSION)/$(ZF_LANG) -d ./temp/manual-db5.xml
# checking manual
check: $(MANUAL_XML)
@echo "Checking the whole manual..."
@$(XMLLINT) --valid --noout --postvalid ./temp/manual.xml && echo "OK"
check1: $(MANUAL_LINT_XML)
@if [ -n "$(XMLFILE)" ] ; then \
if [ -f "$(MODULE)/$(XMLFILE)" ] ; then \
@echo "Checking $(XMLFILE)..." ; \
@sed -e 's!@XMLFILE@!$(MODULE)/$(XMLFILE)!' -e 's!@DOCBOOK_DTD@!$(DOCBOOK_DTD)!' $(MANUAL_LINT_XML) \
| $(XMLLINT) --xinclude --output ./temp/$(XMLFILE) - ; \
@$(XMLLINT) --valid --noout --postvalid ./temp/$(XMLFILE) \
&& echo "OK" ; \
else \
@echo "File $(MODULE)/$(XMLFILE) not found." ; \
fi ; \
else \
@echo "Please specify a filename, e.g. 'make XMLFILE=filename.xml lint'" ; \
fi
# cleaning
clean:
-rm -Rf ./output/website
-rm -Rf ./temp
cleanall: clean
-rm -Rf ./output
-rm -Rf ./figures
-rm -Rf ./docs
-rm -f config.* configure
-rm -rf autom4te.cache
-rm -f Makefile
-rm -f $(HTML_XSL) $(MANUAL_XML)