File: Makefile.in

package info (click to toggle)
php-doc 20081024-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 57,752 kB
  • ctags: 3,858
  • sloc: xml: 686,554; php: 19,446; perl: 610; cpp: 500; makefile: 336; sh: 114; awk: 28
file content (422 lines) | stat: -rw-r--r-- 15,267 bytes parent folder | download
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# +----------------------------------------------------------------------+
# | PHP Version 4                                                        |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2008 The PHP Group                                |
# +----------------------------------------------------------------------+
# | This source file is subject to version 3.0 of the PHP license,       |
# | that is bundled with this package in the file LICENSE, and is        |
# | available through the world-wide-web at the following url:           |
# | http://www.php.net/license/3_0.txt.                                  |
# | If you did not receive a copy of the PHP license and are unable to   |
# | obtain it through the world-wide-web, please send a note to          |
# | license@php.net so we can mail you a copy immediately.               |
# +----------------------------------------------------------------------+
# | Authors: Stig Bakken <ssb@fast.no>                                   |
# +----------------------------------------------------------------------+
#

#
# $Id: Makefile.in,v 1.205 2008/05/26 21:50:26 takagi Exp $
#

all: html

# {{{ variables

VPATH=@srcdir@

srcdir=@srcdir@
scriptdir=@srcdir@/scripts
PHP_SOURCE=@PHP_SOURCE@
PECL_SOURCE=@PECL_SOURCE@
LANGCODE=@LANG@
LANGDIR=@LANGDIR@
LANG=@LANG@ -D .
JADE=@SP_OPTIONS@ @JADE@ -D . -wno-idref
NSGMLS=@SP_OPTIONS@ @NSGMLS@
PHP=@PHP@
XSLTPROC=@XSLTPROC@
XMLLINT=@XMLLINT@
PHD=@PHD@

# Suppress "stripping namespace" messages
DEBUG_SILENT=@XSL_PARAM_QUIET@

CATALOG=@CATALOG@
PARTIAL_STYLE=@PARTIAL_STYLE@
PARTIAL_PHD_THEME=@PARTIAL_PHD_THEME@

MANUAL_STRIPPED=stripped.xml
MANUAL_COMPLETE=.manual.xml

PHPBOOK=phpbook
PHPDSSSL=$(PHPBOOK)/phpbook-dsssl
PHPXML=$(PHPBOOK)/phpbook-xml
PHPXSL=$(PHPBOOK)/phpbook-xsl

HTML_STYLESHEET=$(PHPDSSSL)/html.dsl
PHPWEB_STYLESHEET=$(PHPDSSSL)/phpweb.dsl
HOWTO_STYLESHEET=$(PHPDSSSL)/howto.dsl
HOWTOPHP_STYLESHEET=$(PHPDSSSL)/howto-php.dsl
PRINT_STYLESHEET=$(PHPDSSSL)/print.dsl
KDEVELOP_TOC_STYLESHEET=$(PHPDSSSL)/kdevelop_toc.dsl

XMLDCL=$(PHPXML)/phpdocxml.dcl

CHM_XSL_SHEET=$(PHPXSL)/htmlhelp.xsl
HOWTO_XSL_SHEET=$(PHPXSL)/howto.xsl
QUICKREF_XSL_SHEET=$(PHPXSL)/quickref.xsl
XUL_XSL_SHEET=$(PHPXSL)/htmlhelp.xsl
PARTIAL_STYLESHEET=$(PHPXSL)/@PARTIAL_STYLESHEET@

