1## Makefile for the doc subdirectory of the GNU C++ Standard library.
2##
3## Copyright (C) 2008-2022 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
23include $(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.
36if BUILD_XML
37STAMP_XML = doc-xml
38STAMP_INSTALL_XML = doc-install-xml
39else
40STAMP_XML =
41STAMP_INSTALL_XML =
42endif
43
44if BUILD_HTML
45STAMP_HTML = doc-html
46STAMP_INSTALL_HTML = doc-install-html
47else
48STAMP_HTML =
49STAMP_INSTALL_HTML =
50endif
51
52if BUILD_MAN
53STAMP_MAN = doc-man
54STAMP_INSTALL_MAN = doc-install-man
55else
56STAMP_MAN =
57STAMP_INSTALL_MAN =
58endif
59
60if BUILD_PDF
61STAMP_PDF = doc-pdf
62STAMP_INSTALL_PDF = doc-install-pdf
63else
64STAMP_PDF =
65STAMP_INSTALL_PDF =
66endif
67
68if BUILD_EPUB
69STAMP_EPUB = doc-epub
70STAMP_INSTALL_EPUB = doc-install-epub
71else
72STAMP_EPUB = doc-epub
73STAMP_INSTALL_EPUB = doc-install-epub
74endif
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
95xml: $(STAMP_XML)
96install-xml: $(STAMP_INSTALL_XML)
97
98html: $(STAMP_HTML)
99install-html: $(STAMP_INSTALL_HTML)
100
101man: $(STAMP_MAN)
102install-man: $(STAMP_INSTALL_MAN)
103
104pdf: $(STAMP_PDF)
105install-pdf: $(STAMP_INSTALL_PDF)
106
107epub: $(STAMP_EPUB)
108install-epub: $(STAMP_INSTALL_EPUB)
109
110info:
111install-info:
112
113ps:
114install-ps:
115
116dvi:
117install-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
126xmldir="$(DESTDIR)@docdir@"
127stamp-xml: stamp-xml-single-docbook stamp-xml-single-doxygen
128	$(STAMP) stamp-xml
129
130doc-xml: stamp-xml
131
132doc-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
138htmldir="$(DESTDIR)@docdir@"
139stamp-html: stamp-html-docbook-data stamp-html-doxygen
140	$(STAMP) stamp-html
141
142doc-html: stamp-html
143
144doc-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
150pdfdir="$(DESTDIR)@docdir@"
151stamp-pdf: stamp-pdf-docbook stamp-pdf-doxygen
152	$(STAMP) stamp-pdf
153
154doc-pdf: stamp-pdf
155
156doc-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
162mandir="$(DESTDIR)@mandir@"
163stamp-man: stamp-man-doxygen
164	$(STAMP) stamp-man
165
166doc-man: stamp-man
167
168doc-install-man: doc-man
169	test -z ${mandir} || $(mkinstalldirs) ${mandir}
170	cp -r ${doxygen_outdir}/man/man3 ${mandir}
171
172# TEXINFO,INFO
173infodir="$(DESTDIR)@infodir@"
174stamp-texinfo: stamp-texinfo-docbook
175	$(STAMP) stamp-texinfo
176
177stamp-info: stamp-info-docbook
178	$(STAMP) stamp-info
179
180doc-texinfo: stamp-texinfo
181
182doc-info: stamp-info
183
184doc-install-texinfo: doc-texinfo
185	test -z ${infodir} || $(mkinstalldirs) ${infodir}
186	$(INSTALL_DATA) ${manual_texi} ${infodir}
187
188doc-install-info: doc-info
189	test -z ${infodir} || $(mkinstalldirs) ${infodir}
190	$(INSTALL_DATA) ${manual_info} ${infodir}
191
192# EPUB
193# Assumes ruby installed
194epubdir="$(DESTDIR)@docdir@"
195stamp-epub: stamp-epub-docbook
196	$(STAMP) stamp-epub
197
198doc-epub: stamp-epub
199
200doc-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
207doxygen_script=${top_srcdir}/scripts/run_doxygen
208doxygen_outdir = ${glibcxx_builddir}/doc/doxygen
209api_xml = ${doxygen_outdir}/xml/libstdc++-api.xml
210doxygen_pdf = ${doxygen_outdir}/latex/refman.pdf
211api_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
228stamp-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 \
233	  "$${srcdir}" "$${builddir}" NO
234	$(STAMP) stamp-xml-doxygen
235
236stamp-xml-single-doxygen: stamp-xml-doxygen
237	@echo "Generating doxygen xml single file..."
238	$(XSLTPROC) ${doxygen_outdir}/xml/combine.xslt \
239	${doxygen_outdir}/xml/index.xml > ${api_xml};
240	$(STAMP) stamp-xml-single-doxygen
241
242stamp-html-doxygen: ${doxygen_outdir}/html
243	-srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
244	  builddir=`cd ..; ${PWD_COMMAND}`; \
245	  ${SHELL} ${doxygen_script} \
246	  --host_alias=${host_alias} --mode=html \
247	  "$${srcdir}" "$${builddir}" YES
248	$(STAMP) stamp-html-doxygen
249
250stamp-latex-doxygen: ${doxygen_outdir}/latex
251	-srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
252	  builddir=`cd ..; ${PWD_COMMAND}`; \
253	  ${SHELL} ${doxygen_script} \
254	  --host_alias=${host_alias} --mode=latex --latex_cmd=$(LATEX_CMD) \
255	  "$${srcdir}" "$${builddir}" NO
256	$(STAMP) stamp-latex-doxygen
257
258# Chance of loooooonnggg creation time on this rule.  Iff this fails,
259# look at refman.log and see if TeX's memory is exhausted. Symptoms
260# include asking a wizard to enlarge capacity. If this is the case,
261# find texmf.cnf and add a zero for pool_size, string_vacancies,
262# max_strings, and pool_free values. A much simpler workaround is to
263# install lualatex and set LATEX_CMD=lualatex when running make.
264# Errors like "File `foo.sty' not found" mean a TeX package is missing.
265stamp-pdf-doxygen: stamp-latex-doxygen ${doxygen_outdir}/pdf
266	@echo "Generating doxygen pdf file...";
267	-$(MAKE) -C ${doxygen_outdir}/latex -i pdf
268	@if [ -f ${doxygen_pdf} ]; then \
269	  mv ${doxygen_pdf} ${api_pdf} ; \
270	  echo ":: PDF file is ${api_pdf}"; \
271	else \
272	  echo "... error"; \
273	  grep -F 'LaTeX Error' ${doxygen_outdir}/latex/refman.log; \
274	  grep -F 'TeX capacity exceeded, sorry' ${doxygen_outdir}/latex/refman.log; \
275	  exit 12; \
276	fi
277	$(STAMP) stamp-pdf-doxygen
278
279stamp-man-doxygen: ${doxygen_outdir}/man
280	-srcdir=`cd ${top_srcdir}; ${PWD_COMMAND}`; \
281	  builddir=`cd ..; ${PWD_COMMAND}`; \
282	  ${SHELL} ${doxygen_script} \
283	  --host_alias=${host_alias} --mode=man \
284	  "$${srcdir}" "$${builddir}" YES
285	$(STAMP) stamp-man-doxygen
286
287doc-xml-doxygen: stamp-xml-doxygen
288doc-xml-single-doxygen: stamp-xml-single-doxygen
289doc-html-doxygen: stamp-html-doxygen
290doc-latex-doxygen: stamp-latex-doxygen
291doc-pdf-doxygen: stamp-pdf-doxygen
292doc-man-doxygen: stamp-man-doxygen
293
294
295# Docbook configuration.
296# Assumes
297# libxslt
298# dblatex
299# pdflatex
300# docbook-style-xsl
301# emacs-nxml-mode
302docbook_outdir = ${glibcxx_builddir}/doc/docbook
303xml_dir = ${glibcxx_srcdir}/doc/xml
304
305xml_sources_basic = \
306	${xml_dir}/spine.xml \
307	${xml_dir}/authors.xml \
308	${xml_dir}/api.xml \
309	${xml_dir}/faq.xml
310
311xml_sources_manual = \
312	${xml_dir}/manual/abi.xml \
313	${xml_dir}/manual/algorithms.xml \
314	${xml_dir}/manual/allocator.xml \
315	${xml_dir}/manual/auto_ptr.xml \
316	${xml_dir}/manual/atomics.xml \
317	${xml_dir}/manual/backwards_compatibility.xml \
318	${xml_dir}/manual/bitmap_allocator.xml \
319	${xml_dir}/manual/build_hacking.xml \
320	${xml_dir}/manual/codecvt.xml \
321	${xml_dir}/manual/concurrency.xml \
322	${xml_dir}/manual/concurrency_extensions.xml \
323	${xml_dir}/manual/configure.xml \
324	${xml_dir}/manual/containers.xml \
325	${xml_dir}/manual/ctype.xml \
326	${xml_dir}/manual/debug_mode.xml \
327	${xml_dir}/manual/debug.xml \
328	${xml_dir}/manual/diagnostics.xml \
329	${xml_dir}/manual/documentation_hacking.xml \
330	${xml_dir}/manual/evolution.xml \
331	${xml_dir}/manual/extensions.xml \
332	${xml_dir}/manual/internals.xml \
333	${xml_dir}/manual/intro.xml \
334	${xml_dir}/manual/io.xml \
335	${xml_dir}/manual/iterators.xml \
336	${xml_dir}/manual/locale.xml \
337	${xml_dir}/manual/localization.xml \
338	${xml_dir}/manual/messages.xml \
339	${xml_dir}/manual/mt_allocator.xml \
340	${xml_dir}/manual/numerics.xml \
341	${xml_dir}/manual/parallel_mode.xml \
342	${xml_dir}/manual/policy_data_structures.xml \
343	${xml_dir}/manual/policy_data_structures_biblio.xml \
344	${xml_dir}/manual/prerequisites.xml \
345	${xml_dir}/manual/shared_ptr.xml \
346	${xml_dir}/manual/spine.xml \
347	${xml_dir}/manual/status_cxx1998.xml \
348	${xml_dir}/manual/status_cxx2011.xml \
349	${xml_dir}/manual/status_cxx2014.xml \
350	${xml_dir}/manual/status_cxx2017.xml \
351	${xml_dir}/manual/status_cxx2020.xml \
352	${xml_dir}/manual/status_cxxtr1.xml \
353	${xml_dir}/manual/status_cxxtr24733.xml \
354	${xml_dir}/manual/strings.xml \
355	${xml_dir}/manual/support.xml \
356	${xml_dir}/manual/test.xml \
357	${xml_dir}/manual/test_policy_data_structures.xml \
358	${xml_dir}/manual/using.xml \
359	${xml_dir}/manual/using_exceptions.xml \
360	${xml_dir}/manual/utilities.xml \
361	${xml_dir}/manual/appendix_free.xml \
362	${xml_dir}/manual/appendix_contributing.xml \
363	${xml_dir}/manual/appendix_porting.xml
364
365xml_sources_extra = \
366	${xml_dir}/gnu/fdl-1.3.xml \
367	${xml_dir}/gnu/gpl-3.0.xml
368
369xml_sources = \
370	${xml_sources_basic} \
371	${xml_sources_manual} \
372	${xml_sources_extra}
373
374xml_image_dir = ${xml_dir}/images
375xml_image_basic = \
376	${xml_image_dir}/confdeps.png \
377	${xml_image_dir}/pbds_balls_and_bins.png \
378	${xml_image_dir}/pbds_container_tag_hierarchy.png \
379	${xml_image_dir}/pbds_different_underlying_dss_1.png \
380	${xml_image_dir}/pbds_different_underlying_dss_2.png \
381	${xml_image_dir}/pbds_embedded_lists_1.png \
382	${xml_image_dir}/pbds_embedded_lists_2.png \
383	${xml_image_dir}/pbds_embedded_lists_3.png \
384	${xml_image_dir}/pbds_exception_hierarchy.png \
385	${xml_image_dir}/pbds_hash_policy_cd.png \
386	${xml_image_dir}/pbds_hash_ranged_hash_range_hashing_fns.png \
387	${xml_image_dir}/pbds_hash_range_hashing_seq_diagram2.png \
388	${xml_image_dir}/pbds_hash_range_hashing_seq_diagram.png \
389	${xml_image_dir}/pbds_insert_resize_sequence_diagram1.png \
390	${xml_image_dir}/pbds_insert_resize_sequence_diagram2.png \
391	${xml_image_dir}/pbds_insert_resize_sequence_diagram3.png \
392	${xml_image_dir}/pbds_invalidation_guarantee_erase.png \
393	${xml_image_dir}/pbds_invalidation_tag_hierarchy.png \
394	${xml_image_dir}/pbds_list_update.png \
395	${xml_image_dir}/pbds_node_invariants.png \
396	${xml_image_dir}/pbds_pat_trie.png \
397	${xml_image_dir}/pbds_point_iterator_hierarchy.png \
398	${xml_image_dir}/pbds_point_iterators_range_ops_1.png \
399	${xml_image_dir}/pbds_point_iterators_range_ops_2.png \
400	${xml_image_dir}/pbds_priority_queue_different_underlying_dss.png \
401	${xml_image_dir}/pbds_priority_queue_tag_hierarchy.png \
402	${xml_image_dir}/pbds_rationale_null_node_updator.png \
403	${xml_image_dir}/pbds_resize_policy_cd.png \
404	${xml_image_dir}/pbds_restoring_node_invariants.png \
405	${xml_image_dir}/pbds_simple_list.png \
406	${xml_image_dir}/pbds_tree_node_invalidations.png \
407	${xml_image_dir}/pbds_tree_node_invariants.png \
408	${xml_image_dir}/pbds_tree_node_updator_policy_cd.png \
409	${xml_image_dir}/pbds_trie_node_updator_policy_cd.png \
410	${xml_image_dir}/pbds_update_seq_diagram.png
411
412xml_image_generated = \
413	${xml_image_dir}/pbds_binary_priority_queue_int_push_pop.png \
414	${xml_image_dir}/pbds_binary_priority_queue_int_push.png \
415	${xml_image_dir}/pbds_ccgp_hash_int_subscript_insert.png \
416	${xml_image_dir}/pbds_cc_hash_int_find.png \
417	${xml_image_dir}/pbds_cc_hash_int_subscript_find.png \
418	${xml_image_dir}/pbds_cc_hash_int_subscript_insert.png \
419	${xml_image_dir}/pbds_gp_hash_int_find.png \
420	${xml_image_dir}/pbds_gp_hash_int_subscript_find.png \
421	${xml_image_dir}/pbds_gp_hash_int_subscript_insert.png \
422	${xml_image_dir}/pbds_hash_int_erase_mem.png \
423	${xml_image_dir}/pbds_hash_text_find.png \
424	${xml_image_dir}/pbds_hash_zlob_int_find.png \
425	${xml_image_dir}/pbds_multimap_text_find_large_s2p_hash.png \
426	${xml_image_dir}/pbds_multimap_text_find_large_s2p_tree.png \
427	${xml_image_dir}/pbds_multimap_text_find_small_s2p_hash.png \
428	${xml_image_dir}/pbds_multimap_text_find_small_s2p_tree.png \
429	${xml_image_dir}/pbds_multimap_text_insert_large_s2p_hash.png \
430	${xml_image_dir}/pbds_multimap_text_insert_large_s2p_tree.png \
431	${xml_image_dir}/pbds_multimap_text_insert_mem_large_s2p_hash.png \
432	${xml_image_dir}/pbds_multimap_text_insert_mem_large_s2p_tree.png \
433	${xml_image_dir}/pbds_multimap_text_insert_mem_small_s2p_hash.png \
434	${xml_image_dir}/pbds_multimap_text_insert_mem_small_s2p_tree.png \
435	${xml_image_dir}/pbds_multimap_text_insert_small_s2p_hash.png \
436	${xml_image_dir}/pbds_multimap_text_insert_small_s2p_tree.png \
437	${xml_image_dir}/pbds_pairing_priority_queue_text_modify_down_thin.png \
438	${xml_image_dir}/pbds_pairing_priority_queue_text_modify_up_thin.png \
439	${xml_image_dir}/pbds_pairing_priority_queue_text_push_pop.png \
440	${xml_image_dir}/pbds_pairing_priority_queue_text_push.png \
441	${xml_image_dir}/pbds_priority_queue_int_push_pop.png \
442	${xml_image_dir}/pbds_priority_queue_int_push.png \
443	${xml_image_dir}/pbds_priority_queue_text_join.png \
444	${xml_image_dir}/pbds_priority_queue_text_modify_down.png \
445	${xml_image_dir}/pbds_priority_queue_text_modify_up.png \
446	${xml_image_dir}/pbds_priority_queue_text_pop_mem.png \
447	${xml_image_dir}/pbds_priority_queue_text_push_pop.png \
448	${xml_image_dir}/pbds_priority_queue_text_push.png \
449	${xml_image_dir}/pbds_tree_int_find.png \
450	${xml_image_dir}/pbds_tree_order_statistics.png \
451	${xml_image_dir}/pbds_tree_split_join.png \
452	${xml_image_dir}/pbds_tree_text_find.png \
453	${xml_image_dir}/pbds_tree_text_insert_node.png \
454	${xml_image_dir}/pbds_tree_text_insert_trie.png \
455	${xml_image_dir}/pbds_tree_text_insert_vector.png \
456	${xml_image_dir}/pbds_tree_text_lor_find.png
457
458xml_images = ${xml_image_basic} ${xml_image_generated}
459
460xml_noinst = \
461	${xml_dir}/book.txml \
462	${xml_dir}/chapter.txml \
463	${xml_dir}/class.txml \
464	${xml_image_dir}/confdeps.dot \
465	${xml_image_dir}/confdeps.pdf
466
467XSLTPROC       = xsltproc
468XSLT_FLAGS = --nonet --xinclude
469XSLT_PARAM = --param toc.section.depth 4 --param generate.consistent.ids 1
470#XSL_STYLE_DIR = /usr/share/xml/docbook/stylesheet/docbook-xsl-ns
471#XSL_STYLE_DIR = /usr/share/sgml/docbook/xsl-ns-stylesheets
472XSL_FO_STYLE = $(XSL_STYLE_DIR)/fo/docbook.xsl
473XSL_HTML_STYLE = $(XSL_STYLE_DIR)/xhtml/chunk.xsl
474XSL_HTML_SINGLE_STYLE = $(XSL_STYLE_DIR)/html/docbook.xsl
475XSL_EPUB_STYLE = $(XSL_STYLE_DIR)/epub3/chunk.xsl
476XSL_LOCAL_STYLE = ${glibcxx_builddir}/doc/xsl/customization.xsl
477
478${docbook_outdir}/epub:
479	mkdir -p ${docbook_outdir}/epub
480	mkdir -p ${docbook_outdir}/epub/OEBPS/images
481
482${docbook_outdir}/fo:
483	mkdir -p ${docbook_outdir}/fo
484
485${docbook_outdir}/html:
486	mkdir -p ${docbook_outdir}/html
487	mkdir -p ${docbook_outdir}/html/images
488	mkdir -p ${docbook_outdir}/html/manual
489
490${docbook_outdir}/pdf:
491	mkdir -p ${docbook_outdir}/pdf
492
493${docbook_outdir}/latex:
494	mkdir -p ${docbook_outdir}/latex
495
496${docbook_outdir}/texinfo:
497	mkdir -p ${docbook_outdir}/texinfo
498
499${docbook_outdir}/xml:
500	mkdir -p ${docbook_outdir}/xml
501
502
503# XML, all one page
504# Some info on canonicalization
505# http://www.mail-archive.com/help-texinfo@gnu.org/msg00864.html
506manual_xml = ${docbook_outdir}/xml/libstdc++-manual.xml
507set_xml = ${docbook_outdir}/xml/libstdc++-set.xml
508stamp-xml-single-docbook: $(xml_sources) ${docbook_outdir}/xml
509	@echo "Generating XML single..."
510	$(XMLLINT) $(XMLLINT_FLAGS) \
511	${top_srcdir}/doc/xml/manual/spine.xml > ${manual_xml};
512	$(XMLLINT) $(XMLLINT_FLAGS) \
513	${top_srcdir}/doc/xml/spine.xml > ${set_xml};
514	$(STAMP) stamp-xml-single-docbook
515
516doc-xml-single-docbook: stamp-xml-single-docbook
517
518# Validate existing XML structure.
519XMLLINT = xmllint
520LINT_FLAGS = --debug --xinclude --noent --noblanks --noout
521SCHEMA_FLAGS = --dtdvalid http://www.docbook.org/xml/5.0/dtd/docbook.dtd
522SCHEMA_RNG_FLAGS = --relaxng http://www.docbook.org/xml/5.0/rng/docbook.rng
523#SCHEMA_FLAGS = --nonet --dtdvalid /usr/share/xxx/dtd/5.0/docbook.dtd
524XMLLINT_VALID_FLAGS = $(LINT_FLAGS) $(SCHEMA_FLAGS)
525XMLLINT_FLAGS = --xinclude --nsclean --c14n --noent --noblanks --nocdata
526doc-xml-validate-docbook: doc-xml-validate-dtd-db
527
528doc-xml-validate-dtd-db: $(xml_sources) $(xml_images)
529	@echo "Generating XML validation log..."
530	$(XMLLINT) $(XMLLINT_VALID_FLAGS) ${top_srcdir}/doc/xml/spine.xml
531
532doc-xml-validate-rng-db: $(xml_sources) $(xml_images) doc-xml-single-docbook
533	@echo "Generating XML RelaxNG validation log..."
534	$(XMLLINT) $(LINT_FLAGS) $(SCHEMA_RNG_FLAGS) ${set_xml}
535
536# HTML support files
537stamp-html-docbook-images: stamp-html-docbook $(xml_images)
538	$(INSTALL_DATA)	$(xml_images) ${docbook_outdir}/html/images
539	$(STAMP) stamp-html-docbook-images
540
541stamp-html-docbook-data: stamp-html-docbook-images
542	$(STAMP) stamp-html-docbook-data
543
544# HTML, "chunked" into index plus chapters as separate pages
545stamp-html-docbook: $(xml_sources) ${docbook_outdir}/html
546	@echo "Generating html files..."
547	$(XSLTPROC) $(XSLT_PARAM) $(XSLT_FLAGS) -o ${docbook_outdir}/html/ \
548	 --stringparam chunker.output.encoding UTF-8 \
549	$(XSL_HTML_STYLE) \
550	${top_srcdir}/doc/xml/spine.xml
551	$(STAMP) stamp-html-docbook
552
553doc-html-docbook: stamp-html-docbook-data
554
555# Generate the HTML pages and copy them back to the source tree.
556doc-html-docbook-regenerate: doc-html-docbook
557	$(INSTALL_DATA) ${docbook_outdir}/html/*.html ${top_srcdir}/doc/html
558	$(INSTALL_DATA) ${docbook_outdir}/html/images/* ${top_srcdir}/doc/html/images
559	$(INSTALL_DATA) ${docbook_outdir}/html/manual/*.html ${top_srcdir}/doc/html/manual
560
561# HTML, all one page
562# NB: Have to generate customization XSL for UTF-8 output.
563manual_html = ${docbook_outdir}/html/libstdc++-manual-single.html
564stamp-html-single-docbook: $(xml_sources) ${docbook_outdir}/html
565	@echo "Generating html single file..."
566	$(XSLTPROC) $(XSLT_PARAM) $(XSLT_FLAGS) -o ${manual_html} \
567	${XSL_LOCAL_STYLE} \
568	${top_srcdir}/doc/xml/spine.xml
569	$(STAMP) stamp-html-single-docbook
570
571doc-html-single-docbook: stamp-html-single-docbook
572
573# FO
574stamp-fo-docbook: $(xml_sources) ${docbook_outdir}/fo
575	@echo "Generating FO files..."
576	$(XSLTPROC) $(XSLT_FLAGS) -o ${docbook_outdir}/fo/spine.fo \
577	$(XSL_FO_STYLE) ${top_srcdir}/doc/xml/spine.xml
578	$(STAMP) stamp-fo-docbook
579
580doc-fo-docbook: stamp-fo-docbook
581
582# PDF, via dblatex
583manual_pdf = ${docbook_outdir}/pdf/libstdc++-manual.pdf
584DBLATEX_FLAGS = --verbose --pdf --dump --debug --tmpdir=${docbook_outdir}/latex
585
586doc-pdf-docbook-dirs: ${docbook_outdir}/pdf ${docbook_outdir}/latex
587
588doc-pdf-docbook-pre: $(xml_sources) doc-pdf-docbook-dirs
589
590stamp-pdf-docbook: doc-pdf-docbook-pre doc-xml-single-docbook
591	@echo "Generating pdf dblatex files..."
592	dblatex $(DBLATEX_FLAGS) -o ${manual_pdf} \
593	${top_srcdir}/doc/xml/spine.xml
594	$(STAMP) stamp-pdf-docbook
595
596doc-pdf-docbook: stamp-pdf-docbook
597
598# TEXINFO, via docbook2X
599# NB: Both experimental and tempermental
600manual_texi = ${docbook_outdir}/texinfo/libstdc++-manual.texi
601manual_info = ${docbook_outdir}/texinfo/libstdc++-manual.info
602DB2TEXI_FLAGS = \
603	--encoding=utf-8//TRANSLIT \
604	--string-param output-file="libstdc++-manual" \
605	--string-param directory-category="GNU C++ Library" \
606	--string-param explicit-node-names=true
607
608stamp-texinfo-docbook: stamp-xml-single-docbook ${docbook_outdir}/texinfo
609	@echo "Generating texinfo files..."
610	db2x_docbook2texi $(DB2TEXI_FLAGS) ${set_xml}
611	mv libstdc++-manual.texi ${manual_texi}
612	$(STAMP) stamp-texinfo-docbook
613
614stamp-info-docbook: stamp-texinfo-docbook
615	@echo "Generating info files..."
616	$(MAKEINFO) $(MAKEINFOFLAGS) ${manual_texi}
617	$(STAMP) stamp-info-docbook
618
619doc-texinfo-docbook: stamp-texinfo-docbook
620
621doc-info-docbook: stamp-info-docbook
622
623# EPUB version 3
624# http://sourceforge.net/projects/docbook/files/epub3/
625# Can verify document with epubcheck
626manual_epub = ${docbook_outdir}/epub/libstdc++-manual.epub
627stamp-epub-docbook: stamp-xml-single-docbook ${docbook_outdir}/epub
628	@echo "Generating epub files..."
629	if [ ! -d "${docbook_outdir}/images" ]; then \
630	  $(LN_S) ${top_srcdir}/doc/xml/images ${docbook_outdir}/; \
631	fi
632	$(XSLTPROC) $(XSLT_PARAM) $(XSLT_FLAGS) \
633	--stringparam base.dir "${docbook_outdir}/epub/OEBPS/" \
634	$(XSL_EPUB_STYLE) ${top_srcdir}/doc/xml/spine.xml
635	$(INSTALL_DATA)	$(xml_images) ${docbook_outdir}/epub/OEBPS/images
636	zip -X0 ${manual_epub} ${docbook_outdir}/epub/mimetype
637	zip -r -X9 ${manual_epub} ${docbook_outdir}/epub/META-INF ${docbook_outdir}/epub/OEBPS
638	$(STAMP) stamp-epub-docbook
639
640doc-epub-docbook: stamp-epub-docbook
641
642# Performance doc and graph configuration.
643# Assumes pychart, beautiful soup installed.
644# Generates the plots/graph imagery for performance testing.
645doc_performance_script=${top_srcdir}/scripts/make_graph.py
646doc-svg-performance: ${docbook_outdir}/xml
647	-@(chmod + ${doc_performance_script}; \
648	${doc_performance_script} \
649	${top_srcdir}/testsuite/data/make_graph_test_infos.xml \
650	${glibcxx_builddir}/testsuite \
651	${glibcxx_builddir}/doc/docbook/xml/images)
652
653.PHONY: doc-doxygen-html doc-doxygen-man doc-performance
654
655# By adding these files here, automake will remove them for 'make clean'
656CLEANFILES = *.log stamp*
657
658# To remove directories.
659clean-local:
660	rm -rf man html pdf fo xml doxygen docbook ./libstdc++-* db2t*
661