Fix overview.rst processing in VPATH build
[xapian.git] / xapian-applications / omega / docs / Makefile.am
blobf4a10e08a3c9cca233005cabeb7b37a1d09f1f45
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 RSTDOCS = \
10         cgiparams.rst\
11         encodings.rst\
12         index.rst\
13         omegascript.rst\
14         overview.rst\
15         quickstart.rst\
16         scriptindex.rst\
17         termprefixes.rst
19 RSTHTML = $(RSTDOCS:.rst=.html)
21 # Files which should be put in the distribution by automake
22 EXTRA_DIST = $(RSTDOCS) $(GENERATED_RST)
24 if !MAINTAINER_NO_DOCS
25 dist_doc_DATA = $(RSTHTML)
26 endif
28 GENERATED_RST = inc/ignored.rst inc/mimetypes.rst
29 MAINTAINERCLEANFILES = $(RSTHTML) $(GENERATED_RST)
31 if DOCUMENTATION_RULES
32 overview.html: overview.rst $(GENERATED_RST)
33         ## docutils seems to lack any sort of "include path".
34         perl -pe 'if (/^\.\.\s*include::\s*(\S+)/) {local $$/=undef;open I,"<",$$1 or open I,"<","$(srcdir)/$$1";$$_=<I>}' '$(srcdir)/overview.rst' |\
35             $(RST2HTML) --exit-status=warning - overview.html
37 .rst.html:
38         $(RST2HTML) --exit-status=warning $< $@
39 endif