aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar David Bremner <david@tethera.net>2014-03-13 00:21:16 -0300
committerGravatar David Bremner <david@tethera.net>2014-03-18 07:39:32 -0300
commitbeef0a8f5593eee0f84b2b0fa01017c1c9621659 (patch)
tree51e1cc5de06caf1612e19d2618d5dc9ace13e724 /doc
parent533639b143202d333eb964aa0c6a860db0809344 (diff)
doc: configure detection of sphinx and rst2man
Because sphinx-build does not provide a convenient way of listing which builders exist, and some people actually have pre 1.0 sphinx, we try loading a relevant python module. Currently the assumption is that no python in path -> no sphinx-build in path.
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile.local21
1 files changed, 14 insertions, 7 deletions
diff --git a/doc/Makefile.local b/doc/Makefile.local
index fab6d48e..9c31c248 100644
--- a/doc/Makefile.local
+++ b/doc/Makefile.local
@@ -33,11 +33,9 @@ sphinx-info: sphinx-texinfo
MAN_GZIP_FILES := $(addsuffix .gz,${MAN_ROFF_FILES})
-build-man: ${MAN_GZIP_FILES}
-
-${MAN_ROFF_FILES}: ${dir}/man.stamp
-
-$(dir)/man.stamp: ${MAN_RST_FILES}
+# Use the man page converter that is available. We should never depend
+# on MAN_ROFF_FILES if a converter is not available.
+${MAN_ROFF_FILES}: ${MAN_RST_FILES}
ifeq ($(HAVE_SPHINX),1)
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man
for section in 1 5 7; do \
@@ -46,11 +44,19 @@ ifeq ($(HAVE_SPHINX),1)
done
else ifeq ($(HAVE_RST2MAN),1)
$(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man
- touch $@
else
- @echo "No sphinx or rst2man, will not install man pages."
+ @echo "Fatal: build dependency fail."
+ @false
endif
+# Do not try to build or install man pages if a man page converter is
+# not available.
+ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)
+build-man:
+install-man:
+ @echo "No sphinx or rst2man, will not install man pages."
+else
+build-man: ${MAN_GZIP_FILES}
install-man: ${MAN_GZIP_FILES}
mkdir -p "$(DESTDIR)$(mandir)/man1"
mkdir -p "$(DESTDIR)$(mandir)/man5"
@@ -59,6 +65,7 @@ install-man: ${MAN_GZIP_FILES}
install -m0644 $(DOCBUILDDIR)/man/man5/*.5.gz $(DESTDIR)/$(mandir)/man5
install -m0644 $(DOCBUILDDIR)/man/man7/*.7.gz $(DESTDIR)/$(mandir)/man7
cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz
+endif
$(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py
$(mkdocdeps) $< $(DOCBUILDDIR) $@