summaryrefslogtreecommitdiff
path: root/Documentation/Makefile.sphinx
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2017-01-31 20:18:05 +0200
committerJonathan Corbet <corbet@lwn.net>2017-02-01 13:03:58 -0700
commit2a0f4038a4919712a62031dc63aa871a84b4ad05 (patch)
treebe8309db0202429d3272d88277cee699d7467165 /Documentation/Makefile.sphinx
parent028f25332c4f7e8befb22e12eaedd105cd45acb2 (diff)
Documentation/sphinx: prevent generation of .pyc files in the source tree
Use PYTHONDONTWRITEBYTECODE=1 to prevent python from creating .pyc files in the source tree. Python 3.2 has a __pycache__ scheme [1], but before that the only alternative seems to be to copy the source files to the build tree to ensure the .pyc files are created there too. Just prevent .pyc file generation for simplicity. Considering the small amount of python code to compile (assuming sphinx itself has .pyc around), the impact on build is neglible. [1] http://stackoverflow.com/questions/3522079/changing-the-directory-where-pyc-files-are-created References: http://lkml.kernel.org/r/CAMuHMdVxqpH7-9XJ+YE_pgoA+-fe0969cSkOehYh3uubYcrhZA@mail.gmail.com Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> References: http://lkml.kernel.org/r/1485816692.2900.17.camel@decadent.org.uk Reported-by: Ben Hutchings <ben@decadent.org.uk> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/Makefile.sphinx')
-rw-r--r--Documentation/Makefile.sphinx1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 707c65337ebf..91f541a52884 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -55,6 +55,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2;\
+ PYTHONDONTWRITEBYTECODE=1 \
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
$(SPHINXBUILD) \
-b $2 \