1 ## Process this file with automake to produce Makefile.in
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
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.
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 ;\
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
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 ################################
84 rm -rf $(DESTDIR)$(docdir)/apidoc
86 MAINTAINERCLEANFILES = doxygen_api.conf doxygen_source.conf \
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
104 # docsource.mk is generated by preautoreconf, run by bootstrap prior to
105 # it running autoreconf.
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
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" ; \
129 touch apidoc/html/index.html
131 # Not built by default, but available in case users want to build it for
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
148 top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' $(DOXYGEN) doxygen_source.conf
151 $(RST2HTML) --math-output=HTML --exit-status=warning $< $@