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 test "`echo $(srcdir)/apidoc/html/*.png`" = "$(srcdir)/apidoc/html/*.png" || \
54 cp -p $(srcdir)/apidoc/html/*.png $(distdir)/apidoc/html
55 test "`echo apidoc/html/*.png`" = "apidoc/html/*.png" || \
56 cp -p apidoc/html/*.png $(distdir)/apidoc/html
57 test "`echo $(srcdir)/apidoc/html/*.css`" = "$(srcdir)/apidoc/html/*.css" || \
58 cp -p $(srcdir)/apidoc/html/*.css $(distdir)/apidoc/html
59 test "`echo apidoc/html/*.css`" = "apidoc/html/*.css" || \
60 cp -p apidoc/html/*.css $(distdir)/apidoc/html
61 test "`echo $(srcdir)/apidoc/html/*.html`" = "$(srcdir)/apidoc/html/*.html" || \
62 cp -p $(srcdir)/apidoc/html/*.html $(distdir)/apidoc/html
63 test "`echo apidoc/html/*.html`" = "apidoc/html/*.html" || \
64 cp -p apidoc/html/*.html $(distdir)/apidoc/html
66 # Disable these rules if configured with --enable-maintainer-mode and
67 # --disable-documentation so that "make install" works in this case.
68 if !MAINTAINER_NO_DOCS
69 doc_DATA = $(HTMLDOCS) $(RSTHTML)
71 install-data-local: doxygen_api_docs
72 $(mkinstalldirs) $(DESTDIR)$(docdir)/apidoc/html
73 $(INSTALL_DATA) `test -f apidoc/html/index.html || echo $(srcdir)/`apidoc/html/*.png $(DESTDIR)$(docdir)/apidoc/html
74 $(INSTALL_DATA) `test -f apidoc/html/index.html || echo $(srcdir)/`apidoc/html/*.css $(DESTDIR)$(docdir)/apidoc/html
75 $(INSTALL_DATA) `test -f apidoc/html/index.html || echo $(srcdir)/`apidoc/html/*.html $(DESTDIR)$(docdir)/apidoc/html
78 ###############################
79 # How to clean up local files #
80 ###############################
82 maintainer-clean-local:
83 rm -rf apidoc sourcedoc
85 ################################
86 # How to uninstall local files #
87 ################################
89 rm -rf $(DESTDIR)$(docdir)/apidoc
91 MAINTAINERCLEANFILES = doxygen_api.conf doxygen_source.conf \
95 .PHONY: doxygen_source_docs doxygen_api_docs doxygen_docs
97 doxygen_source_docs: sourcedoc/html/index.html
98 doxygen_api_docs: apidoc/html/index.html
99 doxygen_docs: doxygen_source_docs doxygen_api_docs
101 if DOCUMENTATION_RULES
102 # Build API docs with doxygen
103 all-local: doxygen_api_docs
105 # We use $T instead of $(top_srcdir) in APIDOC_SRC and SOURCEDOC_SRC to keep
109 # docsource.mk is generated by preautoreconf, run by bootstrap prior to
110 # it running autoreconf.
113 APIDOC_DEPS = $(APIDOC_SRC) doxygen_api.conf \
114 $(srcdir)/doxygen_api_header.html_tmpl \
115 $(srcdir)/doxygen_api_footer.html_tmpl
117 apidoc/html/index.html: $(APIDOC_DEPS)
119 sed 's/^\(GENERATE_HTML\)\>.*/\1 = YES/;s/^\(GENERATE_LATEX\)\>.*/\1 = NO/' doxygen_api.conf |\
120 top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' $(DOXYGEN) -
121 ## Regression test - 1.0.17 failed to generate docs from error.h in a
123 test -f apidoc/html/classXapian_1_1RuntimeError.html || \
124 ( echo "No api docs for Xapian::RuntimeError" ; \
125 rm apidoc/html/index.html ; exit 1 )
126 if test "x$(PNGCRUSH)" != x ; then \
127 for png in apidoc/html/*.png ; do \
128 $(PNGCRUSH) -q "$$png" "$${png}T" && mv "$${png}T" "$$png" ; \
131 touch apidoc/html/index.html
133 # Not built by default, but available in case users want to build it for
135 apidoc.pdf: $(APIDOC_DEPS)
136 sed 's/^\(GENERATE_HTML\)\>.*/\1 = NO/;s/^\(GENERATE_LATEX\)\>.*/\1 = YES/' doxygen_api.conf |\
137 top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' $(DOXYGEN) -
138 cd apidoc/latex && (pool_size=750000 $(MAKE) refman.pdf||(cat refman.log;exit 1))
139 mv apidoc/latex/refman.pdf apidoc.pdf
141 sourcedoc/html/index.html: $(SOURCEDOC_SRC) $(APIDOC_SRC) \
142 doxygen_source.conf \
143 $(srcdir)/doxygen_source_header.html_tmpl \
144 $(srcdir)/doxygen_source_footer.html_tmpl
146 top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)' $(DOXYGEN) doxygen_source.conf
149 $(RST2HTML) --math-output=HTML --exit-status=warning $< $@