BIGHTML_DEPS=$(HTML_STYLESHEET) $(PHPDSSSL)/html-common.dsl $(PHPDSSSL)/html-locale.dsl.in $(PHPDSSSL)/common.dsl.in $(MANUAL_STRIPPED) images
HTML_DEPS=$(HTML_STYLESHEET) $(PHPDSSSL)/html-common.dsl $(PHPDSSSL)/html-locale.dsl.in $(PHPDSSSL)/common.dsl.in $(MANUAL_STRIPPED) images_html
HOWTO_DEPS=$(HOWTO_STYLESHEET) $(HOWTOPHP_STYLESHEET) $(PHPDSSSL)/html-common.dsl $(PHPDSSSL)/html-locale.dsl.in $(PHPDSSSL)/common.dsl.in howto/howto.ent
PRINT_DEPS=$(PRINT_STYLESHEET) $(PHPDSSSL)/common.dsl.in $(PHPDSSSL)/print.dsl.in $(MANUAL_STRIPPED) images
PHPWEB_DEPS=$(PHPWEB_STYLESHEET) $(PHPDSSSL)/html-common.dsl $(PHPDSSSL)/common.dsl $(MANUAL_STRIPPED) images_php
KDEVELOP_TOC_DEPS=$(KDEVELOP_TOC_STYLESHEET) Makefile

DIST_FILES=@MANUAL@.tar.gz @MANUAL@.html.gz
# DSSSSSL
#MIRROR_TARGETS=phpweb html/index.html $(DIST_FILES)
# Note DSSSSSSL is still used for the downloadable html - but will be replaced by XSL ASAP
MIRROR_TARGETS=phpweb_xsl html/index.html $(DIST_FILES)


PDF_FILES=@MANUAL@.pdf.bz2

HACK_RTL_LANGS_PAGES=@HACK_RTL_LANGS_PAGES@
HACK_RTL_LANGS_PHPWEB=@HACK_RTL_LANGS_PHPWEB@
# }}}

@AUTOGENERATED_RULES@

entities: FORCE
	$(PHP) -c $(scriptdir) -q $(scriptdir)/entities.php

manual.xml: $(srcdir)/manual.xml.in
	CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status

