diff --git a/man/Makefile.am b/man/Makefile.am index f7b4dac671dec..ed59328ef39b5 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -12,17 +12,18 @@ if ENABLE_SERVER include Makefile-server.am endif -check-local: - ${SPHINX_BUILD} -b man -d doctrees -c . $(top_srcdir)/doc/man $(top_builddir)/man - # prevent `make` from running in parallel, sphinx runs better in batch mode. .PHONY: sphinx-build.stamp $(dist_man_MANS): sphinx-build.stamp +# in a tree populated from dist tarball, the $(top_srcdir)/doc is not included sphinx-build.stamp: - ${SPHINX_BUILD} -Q -b man -d doctrees -c . $(top_srcdir)/doc/man $(top_builddir)/man + if [ -d $(top_srcdir)/doc/man ] ; then \ + ${SPHINX_BUILD} -b man -d doctrees -c . $(top_srcdir)/doc/man $(top_builddir)/man; \ + fi clean-local: - @rm -f *.8 @rm -rf doctrees + +MAINTAINERCLEANFILES = $(dist_man_MANS)