[PATCH] doc: build man pages at build time, not install

Tomi Ollila tomi.ollila at iki.fi
Mon Mar 10 15:40:56 PDT 2014


On Mon, Mar 10 2014, Jani Nikula <jani at nikula.org> wrote:

>
> Because build-man is a .PHONY target, it'll get done also on
> install-man, and one still ends up with root owned files on 'sudo make
> install'. The improvement to previous is that doc/_build/man directory
> is now created in the build phase and the files can be removed by the
> regular user.
>
> An actual non-phony dependency chain from .gz to man page to rst would
> be awesome, but I don't know how hard it would be with the
> sphinx/rst2man targets.

instead of having the targets as .PHONY those should depend on all source
files...

... perhaps better alternative is to have those still as .PHONY so those
can be neat make targets, but greate new *.stamp targets that depend on
the source files (and these *.stamp targets have the recipes)

(actually, after I added the stuff below, sphinx-man doesn't need to be
PHONY anymore).

something like:

sphinx-man: $(DOCBUILDDIR)/man.stamp

$(DOCBUILDDIR)/man.stamp: $(MAN_SRC_FILES)
ifeq($(HAVE_SPHINX), 1)
          $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man
          touch $@
else
ifeq($(HAVE_RST2HTML), 1)
          $(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man
          touch $@
endif
endif


mkdocdeps.py could create $(MAN_SRC_FILES) and friends pretty easily.

(sphinx-man could be changed to just 'man', and if anyone wanted to
make manual pages from command line using rst2man that could
work as `make man HAVE_SPHINX=0 HAVE_RST2HTML=1')


> BR,
> Jani.


Tomi


More information about the notmuch mailing list