X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=devel%2Fnmbug%2Fdoc%2FMakefile;fp=devel%2Fnmbug%2Fdoc%2FMakefile;h=7ea3ae712e4809bceaea3b5f705a07fbad2d4de4;hb=d6cbb24fcf6ad2a4306c0913b10b1f3c574bbcaa;hp=0000000000000000000000000000000000000000;hpb=399c857ebaeafb3bb68caaa659b87ba371e7426b;p=notmuch diff --git a/devel/nmbug/doc/Makefile b/devel/nmbug/doc/Makefile new file mode 100644 index 00000000..7ea3ae71 --- /dev/null +++ b/devel/nmbug/doc/Makefile @@ -0,0 +1,38 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +DOCBUILDDIR := _build + +SRCDIR ?= . +ALLSPHINXOPTS := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(SRCDIR) + +MAN_RST_FILES := $(shell find $(SRCDIR)/man* -name '*.rst') +MAN_ROFF_FILES := $(patsubst $(SRCDIR)/man%.rst,$(DOCBUILDDIR)/man/man%,$(MAN_RST_FILES)) +MAN_GZIP_FILES := $(addsuffix .gz,$(MAN_ROFF_FILES)) + +.PHONY: build-man +build-man: $(MAN_GZIP_FILES) + +%.gz: % + rm -f $@ && gzip --stdout $^ > $@ + +$(MAN_ROFF_FILES): $(DOCBUILDDIR)/.roff.stamp + +# By using $(DOCBUILDDIR)/.roff.stamp instead of $(MAN_ROFF_FILES), we +# convey to make that a single invocation of this recipe builds all +# of the roff files. This prevents parallel make from starting an +# instance of this recipe for each roff file. +$(DOCBUILDDIR)/.roff.stamp $(MAN_ROFF_FILES): $(MAN_RST_FILES) + mkdir -p $(DOCBUILDDIR) + touch $(DOCBUILDDIR)/.roff.stamp + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man + for section in 1 5; do \ + mkdir -p $(DOCBUILDDIR)/man/man$${section}; \ + mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \ + done + +clean: + rm -rf $(DOCBUILDDIR) $(SRCDIR)/conf.pyc