OSDN Git Service

2010-12-31 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / doc / Makefile.am
1 ## Makefile for the doc subdirectory of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
4 ##
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
7
8 ## This file is part of the GNU ISO C++ Library.  This library is free
9 ## software; you can redistribute it and/or modify it under the
10 ## terms of the GNU General Public License as published by the
11 ## Free Software Foundation; either version 3, or (at your option)
12 ## any later version.
13
14 ## This library is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ## GNU General Public License for more details.
18
19 ## You should have received a copy of the GNU General Public License along
20 ## with this library; see the file COPYING3.  If not see
21 ## <http://www.gnu.org/licenses/>.
22
23 include $(top_srcdir)/fragment.am
24
25 # Documentation Overview
26 #
27 # There are two main input materials for libstdc++ documentation.
28 # The first is the doxygen markup in libstdc++ sources, which is a
29 # reference to the API. And the second is the manual, via docbook markup in
30 # doc/xml/.
31 #
32 # A third and more obscure option deals with charting performance
33 # tests, and should be considered experimental.
34
35 # Documentation conditionals for output.
36 if BUILD_XML
37 STAMP_XML = doc-xml
38 STAMP_INSTALL_XML = doc-install-xml
39 else
40 STAMP_XML =
41 STAMP_INSTALL_XML =
42 endif
43
44 if BUILD_HTML
45 STAMP_HTML = doc-html
46 STAMP_INSTALL_HTML = doc-install-html
47 else
48 STAMP_HTML =
49 STAMP_INSTALL_HTML =
50 endif
51
52 if BUILD_MAN
53 STAMP_MAN = doc-man
54 STAMP_INSTALL_MAN = doc-install-man
55 else
56 STAMP_MAN =
57 STAMP_INSTALL_MAN =
58 endif
59
60 if BUILD_PDF
61 STAMP_PDF = doc-pdf
62 STAMP_INSTALL_PDF = doc-install-pdf
63 else
64 STAMP_PDF =
65 STAMP_INSTALL_PDF =
66 endif
67
68 if BUILD_EPUB
69 STAMP_EPUB = doc-epub
70 STAMP_INSTALL_EPUB = doc-install-epub
71 else
72 STAMP_EPUB = doc-epub
73 STAMP_INSTALL_EPUB = doc-install-epub
74 endif
75
76 # Documentation primary rules.
77 #
78 # xml:
79 # html:
80 # pdf:
81 # man:
82 # info:
83 # ps:
84 # dvi:
85 # epub:
86 # install-xml:
87 # install-html:
88 # install-pdf:
89 # install-man:
90 # install-info:
91 # install-ps:
92 # install-dvi:
93 # install-epub:
94
95 xml: $(STAMP_XML)
96 install-xml: $(STAMP_INSTALL_XML)
97
98 html: $(STAMP_HTML)
99 install-html: $(STAMP_INSTALL_HTML)
100
101 man: $(STAMP_MAN)
102 install-man: $(STAMP_INSTALL_MAN)
103
104 pdf: $(STAMP_PDF)
105 install-pdf: $(STAMP_INSTALL_PDF)
106
107 epub: $(STAMP_EPUB)
108 install-epub: $(STAMP_INSTALL_EPUB)
109
110 info:
111 install-info:
112
113 ps:
114 install-ps:
115
116 dvi:
117 install-dvi:
118
119
120 # Default creation and installation rules.
121 # Point to best sub-rule for the requested documentation target and
122 # create, and then install toplevel directory with standardized names
123 # and layouts.
124
125 # XML
126 xmldir="$(DESTDIR)@docdir@"
127 stamp-xml: stamp-xml-single-docbook stamp-xml-single-doxygen
128         $(STAMP) stamp-xml
129
130 doc-xml: stamp-xml
131
132 doc-install-xml: doc-xml
133         test -z ${xmldir} || $(mkinstalldirs) ${xmldir}
134         $(INSTALL_DATA) ${manual_xml} ${xmldir}
135         $(INSTALL_DATA) ${api_xml} ${xmldir}
136
137 # HTML
138 htmldir="$(DESTDIR)@docdir@"
139 stamp-html: stamp-html-docbook stamp-html-doxygen
140         $(STAMP) stamp-html
141
142 doc-html: stamp-html
143
144 doc-install-html: doc-html
145         test -z ${htmldir} || $(mkinstalldirs) ${htmldir}
146         cp -r ${docbook_outdir}/html ${htmldir}/libstdc++-manual.html;
147         cp -r ${doxygen_outdir}/html ${htmldir}/libstdc++-api.html;
148
149 # PDF
150 pdfdir="$(DESTDIR)@docdir@"
151 stamp-pdf: stamp-pdf-docbook stamp-pdf-doxygen
152         $(STAMP) stamp-pdf
153
154 doc-pdf: stamp-pdf
155
156 doc-install-pdf: doc-pdf
157         test -z ${pdfdir} || $(mkinstalldirs) ${pdfdir}
158         $(INSTALL_DATA) ${docbook_outdir}/pdf/libstdc++-manual.pdf ${pdfdir}
159         $(INSTALL_DATA) ${doxygen_outdir}/pdf/libstdc++-api.pdf ${pdfdir}
160
161 # MAN
162 mandir="$(DESTDIR)@mandir@"
163 stamp-man: stamp-man-doxygen
164         $(STAMP) stamp-man
165
166 doc-man: stamp-man
167
168 doc-install-man: doc-man
169         test -z ${mandir} || $(mkinstalldirs) ${mandir}
170         cp -r ${doxygen_outdir}/man/man3 ${mandir}
171
172 # TEXINFO,INFO
173 infodir="$(DESTDIR)@infodir@"
174 stamp-texinfo: stamp-texinfo-docbook
175         $(STAMP) stamp-texinfo
176
177 stamp-info: stamp-info-docbook
178         $(STAMP) stamp-info
179
180 doc-texinfo: stamp-texinfo
181
182 doc-info: stamp-info
183
184 doc-install-texinfo: doc-texinfo
185         test -z ${infodir} || $(mkinstalldirs) ${infodir}
186         $(INSTALL_DATA) ${manual_texi} ${infodir}
187
188 doc-install-info: doc-info
189         test -z ${infodir} || $(mkinstalldirs) ${infodir}
190         $(INSTALL_DATA) ${manual_info} ${infodir}
191
192 # EPUB
193 # Assumes ruby installed
194 epubdir="$(DESTDIR)@docdir@"
195 stamp-epub: stamp-epub-docbook
196         $(STAMP) stamp-epub
197
198 doc-epub: stamp-epub
199
200 doc-install-epub: doc-epub
201         test -z ${epubdir} || $(mkinstalldirs) ${epubdir}
202         $(INSTALL_DATA) ${manual_epub} ${epubdir}
203
204
205 # Doxygen configuration
206 # Assumes doxygen, graphviz (with dot), pdflatex installed
207 doxygen_script=${top_srcdir}/scripts/run_doxygen
208 doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
209 api_xml = ${doxygen_outdir}/xml/libstdc++-api-single.xml
210 doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
211 api_pdf = ${doxygen_outdir}/pdf/libstdc++-api.pdf
212
213 ${doxygen_outdir}/xml:
214         mkdir -p ${doxygen_outdir}/xml
215
216 ${doxygen_outdir}/html:
217         mkdir -p ${doxygen_outdir}/html
218
219 ${doxygen_outdir}/latex:
220         mkdir -p ${doxygen_outdir}/latex
221
222 ${doxygen_outdir}/pdf:
223         mkdir -p ${doxygen_outdir}/pdf
224
225 ${doxygen_outdir}/man:
226         mkdir -p ${doxygen_outdir}/man
227
228 stamp-xml-doxygen: ${doxygen_outdir}/xml
229         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
230           builddir=`cd ..; ${PWD_COMMAND}`; \
231           ${SHELL} ${doxygen_script} \
232           --host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
233         $(STAMP) stamp-xml-doxygen
234
235 stamp-xml-single-doxygen: stamp-xml-doxygen
236         @echo "Generating doxygen xml single file..."
237         $(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
238         ${doxygen_outdir}/xml/index.xml > ${api_xml};
239         $(STAMP) stamp-xml-single-doxygen
240
241 stamp-html-doxygen: ${doxygen_outdir}/html
242         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
243           builddir=`cd ..; ${PWD_COMMAND}`; \
244           ${SHELL} ${doxygen_script} \
245           --host_alias=${host_alias} --mode=html $${srcdir} $${builddir} YES)
246         $(STAMP) stamp-html-doxygen
247
248 stamp-latex-doxygen: ${doxygen_outdir}/latex
249         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
250           builddir=`cd ..; ${PWD_COMMAND}`; \
251           ${SHELL} ${doxygen_script} \
252           --host_alias=${host_alias} --mode=latex $${srcdir} $${builddir} NO)
253         $(STAMP) stamp-latex-doxygen
254
255 # Chance of loooooonnggg creation time on this rule.  Iff this fails,
256 # look at refman.log and see if TeX's memory is exhausted. Symptoms
257 # include asking a wizard to enlarge capacity. If this is the case,
258 # find texmf.cnf and add a zero for pool_size, string_vacancies,
259 # max_strings, and pool_free values.
260 stamp-pdf-doxygen: stamp-latex-doxygen ${doxygen_outdir}/pdf
261         -(cd ${doxygen_outdir}/latex && $(MAKE) -i pdf;)
262         echo "Generating doxygen pdf file...";
263         if [ -f ${doxygen_pdf} ]; then \
264           mv ${doxygen_pdf} ${api_pdf} ; \
265           echo ":: PDF file is ${api_pdf}"; \
266         else \
267           echo "... error"; \
268           exit 12; \
269         fi
270         $(STAMP) stamp-pdf-doxygen
271
272 stamp-man-doxygen: ${doxygen_outdir}/man
273         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
274           builddir=`cd ..; ${PWD_COMMAND}`; \
275           ${SHELL} ${doxygen_script} \
276           --host_alias=${host_alias} --mode=man $${srcdir} $${builddir} YES)
277         $(STAMP) stamp-man-doxygen
278
279 doc-xml-doxygen: stamp-xml-doxygen
280 doc-xml-single-doxygen: stamp-xml-single-doxygen
281 doc-html-doxygen: stamp-html-doxygen
282 doc-latex-doxygen: stamp-latex-doxygen
283 doc-pdf-doxygen: stamp-pdf-doxygen
284 doc-man-doxygen: stamp-man-doxygen
285
286
287 # Docbook configuration.
288 # Assumes
289 # libxslt
290 # dblatex
291 # pdflatex
292 # docbook-style-xsl
293 # emacs-nxml-mode
294 docbook_outdir = ${glibcxx_builddir}/doc/docbook
295 xml_dir = ${glibcxx_srcdir}/doc/xml
296
297 xml_sources_basic = \
298         ${xml_dir}/spine.xml \
299         ${xml_dir}/authors.xml \
300         ${xml_dir}/api.xml \
301         ${xml_dir}/faq.xml
302
303 xml_sources_manual = \
304         ${xml_dir}/manual/abi.xml \
305         ${xml_dir}/manual/algorithms.xml \
306         ${xml_dir}/manual/allocator.xml \
307         ${xml_dir}/manual/auto_ptr.xml \
308         ${xml_dir}/manual/atomics.xml \
309         ${xml_dir}/manual/backwards_compatibility.xml \
310         ${xml_dir}/manual/bitmap_allocator.xml \
311         ${xml_dir}/manual/build_hacking.xml \
312         ${xml_dir}/manual/codecvt.xml \
313         ${xml_dir}/manual/concurrency.xml \
314         ${xml_dir}/manual/concurrency_extensions.xml \
315         ${xml_dir}/manual/configure.xml \
316         ${xml_dir}/manual/containers.xml \
317         ${xml_dir}/manual/ctype.xml \
318         ${xml_dir}/manual/debug_mode.xml \
319         ${xml_dir}/manual/debug.xml \
320         ${xml_dir}/manual/diagnostics.xml \
321         ${xml_dir}/manual/evolution.xml \
322         ${xml_dir}/manual/extensions.xml \
323         ${xml_dir}/manual/internals.xml \
324         ${xml_dir}/manual/intro.xml \
325         ${xml_dir}/manual/io.xml \
326         ${xml_dir}/manual/iterators.xml \
327         ${xml_dir}/manual/locale.xml \
328         ${xml_dir}/manual/localization.xml \
329         ${xml_dir}/manual/messages.xml \
330         ${xml_dir}/manual/mt_allocator.xml \
331         ${xml_dir}/manual/numerics.xml \
332         ${xml_dir}/manual/parallel_mode.xml \
333         ${xml_dir}/manual/prerequisites.xml \
334         ${xml_dir}/manual/profile_mode.xml \
335         ${xml_dir}/manual/shared_ptr.xml \
336         ${xml_dir}/manual/spine.xml \
337         ${xml_dir}/manual/status_cxx1998.xml \
338         ${xml_dir}/manual/status_cxx200x.xml \
339         ${xml_dir}/manual/status_cxxtr1.xml \
340         ${xml_dir}/manual/status_cxxtr24733.xml \
341         ${xml_dir}/manual/strings.xml \
342         ${xml_dir}/manual/support.xml \
343         ${xml_dir}/manual/test.xml \
344         ${xml_dir}/manual/using.xml \
345         ${xml_dir}/manual/using_exceptions.xml \
346         ${xml_dir}/manual/utilities.xml \
347         ${xml_dir}/manual/appendix_free.xml \
348         ${xml_dir}/manual/appendix_contributing.xml \
349         ${xml_dir}/manual/appendix_porting.xml
350
351 xml_sources_extra = \
352         ${xml_dir}/gnu/fdl-1.2.xml \
353         ${xml_dir}/gnu/fdl-1.3.xml \
354         ${xml_dir}/gnu/gpl-2.0.xml \
355         ${xml_dir}/gnu/gpl-3.0.xml
356
357 xml_sources = \
358         ${xml_sources_basic} \
359         ${xml_sources_manual} \
360         ${xml_sources_extra}
361
362 xml_noinst = \
363         ${xml_dir}/book.txml \
364         ${xml_dir}/chapter.txml \
365         ${xml_dir}/class.txml
366
367 XSLTPROC       = xsltproc
368 XSLTPROC_FLAGS = --nonet --xinclude
369 #XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-stylesheets
370 XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-ns-stylesheets
371 XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
372 #XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
373 #XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
374 #XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
375 XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml-1_1/chunk.xsl
376 XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml-1_1/docbook.xsl
377 XSL_EPUB_STYLE = $(XSL_STYLE_DIR)/epub/docbook.xsl
378
379 ${docbook_outdir}/epub:
380         mkdir -p ${docbook_outdir}/epub
381
382 ${docbook_outdir}/fo:
383         mkdir -p ${docbook_outdir}/fo
384
385 ${docbook_outdir}/html:
386         mkdir -p ${docbook_outdir}/html
387
388 ${docbook_outdir}/pdf:
389         mkdir -p ${docbook_outdir}/pdf
390
391 ${docbook_outdir}/texinfo:
392         mkdir -p ${docbook_outdir}/texinfo
393
394 ${docbook_outdir}/xml:
395         mkdir -p ${docbook_outdir}/xml
396
397 # Validate existing XML structure.
398 XMLLINT = xmllint
399 #LINT_FLAGS = --debug --xinclude --nsclean --postvalid --nowarning --nonet
400 #LINT_FLAGS = --xinclude --postvalid --noent --noblanks --noout
401 LINT_FLAGS = --debug --xinclude --noent --noblanks  --nonet --noout
402 #SCHEMA_FLAGS = --relaxng /usr/share/xml/docbook5/schema/rng/5.0/docbookxi.rng
403 SCHEMA_FLAGS = --dtdvalid /usr/share/xml/docbook5/schema/dtd/5.0/docbook.dtd
404 XMLLINT_FLAGS = --xinclude --nsclean --c14n --noent --noblanks --nocdata
405 XMLLINT_VALID_FLAGS = $(LINT_FLAGS) $(SCHEMA_FLAGS)
406 doc-xml-validate-docbook: $(xml_sources)
407         @echo "Generating XML validation log..."
408         $(XMLLINT) $(XMLLINT_VALID_FLAGS) ${top_srcdir}/doc/xml/spine.xml
409
410 # XML, all one page
411 # Some info on canonicalization
412 # http://www.mail-archive.com/help-texinfo@gnu.org/msg00864.html
413 manual_xml = ${docbook_outdir}/xml/libstdc++-manual-single.xml
414 set_xml = ${docbook_outdir}/xml/libstdc++-set-single.xml
415 stamp-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
416         @echo "Generating XML single..."
417         $(XMLLINT) $(XMLLINT_FLAGS) \
418         ${top_srcdir}/doc/xml/manual/spine.xml > ${manual_xml};
419         $(XMLLINT) $(XMLLINT_FLAGS) \
420         ${top_srcdir}/doc/xml/spine.xml > ${set_xml};
421         if [ ! -d "${docbook_outdir}/xml/images" ]; then \
422           $(LN_S) ${top_srcdir}/doc/xml/images ${docbook_outdir}/xml/; \
423         fi
424         $(STAMP) stamp-xml-single-docbook
425
426 doc-xml-single-docbook: stamp-xml-single-docbook
427
428 # HTML, index plus chapters
429 stamp-html-docbook: $(xml_sources) ${docbook_outdir}/html
430         @echo "Generating html files..."
431         $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
432         $(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
433         $(STAMP) stamp-html-docbook
434
435 doc-html-docbook: stamp-html-docbook
436
437 # HTML, all one page
438 manual_html = ${docbook_outdir}/html/libstdc++-manual-single.html
439 stamp-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
440         @echo "Generating html single file..."
441         $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${manual_html} \
442         $(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
443         $(STAMP) stamp-html-single-docbook
444
445 doc-html-single-docbook: stamp-html-single-docbook
446
447 # FO
448 stamp-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
449         @echo "Generating FO files..."
450         $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
451         $(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
452         $(STAMP) stamp-fo-docbook
453
454 doc-fo-docbook: stamp-fo-docbook
455
456 # PDF, via dblatex
457 manual_pdf = ${docbook_outdir}/pdf/libstdc++-manual.pdf
458 DBLATEX_FLAGS = --dump --verbose --pdf -o ${manual_pdf}
459 stamp-pdf-docbook: $(xml_sources) ${docbook_outdir}/pdf
460         @echo "Generating pdf dblatex files..."
461         dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
462         $(STAMP) stamp-pdf-docbook
463
464 doc-pdf-docbook: stamp-pdf-docbook
465
466 # TEXINFO, via docbook2X
467 # NB: Both experimental and tempermental
468 manual_texi = ${docbook_outdir}/texinfo/libstdc++-manual.texi
469 manual_info = ${docbook_outdir}/texinfo/libstdc++-manual.info
470 DB2TEXI_FLAGS = \
471         --encoding=utf-8//TRANSLIT \
472         --string-param output-file="libstdc++-manual" \
473         --string-param directory-category="GNU C++ Library" \
474         --string-param explicit-node-names=true
475
476 stamp-texinfo-docbook: stamp-xml-single-docbook ${docbook_outdir}/texinfo
477         @echo "Generating texinfo files..."
478         db2x_docbook2texi $(DB2TEXI_FLAGS) ${set_xml}
479         mv libstdc++-manual.texi ${manual_texi}
480         $(STAMP) stamp-texinfo-docbook
481
482 stamp-info-docbook: stamp-texinfo-docbook
483         @echo "Generating info files..."
484         $(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi}
485         $(STAMP) stamp-info-docbook
486
487 doc-texinfo-docbook: stamp-texinfo-docbook
488
489 doc-info-docbook: stamp-info-docbook
490
491 # EPUB, via dbtoepub + ruby
492 manual_epub = ${docbook_outdir}/epub/libstdc++-manual.epub
493 stamp-epub-docbook: stamp-xml-single-docbook ${docbook_outdir}/epub
494         @echo "Generating epub files..."
495         ${XSL_STYLE_DIR}/epub/bin/dbtoepub -v -d -o ${manual_epub} ${set_xml}
496         $(STAMP) stamp-epub-docbook
497
498 doc-epub-docbook: stamp-epub-docbook
499
500
501 # Performance doc and graph configuration.
502 # Assumes pychart, beautiful soup installed.
503 # Generates the plots and graphs for performance testing.
504 doc_performance_script=${top_srcdir}/scripts/make_graphs.py
505 doc-html-performance:
506         -@(chmod + ${doc_performance_script}; \
507         ${doc_performance_script} ${top_srcdir} \
508         ${glibcxx_builddir}/testsuite \
509         ${top_srcdir}/testsuite/data/make_graph_htmls.xml \
510         ${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
511
512
513 .PHONY: doc-doxygen-html doc-doxygen-man doc-performance
514
515 # By adding these files here, automake will remove them for 'make clean'
516 CLEANFILES = *.log stamp*
517
518 # To remove directories.
519 clean-local:
520         rm -rf man html pdf fo xml doxygen docbook ./libstdc++-* db2t*