From b88119d2b5e8e99874eb807f241c7e629d9b48c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 16 Jun 2019 19:34:39 +0200 Subject: make: fix "make doc" invocations python insists on adding . to python.path, so we always import the systemd in the top-level directory instead of the one in build/ that we want. Let's cd into docs/ first, so that we get the right module imported. Also, replace sphinx-build calls with $(PYTHON) -m sphinx. This has the advantage that once $(PYTHON) is set, the appropriate sphinx executable is chosen. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2d2eedf..6d6f749 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ PYTHON = python SED = sed -SPHINX_BUILD = sphinx-build ETAGS = etags INCLUDE_DIR := $(shell pkg-config --variable=includedir libsystemd) INCLUDE_FLAGS := $(shell pkg-config --cflags libsystemd) @@ -53,7 +52,8 @@ distclean: clean SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION) sphinx-%: build - PYTHONPATH=$(builddir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) docs build/$* + cd build && \ + PYTHONPATH=../$(builddir) $(PYTHON) -m sphinx -b $* $(SPHINXOPTS) ../docs $* @echo Output has been generated in build/$* doc: sphinx-html -- cgit v1.2.1