| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,23 +1,29 @@ | |||
| 1 | - CPYTHON_PATH = ../cpython | ||
| 1 | + # You can set these variables from the command line. | ||
| 2 | + CPYTHON_PATH = ../cpython | ||
| 3 | + PYTHON = python3 | ||
| 2 | 4 | PACKAGE_ABS_PATH = $(shell pwd)/$(shell find dist/python-docs-theme-*.tar.gz) | |
| 3 | 5 | ||
| 4 | 6 | ||
| 5 | - .PHONY: html | ||
| 6 | - html: venv | ||
| 7 | - cd $(CPYTHON_PATH)/Doc && \ | ||
| 8 | - make html | ||
| 9 | - | ||
| 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" | ||
| 10 | 13 | ||
| 11 | 14 | .PHONY: venv | |
| 12 | 15 | venv: | |
| 13 | - python3 -m pip install build | ||
| 14 | - python3 -m build | ||
| 16 | + $(PYTHON) -m pip install build | ||
| 17 | + $(PYTHON) -m build | ||
| 15 | 18 | cd $(CPYTHON_PATH)/Doc \ | |
| 16 | 19 | && make venv \ | |
| 17 | 20 | && ./venv/bin/pip install $(PACKAGE_ABS_PATH) | |
| 18 | 21 | ||
| 19 | - .PHONY: help | ||
| 20 | - help: | ||
| 21 | - @echo "html: default rule; run the \`venv\` rule, and also rebuild the CPython docs" | ||
| 22 | - @echo "venv: build the package, and install it into the virtual environment" | ||
| 23 | - @echo " at $(CPYTHON_PATH)/Doc/venv" | ||
| 22 | + .PHONY: html | ||
| 23 | + html: venv | ||
| 24 | + cd $(CPYTHON_PATH)/Doc && \ | ||
| 25 | + make html | ||
| 26 | + | ||
| 27 | + .PHONY: htmlview | ||
| 28 | + htmlview: html | ||
| 29 | + $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(CPYTHON_PATH)/Doc/build/html/index.html'))" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments