aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSanel Zukan <karijes@users.sourceforge.net>2020-05-26 20:48:20 +0200
committerEivind Fonn <evfonn@gmail.com>2020-05-27 14:58:16 +0200
commitaaaeac70e45517aeb6bb1126cf3c4f40f12fa90a (patch)
treefe38ddab82fa2e4c5d4add7aff71b223b207aacf /doc
parent3f3b2fea87172f155e5f91d75f0fb69d8648acf2 (diff)
Fixed make clean and doc build
When sphinx is not found, make clean (and others) will fail. This change prevents running sphinx if sphinx-build binary is not found. Here is used 'command' instead of 'which', for checking presence of binary in PATH, to make it more portable across shells and unixes.
Diffstat (limited to 'doc')
-rw-r--r--doc/Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/Makefile b/doc/Makefile
index d0c3cbf..ef7010f 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -10,11 +10,15 @@ BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ @if [ command -v $(SPHINXBUILD) 2> /dev/null ]; then \
+ $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O); \
+ fi
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ @if [ command -v $(SPHINXBUILD) 2> /dev/null ]; then \
+ $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O); \
+ fi