| 1 |
# You can set these variables from the command line. |
| 2 |
CPYTHON_PATH = ../cpython |
| 3 |
PYTHON = python3 |
| 4 |
SPHINXOPTS = |
| 5 |
|
| 6 |
|
| 7 |
.PHONY: help |
| 8 |
help: |
| 9 |
@echo "Please use \`make <target>' where <target> is one of" |
| 10 |
@echo " venv to create a venv with necessary tools at $(CPYTHON_PATH)/Doc/venv" |
| 11 |
@echo " html to make standalone CPython HTML files" |
| 12 |
@echo " htmlview to open the index page built by the html target in your browser" |
| 13 |
|
| 14 |
.PHONY: venv |
| 15 |
venv: |
| 16 |
$(PYTHON) -m pip install build |
| 17 |
rm -rf dist/ |
| 18 |
$(PYTHON) -m build |
| 19 |
cd $(CPYTHON_PATH)/Doc \ |
| 20 |
&& make venv \ |
| 21 |
&& ./venv/bin/pip install $(CURDIR)/dist/python_docs_theme-*.tar.gz |
| 22 |
|
| 23 |
.PHONY: html |
| 24 |
html: venv |
| 25 |
cd $(CPYTHON_PATH)/Doc && \ |
| 26 |
make SPHINXOPTS="$(SPHINXOPTS)" html |
| 27 |
|
| 28 |
.PHONY: htmlview |
| 29 |
htmlview: html |
| 30 |
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(CPYTHON_PATH)/Doc/build/html/index.html'))" |