Skip to content

Commit 00a3bb0

Browse files
authored
Move .PHONY to each section to avoid copy/paste omissions (#972)
1 parent 7101add commit 00a3bb0

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

Makefile

+23-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ PAPEROPT_a4 = -D latex_paper_size=a4
1515
PAPEROPT_letter = -D latex_paper_size=letter
1616
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1717

18-
.PHONY: help venv clean html dirhtml singlehtml pickle json htmlhelp qthelp \
19-
devhelp epub latex latexpdf text man changes linkcheck doctest htmlview check
20-
18+
.PHONY: help
2119
help:
2220
@echo "Please use \`make <target>' where <target> is one of"
2321
@echo " venv to create a venv with necessary tools"
@@ -41,12 +39,15 @@ help:
4139
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
4240
@echo " check to run a check for frequent markup errors"
4341

42+
.PHONY: clean
4443
clean: clean-venv
4544
-rm -rf $(BUILDDIR)/*
4645

46+
.PHONY: clean-venv
4747
clean-venv:
4848
rm -rf $(VENVDIR)
4949

50+
.PHONY: venv
5051
venv:
5152
@if [ -d $(VENVDIR) ] ; then \
5253
echo "venv already exists."; \
@@ -55,6 +56,7 @@ venv:
5556
$(MAKE) ensure-venv; \
5657
fi
5758

59+
.PHONY: ensure-venv
5860
ensure-venv:
5961
@if [ ! -d $(VENVDIR) ] ; then \
6062
$(PYTHON) -m venv $(VENVDIR); \
@@ -63,37 +65,44 @@ ensure-venv:
6365
echo "The venv has been created in the $(VENVDIR) directory"; \
6466
fi
6567

68+
.PHONY: html
6669
html: ensure-venv
6770
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
6871
@echo
6972
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
7073

74+
.PHONY: dirhtml
7175
dirhtml: ensure-venv
7276
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
7377
@echo
7478
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
7579

80+
.PHONY: singlehtml
7681
singlehtml: ensure-venv
7782
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
7883
@echo
7984
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
8085

86+
.PHONY: pickle
8187
pickle: ensure-venv
8288
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
8389
@echo
8490
@echo "Build finished; now you can process the pickle files."
8591

92+
.PHONY: json
8693
json: ensure-venv
8794
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
8895
@echo
8996
@echo "Build finished; now you can process the JSON files."
9097

98+
.PHONY: htmlhelp
9199
htmlhelp: ensure-venv
92100
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
93101
@echo
94102
@echo "Build finished; now you can run HTML Help Workshop with the" \
95103
".hhp project file in $(BUILDDIR)/htmlhelp."
96104

105+
.PHONY: qthelp
97106
qthelp: ensure-venv
98107
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
99108
@echo
@@ -103,6 +112,7 @@ qthelp: ensure-venv
103112
@echo "To view the help file:"
104113
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PythonDevelopersGuide.qhc"
105114

115+
.PHONY: devhelp
106116
devhelp: ensure-venv
107117
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
108118
@echo
@@ -112,34 +122,40 @@ devhelp: ensure-venv
112122
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PythonDevelopersGuide"
113123
@echo "# devhelp"
114124

125+
.PHONY: epub
115126
epub: ensure-venv
116127
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
117128
@echo
118129
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
119130

131+
.PHONY: latex
120132
latex: ensure-venv
121133
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
122134
@echo
123135
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
124136
@echo "Run \`make' in that directory to run these through (pdf)latex" \
125137
"(use \`make latexpdf' here to do that automatically)."
126138

139+
.PHONY: latexpdf
127140
latexpdf: ensure-venv
128141
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
129142
@echo "Running LaTeX files through pdflatex..."
130143
make -C $(BUILDDIR)/latex all-pdf
131144
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
132145

146+
.PHONY: text
133147
text: ensure-venv
134148
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
135149
@echo
136150
@echo "Build finished. The text files are in $(BUILDDIR)/text."
137151

152+
.PHONY: man
138153
man: ensure-venv
139154
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
140155
@echo
141156
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
142157

158+
.PHONY: changes
143159
changes: ensure-venv
144160
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
145161
@echo
@@ -151,18 +167,22 @@ linkcheck: ensure-venv
151167
@echo "Link check complete; look for any errors in the above output " \
152168
"or in $(BUILDDIR)/linkcheck/output.txt."
153169

170+
.PHONY: doctest
154171
doctest: ensure-venv
155172
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
156173
@echo "Testing of doctests in the sources finished, look at the " \
157174
"results in $(BUILDDIR)/doctest/output.txt."
158175

176+
.PHONY: htmlview
159177
htmlview: html
160178
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('_build/html/index.html'))"
161179

180+
.PHONY: check
162181
check: ensure-venv
163182
# Ignore the tools and venv dirs and check that the default role is not used.
164183
$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
165184

185+
.PHONY: serve
166186
serve:
167187
@echo "The 'serve' target was removed, use 'htmlview' instead" \
168188
"(see https://github.com/python/cpython/issues/80510)"

0 commit comments

Comments
 (0)