Handle <title> in SVG
[xapian.git] / xapian-core / docs / Makefile.am
blob6911af3cec08a5b29a40f65462f0cd690a905206
1 ## Process this file with automake to produce Makefile.in
3 if MAINTAINER_MODE
4 # Export these so that we run the locally installed autotools when building
5 # from a bootstrapped git tree.
6 export ACLOCAL AUTOCONF AUTOHEADER AUTOM4TE AUTOMAKE
7 endif
9 # Note: we don't want dist tarballs built with docs missing, so for simplicity
10 # this Makefile.am blindly assumes the tools are in place when "make dist" is
11 # being run.  For "make all", "make check", etc we carefully skip any docs
12 # which we don't have the tools to generate.
14 RSTDOCS = \
15         admin_notes.rst \
16         bm25.rst \
17         collapsing.rst \
18         deprecation.rst \
19         facets.rst \
20         geospatial.rst \
21         glossary.rst \
22         index.rst \
23         install.rst \
24         internals.rst \
25         intro_ir.rst \
26         matcherdesign.rst \
27         overview.rst \
28         postingsource.rst \
29         queryparser.rst \
30         remote.rst \
31         replication.rst \
32         scalability.rst \
33         serialisation.rst \
34         sorting.rst \
35         spelling.rst \
36         stemming.rst \
37         synonyms.rst \
38         termgenerator.rst \
39         tests.rst \
40         valueranges.rst
42 RSTHTML = $(RSTDOCS:.rst=.html)
44 # Files which should be put in the distribution by automake
45 EXTRA_DIST = doxygen_api.conf.in doxygen_source.conf.in \
46         doxygen_api_header.html_tmpl doxygen_api_footer.html_tmpl \
47         doxygen_source_header.html_tmpl doxygen_source_footer.html_tmpl \
48         $(RSTDOCS) $(HTMLDOCS) $(RSTHTML)
50 # Other files which should be distributed
51 dist-hook: doxygen_api_docs
52         $(MKDIR_P) '$(distdir)/apidoc/html'
53         for e in png css html js ; do \
54           test "`echo $(srcdir)/apidoc/html/*.$$e`" = "$(srcdir)/apidoc/html/*.$$e" || \
55             cp -p $(srcdir)/apidoc/html/*.$$e $(distdir)/apidoc/html ;\
56           test "`echo apidoc/html/*.$$e`" = "apidoc/html/*.$$e" || \
57             cp -p apidoc/html/*.$$e $(distdir)/apidoc/html ;\
58         done
60 # Disable these rules if configured with --enable-maintainer-mode and
61 # --disable-documentation so that "make install" works in this case.
62 if !MAINTAINER_NO_DOCS
63 doc_DATA = $(HTMLDOCS) $(RSTHTML)
65 install-data-local: doxygen_api_docs
66         $(mkinstalldirs) $(DESTDIR)$(docdir)/apidoc/html
67         $(INSTALL_DATA) `test -f apidoc/html/index.html || echo $(srcdir)/`apidoc/html/*.png $(DESTDIR)$(docdir)/apidoc/html
68         $(INSTALL_DATA) `test -f apidoc/html/index.html || echo $(srcdir)/`apidoc/html/*.css $(DESTDIR)$(docdir)/apidoc/html
69         $(INSTALL_DATA) `test -f apidoc/html/index.html || echo $(srcdir)/`apidoc/html/*.html $(DESTDIR)$(docdir)/apidoc/html
70         $(INSTALL_DATA) `test -f apidoc/html/index.html || echo $(srcdir)/`apidoc/html/*.js $(DESTDIR)$(docdir)/apidoc/html
71 endif
73 ###############################
74 # How to clean up local files #
75 ###############################
77 maintainer-clean-local:
78         rm -rf apidoc sourcedoc
80 ################################
81 # How to uninstall local files #
82 ################################
83 uninstall-local:
84         rm -rf $(DESTDIR)$(docdir)/apidoc
86 MAINTAINERCLEANFILES = doxygen_api.conf doxygen_source.conf \
87         apidoc.pdf \
88         $(RSTHTML)
90 .PHONY: doxygen_source_docs doxygen_api_docs doxygen_docs
92 doxygen_source_docs: sourcedoc/html/index.html
93 doxygen_api_docs: apidoc/html/index.html
94 doxygen_docs: doxygen_source_docs doxygen_api_docs
96 if DOCUMENTATION_RULES
97 # Build API docs with doxygen
98 all-local: doxygen_api_docs
100 # We use $T instead of $(top_srcdir) in APIDOC_SRC and SOURCEDOC_SRC to keep
101 # their sizes down.
102 T=$(top_srcdir)
104 # docsource.mk is generated by preautoreconf, run by bootstrap prior to
105 # it running autoreconf.
106 include docsource.mk
108 APIDOC_DEPS = $(APIDOC_SRC) doxygen_api.conf \
109                 $(srcdir)/doxygen_api_header.html_tmpl \
110                 $(srcdir)/doxygen_api_footer.html_tmpl
112 apidoc/html/index.html: $(APIDOC_DEPS)
113         rm -rf apidoc doxygen_api_html.conf.tmp
114         ## Use a temporary file to work around doxygen 1.8.19 bug which
115         ## truncates a config file read from stdin to 4096 bytes.
116         sed 's/^\(GENERATE_HTML\)\>.*/\1 = YES/;s/^\(GENERATE_LATEX\)\>.*/\1 = NO/' doxygen_api.conf > doxygen_api_html.conf.tmp
117         top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' $(DOXYGEN) doxygen_api_html.conf.tmp
118         rm -f doxygen_api_html.conf.tmp
119         ## Regression test - 1.0.17 failed to generate docs from error.h in a
120         ## VPATH build.
121         test -f apidoc/html/classXapian_1_1RuntimeError.html || \
122           ( echo "No api docs for Xapian::RuntimeError" ; \
123             rm apidoc/html/index.html ; exit 1 )
124         if test "x$(PNGCRUSH)" != x ; then \
125           for png in apidoc/html/*.png ; do \
126             $(PNGCRUSH) -q "$$png" "$${png}T" && mv "$${png}T" "$$png" ; \
127           done \
128         fi
129         touch apidoc/html/index.html
131 # Not built by default, but available in case users want to build it for
132 # themselves.
133 apidoc.pdf: $(APIDOC_DEPS)
134         rm -f doxygen_api_pdf.conf.tmp
135         ## Use a temporary file to work around doxygen 1.8.19 bug which
136         ## truncates a config file read from stdin to 4096 bytes.
137         sed 's/^\(GENERATE_HTML\)\>.*/\1 = NO/;s/^\(GENERATE_LATEX\)\>.*/\1 = YES/' doxygen_api.conf > doxygen_api_pdf.conf.tmp
138         top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' $(DOXYGEN) doxygen_api_pdf.conf.tmp
139         rm -f doxygen_api_pdf.conf.tmp
140         cd apidoc/latex && (pool_size=750000 $(MAKE) refman.pdf||(cat refman.log;exit 1))
141         mv apidoc/latex/refman.pdf apidoc.pdf
143 sourcedoc/html/index.html: $(SOURCEDOC_SRC) $(APIDOC_SRC) \
144                 doxygen_source.conf \
145                 $(srcdir)/doxygen_source_header.html_tmpl \
146                 $(srcdir)/doxygen_source_footer.html_tmpl
147         rm -rf sourcedoc
148         top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' $(DOXYGEN) doxygen_source.conf
150 .rst.html:
151         $(RST2HTML) --math-output=HTML --exit-status=warning $< $@
152 endif