images:
	for i in `find en -type d -name figures`; do sect=`echo $$i | awk -F\/ '{print $$3}'`; for file in $$i/*; do if test -f $$file; then name=`basename $$file`; cp $$file $$sect.$$name; fi; done; done;

images_html: 
	rm -rf html && mkdir html && mkdir html/figures
	for i in `find en -type d -name figures`; do sect=`echo $$i | awk -F\/ '{print $$3}'`; for file in $$i/*; do if test -f $$file; then name=`basename $$file`; cp $$file html/figures/$$sect.$$name; fi; done; done;

images_xul: 
	rm -rf xul && mkdir xul
	@if test "@FIGURES@" != ""; then mkdir xul/@FIGURES@ ; fi
	for i in `find en -type d -name figures`; do sect=`echo $$i | awk -F\/ '{print $$3}'`; for file in $$i/*; do if test -f $$file; then name=`basename $$file`; cp $$file xul/@FIGURES@/$$sect.$$name; fi; done; done;

images_php: 
	rm -rf php && mkdir php && mkdir php/figures
	for i in `find en -type d -name figures`; do sect=`echo $$i | awk -F\/ '{print $$3}'`; for file in $$i/*; do if test -f $$file; then name=`basename $$file`; cp $$file php/figures/$$sect.$$name; fi; done; done;

images_htmlhelp: 
	rm -rf ./htmlhelp/html && mkdir ./htmlhelp/html && mkdir htmlhelp/html/figures
	for i in `find en -type d -name figures`; do sect=`echo $$i | awk -F\/ '{print $$3}'`; for file in $$i/*; do if test -f $$file; then name=`basename $$file`; cp $$file htmlhelp/html/figures/$$sect.$$name; fi; done; done;

html: html/index.html
bightml: @MANUAL@.html
phpweb: php/index.php
rtf: @MANUAL@.rtf
tex latex: @MANUAL@.tex
dvi: @MANUAL@.dvi
ps: @MANUAL@.ps
pdf: @MANUAL@.pdf
howto: howto/html/index.html
howtophp: howto/php/index.php
howtotgz: howto/howto.html.tar.gz
funcindex: funcindex.xml
revcheck: revcheck.html

FORCE:
	-@rm -f $(MANUAL_COMPLETE) $(MANUAL_STRIPPED)

$(MANUAL_STRIPPED): $(MANUAL_COMPLETE)
	@echo -n "Stripping it..."
	@${XSLTPROC} --param debug.silent $(DEBUG_SILENT) -o $(MANUAL_STRIPPED) docbook/docbook-xsl/common/stripns.xsl $(MANUAL_COMPLETE)
	@echo " done"

$(MANUAL_COMPLETE): FORCE entities/global.ent
	@echo -n "Generating the manual..."
	@$(XMLLINT) --nsclean --xinclude --noent --output $(MANUAL_COMPLETE) manual.xml
	@echo " done"

funclist.txt: FORCE
	@if test "$(PHP_SOURCE)" = "no"; then \
	    echo "WARNING: recreating the function list needs php sources" ;\
	    echo "         which were not found by configure" ;\
	    echo "         aborting " ;\
	else \
	    $(PHP) -C -q $(scriptdir)/genfunclist.php $(PHP_SOURCE) > funclist.txt ;\
	fi; \
        if test "$(PECL_SOURCE)" = "no" -a ! "$(PHP_SOURCE)" = "no"; then \
            echo "WARNING: pecl sources not found - pecl functions" ;\
            echo "         will not be present in funclist.txt" ;\
        elif test ! "$(PHP_SOURCE)" = "no"; then \
            echo ""  >> funclist.txt ;\
            echo "# --------- PECL Stuff --------- " >> funclist.txt ;\
            $(PHP) -C -q $(scriptdir)/genfunclist.php $(PECL_SOURCE) >> funclist.txt ;\
        fi

funcsummary.txt: FORCE
	$(PHP) -C -q $(scriptdir)/genfuncsummary.php $(PHP_SOURCE) > funcsummary.txt

revcheck.html: FORCE
	PHPDOCDIR=$(srcdir) $(PHP) -c $(scriptdir) -f $(scriptdir)/revcheck.php $(LANGDIR) > revcheck.html

funcindex.xml: $(MANUAL_STRIPPED)
	@if test "$(PHP)" = "no"; then \
	echo "WARNING: recreating the function index needs php" ;\
	echo "         which was not found by configure" ;\
	echo "         reusing old file" ;\
	touch funcindex.xml ;\
	else \
	$(XSLTPROC) -o quickref-temp.txt $(QUICKREF_XSL_SHEET) $(MANUAL_STRIPPED) ;\
	echo "$(PHP) -q $(scriptdir)/genfuncindex.php quickref-temp.txt > funcindex.xml" ;\
	$(PHP) -q $(scriptdir)/genfuncindex.php quickref-temp.txt > funcindex.xml ;\
	rm -f quickref-temp.txt ;\
	fi

mirror-files: $(MIRROR_TARGETS)
#extra-mirror-files: $(PDF_FILES) isilo
extra-mirror-files: isilo

snapshot: manual-snapshot.tar.gz

manual-snapshot.tar.gz: @MANUAL@.html html/index.html @MANUAL@.rtf @MANUAL@.txt
	tar -cvzf $@ @MANUAL@.html html/*.html @MANUAL@.rtf @MANUAL@.txt

status: ./funclist.txt
	$(PHP) -q $(scriptdir)/checkdoc.php > status.txt
	$(PHP) -q $(scriptdir)/checkdoc.php missing > missing.txt

summary: ./funcsummary.txt

quickref: quickref.txt
quickref.txt: $(MANUAL_STRIPPED)
	@if test ! -f funcindex.xml; then touch funcindex.xml; fi 
	$(XSLTPROC) -o quickref.txt $(QUICKREF_XSL_SHEET) $(MANUAL_STRIPPED)

kdevelop_toc: php.toc
php.toc: $(MANUAL_COMPLETE) $(KDEVELOP_TOC_DEPS)
	echo '<!DOCTYPE kdeveloptoc>' > $@
	$(JADE) $(CATALOG) -d $(KDEVELOP_TOC_STYLESHEET) -V nochunks -t sgml $(XMLDCL) $(MANUAL_COMPLETE) | sed -e's/\& /\&amp; /g' >> $@

scripts/makedoc: $(scriptdir)/makedoc.cc
	mkdir -p scripts
	g++ -o scripts/makedoc $(scriptdir)/makedoc.cc

# intermediate file for name change 
.SECONDARY: @MANUAL@.xml

@MANUAL@.xml: $(MANUAL_COMPLETE)
	cp $(MANUAL_COMPLETE) $@

@MANUAL@.html: @MANUAL@.xml $(BIGHTML_DEPS)

html/index.html: $(HTML_DEPS)
	$(PHP) -q $(scriptdir)/rtlpatch/hackmanuallang.php $(LANGDIR)
	$(JADE) $(CATALOG) -d $(HTML_STYLESHEET) -V use-output-dir -t sgml $(XMLDCL) $(MANUAL_STRIPPED)
	$(PHP) -q $(scriptdir)/html_syntax.php html dsssl html/
	$(PHP) -q $(scriptdir)/rtlpatch/hackmanuallang.php en
	$(HACK_RTL_LANGS_PAGES)

# still needs more tweaks!!
html_xsl: $(MANUAL_STRIPPED) images_html
	${XSLTPROC} $(PHPXSL)/html.xsl $(MANUAL_STRIPPED)
	$(PHP) -q $(scriptdir)/html_syntax.php html xsl html/

xul_xsl: $(MANUAL_STRIPPED) images_xul
	${XSLTPROC} xsl/xul.xsl $(MANUAL_STRIPPED)

bightml_xsl: $(MANUAL_COMPLETE) images
	${XSLTPROC} -o @MANUAL@.html $(PHPXSL)/bightml.xsl $(MANUAL_STRIPPED)

fo: $(MANUAL_STRIPPED) images
	${XSLTPROC} -o manual.fo $(PHPXSL)/fo.xsl $(MANUAL_STRIPPED)

howto_xsl: $(MANUAL_STRIPPED)
	rm -rf ./howto/html && mkdir ./howto/html
	${XSLTPROC} $(HOWTO_XSL_SHEET) ./howto/howto.xml

chm_xsl: $(MANUAL_STRIPPED) images_htmlhelp
	${XSLTPROC} $(CHM_XSL_SHEET) $(MANUAL_STRIPPED)
 
phpweb_xsl: $(MANUAL_STRIPPED) images_php
	${XSLTPROC} $(PHPXSL)/phpweb.xsl $(MANUAL_STRIPPED)
	$(PHP) -q $(scriptdir)/html_syntax.php php xsl php/
	#$(PHP) -q $(scriptdir)/fixphpweb.php `pwd`/php

php/index.php: $(MANUAL_STRIPPED) $(PHPWEB_DEPS)
	$(PHP) -q $(scriptdir)/phpweb-entities.php `pwd` phpweb
	$(PHP) -q $(scriptdir)/rtlpatch/hackmanuallang.php $(LANGDIR)
	-$(JADE) $(CATALOG) -d $(PHPWEB_STYLESHEET) -V use-output-dir -t sgml $(XMLDCL) $(MANUAL_STRIPPED)
	$(PHP) -q $(scriptdir)/html_syntax.php php dsssl php/
	$(PHP) -q $(scriptdir)/rtlpatch/hackmanuallang.php en
	$(PHP) -q $(scriptdir)/phpweb-entities.php `pwd` remove
	$(HACK_RTL_LANGS_PHPWEB)

# PhD Builds:
phd_all: $(MANUAL_COMPLETE) images_php images_html
	@$(PHD) -vvvv -d$(MANUAL_COMPLETE)

phd_phpweb: $(MANUAL_COMPLETE) images_php
	@$(PHD) -vvvv -tphpweb -d$(MANUAL_COMPLETE)

phd_bightml: $(MANUAL_COMPLETE) images
	@$(PHD) -vvvv -tbightml -d$(MANUAL_COMPLETE)

phd_html: $(MANUAL_COMPLETE) images_html
	@$(PHD) -vvvv -tchunkedhtml -d$(MANUAL_COMPLETE)

phd_partial/%: $(MANUAL_COMPLETE)
	@$(PHD) -vvvv -t$(PARTIAL_PHD_THEME) -p$(@F) -d$(MANUAL_COMPLETE)

palmdoc: @MANUAL@.doc.pdb
@MANUAL@.doc.pdb: @MANUAL@.txt scripts/makedoc
	scripts/makedoc -b @MANUAL@.txt @MANUAL@.doc.pdb @PALMDOCTITLE@

# Note: Isilo converter available only in binary from www.isilo.com
isilo: @MANUAL@.isilo.pdb
@MANUAL@.isilo.pdb: @MANUAL@.html
	iSilo386 @MANUAL@.html @MANUAL@.isilo.pdb

@MANUAL@.zip: html/index.html
	-rm -f $@ && (cd html; zip -R -9 -q ../$@ *.html *.png)

@MANUAL@.tar.gz: html/index.html
	-rm -f $@ && (tar -cf - html) | gzip -9 > $@

@MANUAL@.tar.bz2: html/index.html
	-rm -f $@ && (tar -cf - html) | bzip2 -9 > $@

howto/php/index.php: howto/howto.xml $(HOWTO_DEPS)
	@test -d howto/php || mkdir howto/php
	-$(JADE) -i lang-en $(CATALOG) -d $(HOWTOPHP_STYLESHEET) -V use-output-dir -t sgml $(XMLDCL) $(srcdir)/howto/howto.xml

howto/html/index.html: howto/howto.xml $(HOWTO_DEPS)
	@test -d howto/html || mkdir howto/html
	-$(JADE) -i lang-en $(CATALOG) -d $(HOWTO_STYLESHEET) -V use-output-dir -t sgml $(XMLDCL) $(srcdir)/howto/howto.xml

howto/howto.html.tar.gz: howto/html/index.html $(HOWTO_DEPS)
	tar -cvzf $@ howto/html/*.html  

install.html: install.xml $(HTML_DEPS)
	$(JADE) $(CATALOG) -V nochunks -d $(PHPDSSSL)/install.dsl -t sgml $(XMLDCL) install.xml > $@

chm: html_xsl FORCE
	chm/make_chm.bat $(LANG)

# File endings we are going to define general rules for:
.SUFFIXES: .html .xml .sgml .tex .dvi .ps .pdf .rtf .gz .bz2 .txt
.PRECIOUS: %.html %.dvi
# General rules:
%.rtf: %.xml
	$(JADE) $(CATALOG) -d $(PRINT_STYLESHEET) -t rtf $(XMLDCL) $<

%.gz: %
	gzip -9 -c $< > $@

%.bz2: % 
	bzip2 -9 -c $< > $@

%.zip: %
	zip -9 $@ $<

%.pdf: %.dvi
	dvipdfm -o $@ -p @PDF_PAPER_TYPE@ $<

%.ps: %.dvi
	dvips -o $@ -t @PDF_PAPER_TYPE@ $<

%.html: %.xml
	$(JADE) $(CATALOG) -V nochunks -d $(HTML_STYLESHEET) -t sgml $(XMLDCL) $< > $@

%.txt: %.html
	lynx -nolist -dump file:`pwd`/$< > $@

%.tex: %.xml
	$(JADE) $(CATALOG) -d $(PRINT_STYLESHEET) -t tex $(XMLDCL) $<

# general TeX->dvi ru
# runs three times -
# 1. generates the dvi with a completely bogus table of contents
# 2. generates the dvi with a table of contents that is off based on the size
#    of the table of contents
# 3. generates a dvi with all the right page numbers and such
%.dvi : %.tex
	# a hack around bugs in jade/jadetex...
	mv $< $<.tmp
	sed -e '/HeadingText/,/endHeadPar/ s/_/\\137/g' $<.tmp > $<
	rm $<.tmp
	-jadetex $<
	-jadetex $<
	-jadetex $<

# {{{ partial builds
part/%: $(MANUAL_STRIPPED)
	@if test ! -d $(PARTIAL_STYLE); then mkdir $(PARTIAL_STYLE); fi
	${XSLTPROC} --stringparam rootid $(@F) $(PARTIAL_STYLESHEET) $(MANUAL_STRIPPED)
	$(PHP) -q $(scriptdir)/html_syntax.php $(PARTIAL_STYLE) xsl $(PARTIAL_STYLE)/
# }}}

# {{{ tests

# test all possible errors
test: manual.xml
	@if test ! -f funcindex.xml; then touch funcindex.xml; fi 
	@if test ! -f entities/missing-entities.ent; then touch entities/missing-entities.ent; fi 
	@if test ! -f entities/missing-ids.xml; then touch entities/missing-ids.xml; fi 
	$(NSGMLS) -i lang-$(LANG) -s $(XMLDCL) manual.xml

# ignore missing IDs and check if the manual can be generated anyway
test_man_gen: manual.xml
	@if test ! -f funcindex.xml; then touch funcindex.xml; fi 
	@if test ! -f entities/missing-entities.ent; then touch entities/missing-entities.ent; fi 
	@if test ! -f entities/missing-ids.xml; then touch entities/missing-ids.xml; fi
	$(NSGMLS) -wno-idref -i lang-$(LANG) -s $(XMLDCL) manual.xml

test_xml: $(MANUAL_COMPLETE)
	@if test ! -f funcindex.xml; then touch funcindex.xml; fi 
	@if test ! -f entities/missing-entities.ent; then touch entities/missing-entities.ent; fi 
	@if test ! -f entities/missing-ids.xml; then touch entities/missing-ids.xml; fi
	$(XMLLINT) --noent --noout --valid $(MANUAL_COMPLETE)

test_xsd: $(MANUAL_COMPLETE)
	xmllint --noent --noout --schema docbook/docbook-xml/docbook.xsd $(MANUAL_COMPLETE)

test_rng: $(MANUAL_COMPLETE)
	xmllint --noent --noout --relaxng docbook/docbook-xml/docbook.rng $(MANUAL_COMPLETE)

test_howto:
	$(XMLLINT) --noent --noout --valid ./howto/howto.xml

# }}}

# {{{ cleanup 

clean:
	rm -rf html php fancy howto/html howto/php htmlhelp/html
	rm -f @MANUAL@.txt [a-z]*.html @MANUAL@.rtf manual.info
	rm -f @MANUAL@.zip @MANUAL@.tar.gz $(MANUAL_COMPLETE) $(MANUAL_STRIPPED)
	rm -f manual_*.pdb @srcdir@/scripts/makedoc *.manifest
	rm -f *.aux *.tex *.log *.dvi *.toc *.ps *.gz
	rm -f status.txt missing.txt infiles.cache
	rm -f entities/file-entities.ent
	rm -f entities/missing*
	rm -f @LANGDIR@/missing-ids.xml
	
distclean: clean
	for file in `find . -name "*.in"`; do rm -f `dirname $$file`/`basename $$file .in`; done
	rm -f config.cache config.status missing-entities.out

# }}}
# {{{ tree utils

pull:
	cvs -z3 up -dP $(LANGDIR)

# }}}