1 ## Makefile for the doc subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
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)
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.
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/>.
23 include $(top_srcdir)/fragment.am
25 # Documentation Overview
27 # There are two main source 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 docbook markup in
32 # A third and more obscure option deals with charting
33 # performance tests, and should be considered experimental.
37 # Point to best sub-rule for the requested documentation target,
38 # create, and then copy into toplevel directory with standardized names
42 doc-html: doc-html-docbook doc-html-doxygen
43 cp -R ${docbook_outdir}/html ./libstdc++-manual.html
44 cp -R ${doxygen_outdir}/html ./libstdc++-api.html
47 doc-man: doc-man-doxygen
48 cp -R ${doxygen_outdir}/man ./libstdc++-api.man
51 doc-pdf: doc-pdf-docbook doc-pdf-doxygen
52 cp ${docbook_outdir}/pdf/libstdc++-manual.pdf .
53 cp ${doxygen_outdir}/pdf/libstdc++-api.pdf .
56 doc-texinfo: doc-texinfo-docbook
59 doc-xml: doc-xml-single-docbook doc-xml-single-doxygen
64 # Doxygen configuration
65 # Assumes doxygen, graphviz (with dot), pdflatex installed
66 doxygen_script=${top_srcdir}/scripts/run_doxygen
67 doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
70 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
71 builddir=`cd ..; ${PWD_COMMAND}`; \
72 ${SHELL} ${doxygen_script} \
73 --host_alias=${host_alias} --mode=html $${srcdir} $${builddir} YES)
76 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
77 builddir=`cd ..; ${PWD_COMMAND}`; \
78 ${SHELL} ${doxygen_script} \
79 --host_alias=${host_alias} --mode=man $${srcdir} $${builddir} YES)
82 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
83 builddir=`cd ..; ${PWD_COMMAND}`; \
84 ${SHELL} ${doxygen_script} \
85 --host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
87 api_xml = ${doxygen_outdir}/xml/libstdc++-api-single.xml
88 doc-xml-single-doxygen: doc-xml-doxygen
89 @echo "Generating doxygen xml single file..."
90 $(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
91 ${doxygen_outdir}/xml/index.xml > ${api_xml};
94 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
95 builddir=`cd ..; ${PWD_COMMAND}`; \
96 ${SHELL} ${doxygen_script} \
97 --host_alias=${host_alias} --mode=latex $${srcdir} $${builddir} NO)
99 # Chance of loooooonnggg creation time on this rule. Iff this fails,
100 # look at refman.log and see if TeX's memory is exhausted. Symptoms
101 # include asking a wizard to enlarge capacity. If this is the case,
102 # find texmf.cnf and add a zero for pool_size, string_vacancies,
103 # max_strings, and pool_free values.
104 doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
105 api_pdf = ${doxygen_outdir}/pdf/libstdc++-api.pdf
107 ${doxygen_outdir}/pdf:
108 mkdir -p ${doxygen_outdir}/pdf
110 doc-pdf-doxygen: stamp-latex-doxygen ${doxygen_outdir}/pdf
111 -(cd ${doxygen_outdir}/latex && $(MAKE) -i pdf;)
112 echo "Generating doxygen pdf file...";
113 if [ -f ${doxygen_pdf} ]; then \
114 mv ${doxygen_pdf} ${api_pdf} ; \
115 echo ":: PDF file is ${api_pdf}"; \
122 @if [ ! -f stamp-pdf-doxygen ]; then \
123 $(MAKE) doc-pdf-doxygen; \
125 $(STAMP) stamp-pdf-doxygen
128 @if [ ! -f stamp-xml-doxygen ]; then \
129 $(MAKE) doc-xml-doxygen; \
130 $(MAKE) doc-xml-single-doxygen; \
132 $(STAMP) stamp-xml-doxygen
135 @if [ ! -f stamp-latex-doxygen ]; then \
136 $(MAKE) doc-latex-doxygen; \
138 $(STAMP) stamp-latex-doxygen
140 # Docbook configuration.
148 docbook_outdir = ${glibcxx_builddir}/doc/docbook
149 xml_dir = ${glibcxx_srcdir}/doc/xml
151 xml_sources_basic = \
152 ${xml_dir}/spine.xml \
153 ${xml_dir}/authors.xml \
157 xml_sources_manual = \
158 ${xml_dir}/manual/abi.xml \
159 ${xml_dir}/manual/algorithms.xml \
160 ${xml_dir}/manual/allocator.xml \
161 ${xml_dir}/manual/auto_ptr.xml \
162 ${xml_dir}/manual/atomics.xml \
163 ${xml_dir}/manual/backwards_compatibility.xml \
164 ${xml_dir}/manual/bitmap_allocator.xml \
165 ${xml_dir}/manual/build_hacking.xml \
166 ${xml_dir}/manual/codecvt.xml \
167 ${xml_dir}/manual/concurrency.xml \
168 ${xml_dir}/manual/concurrency_extensions.xml \
169 ${xml_dir}/manual/configure.xml \
170 ${xml_dir}/manual/containers.xml \
171 ${xml_dir}/manual/ctype.xml \
172 ${xml_dir}/manual/debug_mode.xml \
173 ${xml_dir}/manual/debug.xml \
174 ${xml_dir}/manual/diagnostics.xml \
175 ${xml_dir}/manual/evolution.xml \
176 ${xml_dir}/manual/extensions.xml \
177 ${xml_dir}/manual/internals.xml \
178 ${xml_dir}/manual/intro.xml \
179 ${xml_dir}/manual/io.xml \
180 ${xml_dir}/manual/iterators.xml \
181 ${xml_dir}/manual/locale.xml \
182 ${xml_dir}/manual/localization.xml \
183 ${xml_dir}/manual/messages.xml \
184 ${xml_dir}/manual/mt_allocator.xml \
185 ${xml_dir}/manual/numerics.xml \
186 ${xml_dir}/manual/parallel_mode.xml \
187 ${xml_dir}/manual/prerequisites.xml \
188 ${xml_dir}/manual/profile_mode.xml \
189 ${xml_dir}/manual/shared_ptr.xml \
190 ${xml_dir}/manual/spine.xml \
191 ${xml_dir}/manual/status_cxx1998.xml \
192 ${xml_dir}/manual/status_cxx200x.xml \
193 ${xml_dir}/manual/status_cxxtr1.xml \
194 ${xml_dir}/manual/status_cxxtr24733.xml \
195 ${xml_dir}/manual/strings.xml \
196 ${xml_dir}/manual/support.xml \
197 ${xml_dir}/manual/test.xml \
198 ${xml_dir}/manual/using.xml \
199 ${xml_dir}/manual/using_exceptions.xml \
200 ${xml_dir}/manual/utilities.xml \
201 ${xml_dir}/manual/appendix_free.xml \
202 ${xml_dir}/manual/appendix_contributing.xml \
203 ${xml_dir}/manual/appendix_porting.xml
205 xml_sources_extra = \
206 ${xml_dir}/gnu/fdl-1.2.xml \
207 ${xml_dir}/gnu/fdl-1.3.xml \
208 ${xml_dir}/gnu/gpl-2.0.xml \
209 ${xml_dir}/gnu/gpl-3.0.xml
212 ${xml_sources_basic} \
213 ${xml_sources_manual} \
217 ${xml_dir}/book.txml \
218 ${xml_dir}/chapter.txml \
219 ${xml_dir}/class.txml
222 XSLTPROC_FLAGS = --nonet --xinclude
223 XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-ns-stylesheets
224 XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
225 XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
226 #XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
227 XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
229 ${docbook_outdir}/fo:
230 mkdir -p ${docbook_outdir}/fo
232 ${docbook_outdir}/html:
233 mkdir -p ${docbook_outdir}/html
235 ${docbook_outdir}/pdf:
236 mkdir -p ${docbook_outdir}/pdf
238 ${docbook_outdir}/texinfo:
239 mkdir -p ${docbook_outdir}/texinfo
241 ${docbook_outdir}/xml:
242 mkdir -p ${docbook_outdir}/xml
244 # Validate existing XML structure.
246 #LINT_FLAGS = --debug --nonet --xinclude --nsclean --postvalid --nowarning
247 #LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
248 LINT_FLAGS = --debug --xinclude --noent --noblanks --nonet --noout
249 #SCHEMA_FLAGS = --relaxng /usr/share/xml/docbook5/schema/rng/5.0/docbookxi.rng
250 SCHEMA_FLAGS = --dtdvalid /usr/share/xml/docbook5/schema/dtd/5.0/docbook.dtd
251 XMLLINT_FLAGS = $(LINT_FLAGS) $(SCHEMA_FLAGS)
252 doc-xml-validate-docbook: $(xml_sources)
253 @echo "Generating XML validation log..."
254 $(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
257 # Some info on canonicalization
258 # http://www.mail-archive.com/help-texinfo@gnu.org/msg00864.html
259 manual_xml = ${docbook_outdir}/xml/libstdc++-manual-single.xml
260 doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
261 @echo "Generating XML single..."
262 $(XMLLINT) --xinclude --noent --noblanks --nocdata --nsclean --c14n \
263 ${top_srcdir}/doc/xml/manual/spine.xml > ${manual_xml}
265 # HTML, index plus chapters
266 doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
267 @echo "Generating html files..."
268 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
269 $(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
272 manual_html = ${docbook_outdir}/html/libstdc++-manual-single.html
273 doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
274 @echo "Generating html single file..."
275 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${manual_html} \
276 $(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
279 doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
280 @echo "Generating FO files..."
281 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
282 $(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
285 manual_pdf = ${docbook_outdir}/pdf/libstdc++-manual.pdf
286 DBLATEX_FLAGS = --dump --verbose --pdf -o ${manual_pdf}
287 doc-pdf-docbook: doc-pdf-dblatex-docbook
289 doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
290 @echo "Generating pdf dblatex files..."
291 dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
293 # Texinfo, via docbook2X
295 --encoding=utf-8//TRANSLIT \
296 --string-param output-file="libstdc++-manual" \
297 --string-param directory-category="GNU C++ Library" \
298 --string-param explicit-node-names=true
299 doc-texinfo-docbook: doc-xml-single-docbook ${docbook_outdir}/texinfo
300 @echo "Generating texinfo files..."
301 db2x_docbook2texi $(DB2TEXI_FLAGS) ${manual_xml}
304 # Performance doc and graph configuration.
305 # Assumes pychart, beautiful soup installed.
306 # Generates the plots and graphs for performance testing.
307 doc_performance_script=${top_srcdir}/scripts/make_graphs.py
308 doc-html-performance:
309 -@(chmod + ${doc_performance_script}; \
310 ${doc_performance_script} ${top_srcdir} \
311 ${glibcxx_builddir}/testsuite \
312 ${top_srcdir}/testsuite/data/make_graph_htmls.xml \
313 ${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
316 .PHONY: doc-doxygen-html doc-doxygen-man doc-performance
318 # By adding these files here, automake will remove them for 'make clean'
321 # To remove directories.
323 rm -rf man html pdf fo xml doxygen docbook stamp* ./libstdc++-* db2t*