Skip to content

Commit 3ee76c9

Browse files
committed
Remove tabs in target definitions; remove serve-docs; remove SHELL, add distclean target and refactor build target; refactor bin/python target
1 parent e3726b3 commit 3ee76c9

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

Makefile

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Makefile for Sphinx documentation
2-
SHELL = bash
3-
.DEFAULT_GOAL = all
2+
.DEFAULT_GOAL = help
43

54
# You can set these variables from the command line.
65
SPHINXOPTS ?=
@@ -28,15 +27,17 @@ help: ## This help message
2827
clean: ## Clean build directory
2928
cd $(DOCS_DIR) && rm -rf $(BUILDDIR)/*
3029

30+
.PHONY: distclean
31+
distclean:
32+
cd $(DOCS_DIR) && rm -rf $(BUILDDIR)/*
33+
rm -rf ./bin/ ./lib/ ./lib64 ./include
34+
3135
.PHONY: build
32-
build: ## Set up training: Install requirements
33-
python3 -m venv . || virtualenv --clear --python=python3 .
34-
bin/python -m pip install --upgrade pip
35-
bin/pip install -r requirements.txt
36+
build: distclean bin/python ## Set up training: Install requirements
3637

3738
bin/python:
38-
python3 -m venv . || virtualenv --clear --python=python3 .; \
39-
bin/python -m pip install --upgrade pip; \
39+
python3 -m venv . || virtualenv --clear --python=python3 .
40+
bin/python -m pip install --upgrade pip
4041
bin/pip install -r requirements.txt
4142

4243
docs/volto:
@@ -49,7 +50,7 @@ docs/volto:
4950
deps: bin/python docs/volto
5051

5152
.PHONY: html
52-
html: deps # Build html
53+
html: deps # Build html
5354
cd $(DOCS_DIR) && $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
5455
@echo
5556
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
@@ -164,21 +165,21 @@ changes: deps
164165
@echo "The overview file is in $(BUILDDIR)/changes."
165166

166167
.PHONY: linkcheck
167-
linkcheck: deps ## Run linkcheck
168+
linkcheck: deps ## Run linkcheck
168169
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
169170
@echo
170171
@echo "Link check complete; look for any errors in the above output " \
171172
"or in $(BUILDDIR)/linkcheck/ ."
172173

173174
.PHONY: linkcheckbroken
174-
linkcheckbroken: deps ## Run linkcheck and show only broken links
175+
linkcheckbroken: deps ## Run linkcheck and show only broken links
175176
cd $(DOCS_DIR) && $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck | GREP_COLORS='0;31' egrep -wi broken --color=auto
176177
@echo
177178
@echo "Link check complete; look for any errors in the above output " \
178179
"or in $(BUILDDIR)/linkcheck/ ."
179180

180181
.PHONY: spellcheck
181-
spellcheck: deps ## Run spellcheck
182+
spellcheck: deps ## Run spellcheck
182183
cd $(DOCS_DIR) && LANGUAGE=$* $(SPHINXBUILD) -b spelling -j 4 $(ALLSPHINXOPTS) $(BUILDDIR)/spellcheck/$*
183184
@echo
184185
@echo "Spellcheck is finished; look for any errors in the above output " \
@@ -201,14 +202,10 @@ test: clean linkcheck spellcheck ## Run linkcheck, spellcheck
201202
deploy: clean html
202203

203204
.PHONY: livehtml
204-
livehtml: deps ## Rebuild Sphinx documentation on changes, with live-reload in the browser
205+
livehtml: deps ## Rebuild Sphinx documentation on changes, with live-reload in the browser
205206
cd "$(DOCS_DIR)" && ${SPHINXAUTOBUILD} \
206207
--ignore "*.swp" \
207208
-b html . "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
208209

209210
.PHONY: all
210211
all: clean spellcheck linkcheck html ## Run checks and build html
211-
212-
.PHONY: serve-docs
213-
serve-docs: html ## Start an HTTP server for docs
214-
python -m http.server --directory ./_build/html

0 commit comments

Comments
 (0)