[master] 5822d0c Get the out-of-tree build of docs right - finally?
Nils Goroll
nils.goroll at uplex.de
Mon Sep 29 18:33:08 CEST 2014
commit 5822d0ce45b99e03ee2e611c5ef0d74bfc6a585d
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Sep 29 18:21:46 2014 +0200
Get the out-of-tree build of docs right - finally?
Trouble is that sphinx only takes one source dir, but when we build
out-of-tree, we need to both use sources from $(srcdir) as well as
$(builddir).
Fix this by hard-linking from $(srcdir) to $(builddir) and wait for
someone to come up with an out-of-tree build on different file systems.
Fixes #1479
diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am
index c82dec8..176c07d 100644
--- a/doc/sphinx/Makefile.am
+++ b/doc/sphinx/Makefile.am
@@ -10,7 +10,7 @@ BUILDDIR = build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(srcdir)
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(builddir)
.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
@@ -30,33 +30,43 @@ help:
clean:
-rm -rf $(BUILDDIR)/*
-html:
+# use index.rst as an indicator if we have copied already
+.PHONY: link_srcdir
+link_srcdir:
+ if test "x$(srcdir)" != "x$(builddir)" && test ! -f index.rst ; then \
+ d=`pwd`/$(builddir) ; \
+ cd $(srcdir) && find . -name \*.rst -type f | cpio -ldmp $${d} ; \
+ fi
+
+sphinx_prereq: link_srcdir conf.py
+
+html: sphinx_prereq
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-dirhtml:
+dirhtml: sphinx_prereq
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-pickle:
+pickle: sphinx_prereq
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
-json:
+json: sphinx_prereq
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
-htmlhelp:
+htmlhelp: sphinx_prereq
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
-qthelp:
+qthelp: sphinx_prereq
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
@@ -65,25 +75,25 @@ qthelp:
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Varnish.qhc"
-latex:
+latex: sphinx_prereq
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
"run these through (pdf)latex."
-changes:
+changes: sphinx_prereq
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
-linkcheck:
+linkcheck: sphinx_prereq
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
-doctest:
+doctest: sphinx_prereq
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
More information about the varnish-commit
mailing list