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. And the second
29 # is the docbook markup in doc/xml/. A third and more obscure option
30 # deals with charting performance tests.
32 # Default, points to current best sub-rule that is the best conversion.
34 doc-man: doc-man-doxygen
37 doc-pdf: doc-pdf-docbook
40 doc-html: doc-html-docbook
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 doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
50 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
51 builddir=`cd ..; ${PWD_COMMAND}`; \
52 ${SHELL} ${doxygen_script} \
53 --host_alias=${host_alias} --mode=html $${srcdir} $${builddir} YES)
56 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
57 builddir=`cd ..; ${PWD_COMMAND}`; \
58 ${SHELL} ${doxygen_script} \
59 --host_alias=${host_alias} --mode=man $${srcdir} $${builddir} YES)
62 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
63 builddir=`cd ..; ${PWD_COMMAND}`; \
64 ${SHELL} ${doxygen_script} \
65 --host_alias=${host_alias} --mode=xml $${srcdir} $${builddir} NO)
67 doc-xml-single-doxygen:
68 @echo "Generating doxygen xml single file..."
69 $(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
70 ${doxygen_outdir}/xml/index.xml > ${doxygen_outdir}/xml/api-spine.xml;
73 -(srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
74 builddir=`cd ..; ${PWD_COMMAND}`; \
75 ${SHELL} ${doxygen_script} \
76 --host_alias=${host_alias} --mode=latex $${srcdir} $${builddir} NO)
78 # Chance of loooooonnggg creation time on this rule.
79 doc-pdf-doxygen: stamp-latex-doxygen
80 -(cd ${doxygen_outdir}/latex && $(MAKE) -i pdf;)
81 echo "Generating doxygen pdf file...";
82 if [ -f ${doxygen_pdf} ]; then \
83 echo "... ${doxygen_pdf}"; \
90 @if [ ! -f stamp-pdf-doxygen ]; then \
91 $(MAKE) doc-pdf-doxygen; \
93 $(STAMP) stamp-pdf-doxygen
96 @if [ ! -f stamp-xml-doxygen ]; then \
97 $(MAKE) doc-xml-doxygen; \
98 $(MAKE) doc-xml-single-doxygen; \
100 $(STAMP) stamp-xml-doxygen
103 @if [ ! -f stamp-latex-doxygen ]; then \
104 $(MAKE) doc-latex-doxygen; \
106 $(STAMP) stamp-latex-doxygen
108 # Docbook configuration.
116 docbook_outdir = ${glibcxx_builddir}/doc/docbook
117 xml_dir = ${glibcxx_srcdir}/doc/xml
119 xml_sources_basic = \
120 ${xml_dir}/spine.xml \
121 ${xml_dir}/authors.xml \
125 xml_sources_manual = \
126 ${xml_dir}/manual/abi.xml \
127 ${xml_dir}/manual/algorithms.xml \
128 ${xml_dir}/manual/allocator.xml \
129 ${xml_dir}/manual/auto_ptr.xml \
130 ${xml_dir}/manual/atomics.xml \
131 ${xml_dir}/manual/backwards_compatibility.xml \
132 ${xml_dir}/manual/bitmap_allocator.xml \
133 ${xml_dir}/manual/build_hacking.xml \
134 ${xml_dir}/manual/codecvt.xml \
135 ${xml_dir}/manual/concurrency.xml \
136 ${xml_dir}/manual/concurrency_extensions.xml \
137 ${xml_dir}/manual/configure.xml \
138 ${xml_dir}/manual/containers.xml \
139 ${xml_dir}/manual/ctype.xml \
140 ${xml_dir}/manual/debug_mode.xml \
141 ${xml_dir}/manual/debug.xml \
142 ${xml_dir}/manual/diagnostics.xml \
143 ${xml_dir}/manual/evolution.xml \
144 ${xml_dir}/manual/extensions.xml \
145 ${xml_dir}/manual/internals.xml \
146 ${xml_dir}/manual/intro.xml \
147 ${xml_dir}/manual/io.xml \
148 ${xml_dir}/manual/iterators.xml \
149 ${xml_dir}/manual/locale.xml \
150 ${xml_dir}/manual/localization.xml \
151 ${xml_dir}/manual/messages.xml \
152 ${xml_dir}/manual/mt_allocator.xml \
153 ${xml_dir}/manual/numerics.xml \
154 ${xml_dir}/manual/parallel_mode.xml \
155 ${xml_dir}/manual/prerequisites.xml \
156 ${xml_dir}/manual/profile_mode.xml \
157 ${xml_dir}/manual/shared_ptr.xml \
158 ${xml_dir}/manual/spine.xml \
159 ${xml_dir}/manual/status_cxx1998.xml \
160 ${xml_dir}/manual/status_cxx200x.xml \
161 ${xml_dir}/manual/status_cxxtr1.xml \
162 ${xml_dir}/manual/status_cxxtr24733.xml \
163 ${xml_dir}/manual/strings.xml \
164 ${xml_dir}/manual/support.xml \
165 ${xml_dir}/manual/test.xml \
166 ${xml_dir}/manual/using.xml \
167 ${xml_dir}/manual/using_exceptions.xml \
168 ${xml_dir}/manual/utilities.xml \
169 ${xml_dir}/manual/appendix_free.xml \
170 ${xml_dir}/manual/appendix_contributing.xml \
171 ${xml_dir}/manual/appendix_porting.xml
173 xml_sources_extra = \
174 ${xml_dir}/gnu/fdl-1.2.xml \
175 ${xml_dir}/gnu/fdl-1.3.xml \
176 ${xml_dir}/gnu/gpl-2.0.xml \
177 ${xml_dir}/gnu/gpl-3.0.xml
180 ${xml_sources_basic} \
181 ${xml_sources_manual} \
185 ${xml_dir}/book.txml \
186 ${xml_dir}/chapter.txml \
187 ${xml_dir}/class.txml
190 XSLTPROC_FLAGS = --nonet --xinclude
191 XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-stylesheets
192 XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
193 XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
194 #XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
195 XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
197 ${docbook_outdir}/html:
198 mkdir -p ${docbook_outdir}/html
200 ${docbook_outdir}/pdf:
201 mkdir -p ${docbook_outdir}/pdf
203 ${docbook_outdir}/fo:
204 mkdir -p ${docbook_outdir}/fo
206 ${docbook_outdir}/xml:
207 mkdir -p ${docbook_outdir}/xml
209 # Validate existing XML structure.
211 #LINT_FLAGS = --debug --nonet --xinclude --nsclean --postvalid --nowarning
212 #LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
213 LINT_FLAGS = --postvalid --debug --xinclude --noent --noblanks --nonet --noout
214 DTD_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
215 XMLLINT_FLAGS = $(LINT_FLAGS) $(DTD_FLAGS)
216 doc-xml-validate-docbook: $(xml_sources)
217 @echo "Generating XML validation log..."
218 $(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
220 doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
221 @echo "Generating XML single..."
222 $(XMLLINT) --xinclude --noent --noblanks \
223 -o ${docbook_outdir}/xml/spine-single.xml \
224 ${top_srcdir}/doc/xml/spine.xml
226 # HTML, index plus chapters
227 doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
228 @echo "Generating html files..."
229 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
230 $(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
233 doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
234 @echo "Generating html single file..."
235 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
236 $(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
239 doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
240 @echo "Generating FO files..."
241 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
242 $(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
248 doc-pdf-fop-xml-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf
249 @echo "Generating pdf fop files from xml..."
250 $(FOP) $(FOP_FLAGS) -xml ${top_srcdir}/doc/xml/spine.xml \
251 -xsl $(XSL_FO_STYLE) -pdf ${docbook_outdir}/pdf/spine.pdf
253 doc-pdf-fop-fo-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
254 @echo "Generating pdf fop files from fo..."
255 $(FOP) $(FOP_FLAGS) -fo ${docbook_outdir}/fo/spine.fo \
256 -pdf ${docbook_outdir}/pdf/spine.pdf
261 XML2PDF_FLAGS = -v pdf --skip-validation -o pdf
262 doc-pdf-xmlto-docbook: $(xml_sources) ${docbook_outdir}/pdf
263 @echo "Generating pdf xmlto files..."
264 $(XML2PDF) $(XML2PDF_FLAGS) ${top_srcdir}/doc/xml/spine.xml
269 XMLROFF_FLAGS = --format=pdf --backend=cairo --warn=1 --debug=1 --continue
270 doc-pdf-xmlroff-docbook: $(xml_sources) doc-fo
271 @echo "Generating pdf xmlroff files..."
272 $(XMLROFF) $(XMLROFF_FLAGS) ${docbook_outdir}/fo/spine.fo
277 PRINCE_FLAGS = --log prince.log -o pdf/spine.pdf
278 doc-pdf-prince-docbook: $(xml_sources) ${docbook_outdir}/pdf
279 @echo "Generating pdf prince files..."
280 $(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/xml/spine.xml
284 DBLATEX_FLAGS = --dump --verbose --pdf -o ${docbook_outdir}/pdf/manual.pdf
285 doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
286 @echo "Generating pdf dblatex files..."
287 dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
289 doc-pdf-docbook: doc-pdf-dblatex-docbook
292 # Performance doc and graph configuration.
293 # Assumes pychart, beautiful soup installed.
294 # Generates the plots and graphs for performance testing.
295 doc_performance_script=${top_srcdir}/scripts/make_graphs.py
296 doc-html-performance:
297 -@(chmod + ${doc_performance_script}; \
298 ${doc_performance_script} ${top_srcdir} \
299 ${glibcxx_builddir}/testsuite \
300 ${top_srcdir}/testsuite/data/make_graph_htmls.xml \
301 ${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
304 .PHONY: doc-doxygen-html doc-doxygen-man doc-performance
306 # By adding these files here, automake will remove them for 'make clean'
309 # To remove directories.
311 rm -rf man html pdf fo xml doxygen docbook stamp*