summaryrefslogtreecommitdiffstats
path: root/Doc/Makefile
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-28 13:35:18 (GMT)
committerGitHub <noreply@github.com>2021-07-28 13:35:18 (GMT)
commitf113195ac85d58bdde348b5bb74eb97e6485e408 (patch)
tree4773d47a878f29e3edb377f0475c77044d5d4fbb /Doc/Makefile
parentc558e12695e5fe39778eb3eead9df48870356800 (diff)
downloadcpython-f113195ac85d58bdde348b5bb74eb97e6485e408.zip
cpython-f113195ac85d58bdde348b5bb74eb97e6485e408.tar.gz
cpython-f113195ac85d58bdde348b5bb74eb97e6485e408.tar.bz2
bpo-44756: in ./Doc, `make build` depends on `make html` (GH-27403) (GH-27410)
- venv rule is now conditional, and only does anything if $VENVDIR does not exist - add rule "clean-venv" (cherry picked from commit d22c876d5ac5fa464337d2e82654b8d87a83cb1b) Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Diffstat (limited to 'Doc/Makefile')
-rw-r--r--Doc/Makefile21
1 files changed, 14 insertions, 7 deletions
diff --git a/Doc/Makefile b/Doc/Makefile
index f113dd0..ac02bbc 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -45,7 +45,7 @@ help:
@echo " check to run a check for frequent markup errors"
@echo " serve to serve the documentation on the localhost (8000)"
-build:
+build: venv
-mkdir -p build
# Look first for a Misc/NEWS file (building from a source release tarball
# or old repo) and use that, otherwise look for a Misc/NEWS.d directory
@@ -137,14 +137,21 @@ pydoc-topics: build
htmlview: html
$(PYTHON) -c "import webbrowser; webbrowser.open('build/html/index.html')"
-clean:
- -rm -rf build/* $(VENVDIR)/*
+clean: clean-venv
+ -rm -rf build/*
+
+clean-venv:
+ rm -rf $(VENVDIR)
venv:
- $(PYTHON) -m venv $(VENVDIR)
- $(VENVDIR)/bin/python3 -m pip install -U pip setuptools
- $(VENVDIR)/bin/python3 -m pip install -r requirements.txt
- @echo "The venv has been created in the $(VENVDIR) directory"
+ @if [ -d $(VENVDIR) ] ; then \
+ echo "venv already exists"; \
+ else \
+ $(PYTHON) -m venv $(VENVDIR); \
+ $(VENVDIR)/bin/python3 -m pip install -U pip setuptools; \
+ $(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
+ echo "The venv has been created in the $(VENVDIR) directory"; \
+ fi
dist:
rm -rf dist