From aaaeac70e45517aeb6bb1126cf3c4f40f12fa90a Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Tue, 26 May 2020 20:48:20 +0200 Subject: 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. --- doc/Makefile | 8 ++++++-- 1 file 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 -- cgit v1.0