-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 1.14 KB
/
Makefile
File metadata and controls
39 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
PYTHON_VERSION ?= 3.9.9
VIRTUALENV_BIN ?= virtualenv
SPHINX_VERSION ?= 5.2.0
default: python.info
python.tgz:
wget -O python.tgz http://www.python.org/ftp/python/$(PYTHON_VERSION)/Python-$(PYTHON_VERSION).tgz
python_src: python.tgz
tar -xzf python.tgz
mv Python-$(PYTHON_VERSION) python_src
# based on http://stackoverflow.com/a/3952588
echo "texinfo_documents = [('contents', 'python', 'Python Documentation', 'Georg Brandl', 'Python', 'The Python Programming Language', 'Documentation tools', 1)]" >> python_src/Doc/conf.py
sphinx_env:
$(VIRTUALENV_BIN) sphinx_env
sphinx-build: sphinx_env
sphinx_env/bin/pip install sphinx==$(SPHINX_VERSION)
python.texi: python_src sphinx-build
sphinx_env/bin/sphinx-build -b texinfo python_src/Doc python_info
sed -i 's/@dircategory Documentation tools/@dircategory Programming/g' python_info/python.texi
cp python_info/python.texi python.texi
python.info: python.texi
makeinfo --no-split python.texi
clean:
rm -f python.tgz
rm -rf python_src
rm -rf python_info
rm -rf sphinx_env
rm -f python.texi
install: python.info
cp python.info /usr/share/info
install-info --info-dir=/usr/share/info python.info