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/gpl-2.0.xml \
176 ${xml_dir}/gnu/gpl-3.0.xml
179 ${xml_sources_basic} \
180 ${xml_sources_manual} \
184 ${xml_dir}/book.txml \
185 ${xml_dir}/chapter.txml \
186 ${xml_dir}/class.txml
189 XSLTPROC_FLAGS = --nonet --xinclude
190 XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-stylesheets
191 XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
192 XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
193 #XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/onechunk.xsl
194 XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/xhtml/docbook.xsl
196 ${docbook_outdir}/html:
197 mkdir -p ${docbook_outdir}/html
199 ${docbook_outdir}/pdf:
200 mkdir -p ${docbook_outdir}/pdf
202 ${docbook_outdir}/fo:
203 mkdir -p ${docbook_outdir}/fo
205 ${docbook_outdir}/xml:
206 mkdir -p ${docbook_outdir}/xml
208 # Validate existing XML structure.
210 #LINT_FLAGS = --debug --nonet --xinclude --nsclean --postvalid --nowarning
211 #LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
212 LINT_FLAGS = --postvalid --debug --xinclude --noent --noblanks --nonet --noout
213 DTD_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
214 XMLLINT_FLAGS = $(LINT_FLAGS) $(DTD_FLAGS)
215 doc-xml-validate-docbook: $(xml_sources)
216 @echo "Generating XML validation log..."
217 $(XMLLINT) $(XMLLINT_FLAGS) ${top_srcdir}/doc/xml/spine.xml
219 doc-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
220 @echo "Generating XML single..."
221 $(XMLLINT) --xinclude --noent --noblanks \
222 -o ${docbook_outdir}/xml/spine-single.xml \
223 ${top_srcdir}/doc/xml/spine.xml
225 # HTML, index plus chapters
226 doc-html-docbook: $(xml_sources) ${docbook_outdir}/html
227 @echo "Generating html files..."
228 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
229 $(XSL_HTML_STYLE) ${top_srcdir}/doc/xml/spine.xml
232 doc-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
233 @echo "Generating html single file..."
234 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/html/ \
235 $(XSL_HTML_SINGLE_STYLE) ${top_srcdir}/doc/xml/spine.xml
238 doc-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
239 @echo "Generating FO files..."
240 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
241 $(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
247 doc-pdf-fop-xml-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf
248 @echo "Generating pdf fop files from xml..."
249 $(FOP) $(FOP_FLAGS) -xml ${top_srcdir}/doc/xml/spine.xml \
250 -xsl $(XSL_FO_STYLE) -pdf ${docbook_outdir}/pdf/spine.pdf
252 doc-pdf-fop-fo-docbook: $(xml_sources) ${glibcxx_builddir}/doc/pdf doc-fo
253 @echo "Generating pdf fop files from fo..."
254 $(FOP) $(FOP_FLAGS) -fo ${docbook_outdir}/fo/spine.fo \
255 -pdf ${docbook_outdir}/pdf/spine.pdf
260 XML2PDF_FLAGS = -v pdf --skip-validation -o pdf
261 doc-pdf-xmlto-docbook: $(xml_sources) ${docbook_outdir}/pdf
262 @echo "Generating pdf xmlto files..."
263 $(XML2PDF) $(XML2PDF_FLAGS) ${top_srcdir}/doc/xml/spine.xml
268 XMLROFF_FLAGS = --format=pdf --backend=cairo --warn=1 --debug=1 --continue
269 doc-pdf-xmlroff-docbook: $(xml_sources) doc-fo
270 @echo "Generating pdf xmlroff files..."
271 $(XMLROFF) $(XMLROFF_FLAGS) ${docbook_outdir}/fo/spine.fo
276 PRINCE_FLAGS = --log prince.log -o pdf/spine.pdf
277 doc-pdf-prince-docbook: $(xml_sources) ${docbook_outdir}/pdf
278 @echo "Generating pdf prince files..."
279 $(PRINCE) $(PRINCE_FLAGS) ${top_srcdir}/xml/spine.xml
283 DBLATEX_FLAGS = --dump --verbose --pdf -o ${docbook_outdir}/pdf/manual.pdf
284 doc-pdf-dblatex-docbook: $(xml_sources) ${docbook_outdir}/pdf
285 @echo "Generating pdf dblatex files..."
286 dblatex $(DBLATEX_FLAGS) ${top_srcdir}/doc/xml/spine.xml
288 doc-pdf-docbook: doc-pdf-dblatex-docbook
291 # Performance doc and graph configuration.
292 # Assumes pychart, beautiful soup installed.
293 # Generates the plots and graphs for performance testing.
294 doc_performance_script=${top_srcdir}/scripts/make_graphs.py
295 doc-html-performance:
296 -@(chmod + ${doc_performance_script}; \
297 ${doc_performance_script} ${top_srcdir} \
298 ${glibcxx_builddir}/testsuite \
299 ${top_srcdir}/testsuite/data/make_graph_htmls.xml \
300 ${top_srcdir}/testsuite/data/make_graph_test_infos.xml local g++)
303 .PHONY: doc-doxygen-html doc-doxygen-man doc-performance
305 # By adding these files here, automake will remove them for 'make clean'
308 # To remove directories.
310 rm -rf man html pdf fo xml doxygen docbook stamp*