OSDN Git Service

2010-07-08 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 source materials for libstdc++ documentation.
28 # The first is the doxygen markup in libstdc++ sources. And the second
29 # is the docbook markup in doc/xml/. A third and more obscure option
30 # deals with charting performance tests.
31
32 # Default, points to current best sub-rule that is the best conversion.
33 # MAN
34 doc-man: doc-man-doxygen
35
36 # PDF
37 doc-pdf: doc-pdf-docbook
38
39 # HTML
40 doc-html: doc-html-docbook
41
42
43 # Doxygen configuration
44 # Assumes doxygen, graphviz (with dot), pdflatex installed
45 doxygen_script=${top_srcdir}/scripts/run_doxygen
46 doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
47
48 doc-html-doxygen:
49         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
50           builddir=`cd ..; ${PWD_COMMAND}`; \
51           ${SHELL} ${doxygen_script} \
52           --host_alias=${host_alias} --mode=html $${srcdir} $${builddir} YES)
53
54 doc-man-doxygen:
55         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
56           builddir=`cd ..; ${PWD_COMMAND}`; \
57           ${SHELL} ${doxygen_script} \
58           --host_alias=${host_alias} --mode=man $${srcdir} $${builddir} YES)
59
60 doc-xml-doxygen:
61         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
62           builddir=`cd ..; ${PWD_COMMAND}`; \
63           ${SHELL} ${doxygen_script} \
64           --host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
65
66 doc-xml-single-doxygen:
67         @echo "Generating doxygen xml single file..."
68         $(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
69         ${doxygen_outdir}/xml/index.xml > ${doxygen_outdir}/xml/api-spine.xml;
70
71 doc-latex-doxygen:
72         -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
73           builddir=`cd ..; ${PWD_COMMAND}`; \
74           ${SHELL} ${doxygen_script} \
75           --host_alias=${host_alias} --mode=latex $${srcdir} $${builddir} NO)
76
77 # Chance of loooooonnggg creation time on this rule.  Iff this fails,
78 # look at refman.log and see if TeX's memory is exhausted. Symptoms
79 # include asking a wizard to enlarge capacity. If this is the case,
80 # find texmf.cnf and add a zero for pool_size, string_vacancies,
81 # max_strings, and pool_free values.
82 doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
83 api_pdf = ${doxygen_outdir}/pdf/libstdc++-api.pdf
84
85 ${doxygen_outdir}/pdf:
86         mkdir -p ${doxygen_outdir}/pdf
87
88 doc-pdf-doxygen: stamp-latex-doxygen ${doxygen_outdir}/pdf
89         -(cd ${doxygen_outdir}/latex && $(MAKE) -i pdf;)
90         echo "Generating doxygen pdf file...";
91         if [ -f ${doxygen_pdf} ]; then \
92           mv ${doxygen_pdf} ${api_pdf} ; \
93           echo ":: PDF file is ${api_pdf}"; \
94         else \
95           echo "... error"; \
96           exit 12; \
97         fi
98
99 stamp-pdf-doxygen:
100         @if [ ! -f stamp-pdf-doxygen ]; then \
101           $(MAKE) doc-pdf-doxygen; \
102         fi
103         $(STAMP) stamp-pdf-doxygen
104
105 stamp-xml-doxygen:
106         @if [ ! -f stamp-xml-doxygen ]; then \
107           $(MAKE) doc-xml-doxygen; \
108           $(MAKE) doc-xml-single-doxygen; \
109         fi
110         $(STAMP) stamp-xml-doxygen
111
112 stamp-latex-doxygen:
113         @if [ ! -f stamp-latex-doxygen ]; then \
114           $(MAKE) doc-latex-doxygen; \
115         fi
116         $(STAMP) stamp-latex-doxygen
117
118 # Docbook configuration.
119 # Assumes
120 # libxslt
121 # dblatex
122 # pdflatex
123 # docbook-style-xsl
124 # emacs-nxml-mode
125 # xmlto passivetex
126 docbook_outdir = ${glibcxx_builddir}/doc/docbook
127 xml_dir = ${glibcxx_srcdir}/doc/xml
128
129 xml_sources_basic = \
130         ${xml_dir}/spine.xml \
131         ${xml_dir}/authors.xml \
132         ${xml_dir}/api.xml \
133         ${xml_dir}/faq.xml
134
135 xml_sources_manual = \
136         ${xml_dir}/manual/abi.xml \
137         ${xml_dir}/manual/algorithms.xml \
138         ${xml_dir}/manual/allocator.xml \
139         ${xml_dir}/manual/auto_ptr.xml \
140         ${xml_dir}/manual/atomics.xml \
141         ${xml_dir}/manual/backwards_compatibility.xml \
142         ${xml_dir}/manual/bitmap_allocator.xml \
143         ${xml_dir}/manual/build_hacking.xml \
144         ${xml_dir}/manual/codecvt.xml \
145         ${xml_dir}/manual/concurrency.xml \
146         ${xml_dir}/manual/concurrency_extensions.xml \
147         ${xml_dir}/manual/configure.xml \
148         ${xml_dir}/manual/containers.xml \
149         ${xml_dir}/manual/ctype.xml \
150         ${xml_dir}/manual/debug_mode.xml \
151         ${xml_dir}/manual/debug.xml \
152         ${xml_dir}/manual/diagnostics.xml \
153         ${xml_dir}/manual/evolution.xml \
154         ${xml_dir}/manual/extensions.xml \
155         ${xml_dir}/manual/internals.xml \
156         ${xml_dir}/manual/intro.xml \
157         ${xml_dir}/manual/io.xml \
158         ${xml_dir}/manual/iterators.xml \
159         ${xml_dir}/manual/locale.xml \
160         ${xml_dir}/manual/localization.xml \
161         ${xml_dir}/manual/messages.xml \
162         ${xml_dir}/manual/mt_allocator.xml \
163         ${xml_dir}/manual/numerics.xml \
164         ${xml_dir}/manual/parallel_mode.xml \
165         ${xml_dir}/manual/prerequisites.xml \
166         ${xml_dir}/manual/profile_mode.xml \
167         ${xml_dir}/manual/shared_ptr.xml \
168         ${xml_dir}/manual/spine.xml \
169         ${xml_dir}/manual/status_cxx1998.xml \
170         ${xml_dir}/manual/status_cxx200x.xml \
171         ${xml_dir}/manual/status_cxxtr1.xml \
172         ${xml_dir}/manual/status_cxxtr24733.xml \
173         ${xml_dir}/manual/strings.xml \
174         ${xml_dir}/manual/support.xml \
175         ${xml_dir}/manual/test.xml \
176         ${xml_dir}/manual/using.xml \
177         ${xml_dir}/manual/using_exceptions.xml \
178         ${xml_dir}/manual/utilities.xml \
179         ${xml_dir}/manual/appendix_free.xml \
180         ${xml_dir}/manual/appendix_contributing.xml \
181         ${xml_dir}/manual/appendix_porting.xml
182
183 xml_sources_extra = \
184         ${xml_dir}/gnu/fdl-1.2.xml \
185         ${xml_dir}/gnu/fdl-1.3.xml \
186         ${xml_dir}/gnu/gpl-2.0.xml \
187         ${xml_dir}/gnu/gpl-3.0.xml
188
189 xml_sources = \
190         ${xml_sources_basic} \
191         ${xml_sources_manual} \
192         ${xml_sources_extra}
193
194 xml_noinst = \
195         ${xml_dir}/book.txml \
196         ${xml_dir}/chapter.txml \
197         ${xml_dir}/class.txml
198
199 XSLTPROC       = xsltproc
200 XSLTPROC_FLAGS = --nonet --xinclude
201 XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-stylesheets
202 XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
203 XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
204 #XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
205 XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
206
207 ${docbook_outdir}/html:
208         mkdir -p ${docbook_outdir}/html
209
210 ${docbook_outdir}/pdf:
211         mkdir -p ${docbook_outdir}/pdf
212
213 ${docbook_outdir}/fo:
214         mkdir -p ${docbook_outdir}/fo
215
216 ${docbook_outdir}/xml:
217         mkdir -p ${docbook_outdir}/xml
218
219 # Validate existing XML structure.
220 XMLLINT = xmllint
221 #LINT_FLAGS = --debug --nonet --xinclude --nsclean --postvalid --nowarning
222 #LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
223 LINT_FLAGS = --postvalid --debug --xinclude --noent --noblanks  --nonet --noout
224 DTD_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
225 XMLLINT_FLAGS = $(LINT_FLAGS) $(DTD_FLAGS)
226 doc-xml-validate-docbook: $(xml_sources)
227         @echo "Generating XML validation log..."
228         $(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
229
230 doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
231         @echo "Generating XML single..."
232         $(XMLLINT) --xinclude --noent --noblanks \
233         -o ${docbook_outdir}/xml/spine-single.xml \
234         ${top_srcdir}/doc/xml/spine.xml
235
236 # HTML, index plus chapters
237 doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
238         @echo "Generating html files..."
239         $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
240         $(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
241
242 # HTML, all one page
243 doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
244         @echo "Generating html single file..."
245         $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
246         $(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
247
248 # FO
249 doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
250         @echo "Generating FO files..."
251         $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
252         $(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
253
254 # PDF 1
255 # fop
256 FOP = fop
257 FOP_FLAGS = -d -r
258 doc-pdf-fop-xml-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf
259         @echo "Generating pdf fop files from xml..."
260         $(FOP) $(FOP_FLAGS) -xml ${top_srcdir}/doc/xml/spine.xml \
261         -xsl $(XSL_FO_STYLE) -pdf ${docbook_outdir}/pdf/spine.pdf
262
263 doc-pdf-fop-fo-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
264         @echo "Generating pdf fop files from fo..."
265         $(FOP) $(FOP_FLAGS) -fo ${docbook_outdir}/fo/spine.fo \
266         -pdf ${docbook_outdir}/pdf/spine.pdf
267
268 # PDF 2
269 # xmlto
270 XML2PDF = xmlto
271 XML2PDF_FLAGS = -v pdf --skip-validation -o pdf
272 doc-pdf-xmlto-docbook: $(xml_sources) ${docbook_outdir}/pdf
273         @echo "Generating pdf xmlto files..."
274         $(XML2PDF) $(XML2PDF_FLAGS) ${top_srcdir}/doc/xml/spine.xml
275
276 # PDF 3
277 # xmlroff
278 XMLROFF = xmlroff
279 XMLROFF_FLAGS = --format=pdf --backend=cairo --warn=1 --debug=1 --continue
280 doc-pdf-xmlroff-docbook: $(xml_sources) doc-fo
281         @echo "Generating pdf xmlroff files..."
282         $(XMLROFF) $(XMLROFF_FLAGS) ${docbook_outdir}/fo/spine.fo
283
284 # PDF 4
285 # prince
286 PRINCE = prince
287 PRINCE_FLAGS = --log prince.log -o pdf/spine.pdf
288 doc-pdf-prince-docbook: $(xml_sources) ${docbook_outdir}/pdf
289         @echo "Generating pdf prince files..."
290         $(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/xml/spine.xml
291
292 # PDF 5
293 # dblatex
294 DBLATEX_FLAGS = --dump --verbose --pdf -o ${docbook_outdir}/pdf/manual.pdf
295 doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
296         @echo "Generating pdf dblatex files..."
297         dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
298
299 doc-pdf-docbook: doc-pdf-dblatex-docbook
300
301
302 # Performance doc and graph configuration.
303 # Assumes pychart, beautiful soup installed.
304 # Generates the plots and graphs for performance testing.
305 doc_performance_script=${top_srcdir}/scripts/make_graphs.py
306 doc-html-performance:
307         -@(chmod + ${doc_performance_script}; \
308         ${doc_performance_script} ${top_srcdir} \
309         ${glibcxx_builddir}/testsuite \
310         ${top_srcdir}/testsuite/data/make_graph_htmls.xml \
311         ${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
312
313
314 .PHONY: doc-doxygen-html doc-doxygen-man doc-performance
315
316 # By adding these files here, automake will remove them for 'make clean'
317 CLEANFILES = *.log
318
319 # To remove directories.
320 clean-local:
321         rm -rf man html pdf fo xml doxygen docbook stamp*