@@ -48,14 +48,13 @@ MODE := autobuild-dev-html
48
48
JOBS := 4
49
49
50
50
.PHONY : all
51
- all :$(VENV ) /bin/sphinx-build$(VENV ) /bin/blurb clone# # Automatically build an html local version
52
- mkdir -p$(LC_MESSAGES )
51
+ all : prepare_deps# # Automatically build an html local version
53
52
for dirname in $$ (find. -name' *.po' | xargs -n1 dirname| sort -u| grep -v' ^\.$$' ); do mkdir -p$( LC_MESSAGES) /$$ dirname; done
54
53
for file in * .po* /* .po; do ln -f$$ file$( LC_MESSAGES) /$$ file; done
55
54
. $(VENV ) /bin/activate; $(MAKE ) -C$(CPYTHON_CLONE ) /Doc/ SPHINXOPTS=' -j$(JOBS) -D locale_dirs=locales -D language=$(LANGUAGE) -D gettext_compact=0' $(MODE )
56
55
57
56
.PHONY : build
58
- build :$( VENV ) /bin/sphinx-build $( VENV ) /bin/blurb clone # # Automatically build an html local version for a single file
57
+ build :prepare_deps # # Automatically build an html local version for a single file
59
58
@$(eval target=$(filter-out $@ ,$(MAKECMDGOALS ) ) )
60
59
@if [-z $( target) ]; then \
61
60
echo " \x1B[1;31m" " Please provide a file argument." " \x1B[m" ; \
@@ -80,16 +79,20 @@ build: $(VENV)/bin/sphinx-build $(VENV)/bin/blurb clone ## Automatically build a
80
79
help :
81
80
@python3 -c" $$ PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST )
82
81
83
- clone :# # Clone latest cpython repository to `../cpython/` if it doesn't exist
82
+ .PHONY : prepare_deps
83
+ prepare_deps :$(VENV ) /bin/sphinx-build$(VENV ) /bin/blurb upgrade_venv prepare_cpython# # Prepare dependencies
84
+
85
+ .PHONY : prepare_cpython
86
+ prepare_cpython :# # Prepare CPython clone at `../cpython/`.
84
87
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git$(CPYTHON_CLONE ) || echo " cpython exists"
85
- cd $(CPYTHON_CLONE ) && git checkout$(VERSION )
88
+ cd $(CPYTHON_CLONE ) && git checkout$(VERSION ) && git pull origin$(VERSION )
89
+ mkdir -p$(LC_MESSAGES )
86
90
87
91
88
92
$(VENV ) /bin/activate :
89
93
mkdir -p$(VENV )
90
94
$(PYTHON ) -m venv$(VENV )
91
95
92
-
93
96
$(VENV ) /bin/sphinx-build :$(VENV ) /bin/activate
94
97
. $(VENV ) /bin/activate; python3 -m pip install sphinx python-docs-theme
95
98
@@ -118,7 +121,7 @@ todo: ## List remaining tasks
118
121
119
122
120
123
.PHONY : merge
121
- merge :upgrade_venv # # To merge pot from upstream
124
+ merge :prepare_deps # # To merge pot from upstream
122
125
(cd$( CPYTHON_CLONE) /Doc; rm -f build/NEWS)
123
126
(cd$( CPYTHON_CLONE) /Doc; $( VENV) /bin/sphinx-build -Q -b gettext -D gettext_compact=0. locales/pot/)
124
127
find$(CPYTHON_CLONE ) /Doc/locales/pot/ -name' *.pot' | \