@@ -152,7 +152,7 @@ htmlview: html
152152$(PYTHON ) -c" import os, webbrowser; webbrowser.open('file://' + os.path.realpath('build/html/index.html'))"
153153
154154.PHONY : htmllive
155- htmllive : SPHINXBUILD =$(VENVDIR ) /bin/ sphinx-autobuild
155+ htmllive : SPHINXBUILD =PATH= $(VENVDIR ) /bin:$$PATH sphinx-autobuild
156156htmllive : SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
157157htmllive : _ensure-sphinx-autobuild html
158158
@@ -182,13 +182,26 @@ venv:
182182echo " The venv has been created in the$( VENVDIR) directory" ; \
183183fi
184184
185+ .PHONY : dist-no-html
186+ dist-no-html : dist-text dist-pdf dist-epub dist-texinfo
187+
185188.PHONY : dist
186189dist :
187190rm -rf dist
188191mkdir -p dist
189-
192+ $(MAKE ) dist-html
193+ $(MAKE ) dist-text
194+ $(MAKE ) dist-pdf
195+ $(MAKE ) dist-epub
196+ $(MAKE ) dist-texinfo
197+
198+ .PHONY : dist-html
199+ dist-html :
190200# archive the HTML
191201@echo" Building HTML..."
202+ mkdir -p dist
203+ rm -rf build/html
204+ find dist -name' python-$(DISTVERSION)-docs-html*' -exec rm -rf {}\;
192205$(MAKE ) html
193206cp -pPR build/html dist/python-$(DISTVERSION ) -docs-html
194207tar -C dist -cf dist/python-$(DISTVERSION ) -docs-html.tar python-$(DISTVERSION ) -docs-html
@@ -198,8 +211,13 @@ dist:
198211rm dist/python-$(DISTVERSION ) -docs-html.tar
199212@echo" Build finished and archived!"
200213
214+ .PHONY : dist-text
215+ dist-text :
201216# archive the text build
202217@echo" Building text..."
218+ mkdir -p dist
219+ rm -rf build/text
220+ find dist -name' python-$(DISTVERSION)-docs-text*' -exec rm -rf {}\;
203221$(MAKE ) text
204222cp -pPR build/text dist/python-$(DISTVERSION ) -docs-text
205223tar -C dist -cf dist/python-$(DISTVERSION ) -docs-text.tar python-$(DISTVERSION ) -docs-text
@@ -209,9 +227,13 @@ dist:
209227rm dist/python-$(DISTVERSION ) -docs-text.tar
210228@echo" Build finished and archived!"
211229
230+ .PHONY : dist-pdf
231+ dist-pdf :
212232# archive the A4 latex
213233@echo" Building LaTeX (A4 paper)..."
234+ mkdir -p dist
214235rm -rf build/latex
236+ find dist -name' python-$(DISTVERSION)-docs-pdf*' -exec rm -rf {}\;
215237$(MAKE ) latex PAPER=a4
216238# remove zip & bz2 dependency on all-pdf,
217239# as otherwise the full latexmk process is run twice.
@@ -222,16 +244,24 @@ dist:
222244cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION ) -docs-pdf-a4.tar.bz2
223245@echo" Build finished and archived!"
224246
247+ .PHONY : dist-epub
248+ dist-epub :
225249# copy the epub build
226250@echo" Building EPUB..."
251+ mkdir -p dist
227252rm -rf build/epub
253+ rm -f dist/python-$(DISTVERSION ) -docs.epub
228254$(MAKE ) epub
229255cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION ) -docs.epub
230256@echo" Build finished and archived!"
231257
258+ .PHONY : dist-texinfo
259+ dist-texinfo :
232260# archive the texinfo build
233261@echo" Building Texinfo..."
262+ mkdir -p dist
234263rm -rf build/texinfo
264+ find dist -name' python-$(DISTVERSION)-docs-texinfo*' -exec rm -rf {}\;
235265$(MAKE ) texinfo
236266$(MAKE ) info --directory=build/texinfo
237267cp -pPR build/texinfo dist/python-$(DISTVERSION ) -docs-texinfo