Skip to content

Commit 5ad09fc

Browse files
committed
update Makefile for doc server
1 parent 3bda5cf commit 5ad09fc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

doc/Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Makefile for Sphinx documentation
22
#
3+
PYVERSION=$(shell python -c "import sys;v=sys.version_info[0];sys.stdout.write(str(v))")
4+
HTTP_PORT = 8023
35

46
# You can set these variables from the command line.
57
SPHINXOPTS =
@@ -162,9 +164,15 @@ watch:
162164
if command -v entr > /dev/null; then ${WATCH_FILES} | entr -c $(MAKE) html; else $(MAKE) html; fi
163165

164166
serve:
165-
@echo '========================================================'
167+
@echo '================================================='
166168
@echo
167-
@echo ' docs server running at http://0.0.0.0:8023/_build/html '
169+
@echo 'docs server running at http://0.0.0.0:${HTTP_PORT}/_build/html'
168170
@echo
169-
@echo '========================================================'
170-
python -m SimpleHTTPServer 8023
171+
@echo '================================================='
172+
@if test ${PYVERSION} -eq 2; then $(MAKE) serve_py2; else make serve_py3; fi
173+
174+
serve_py2:
175+
python -m SimpleHTTPServer ${HTTP_PORT}
176+
177+
serve_py3:
178+
python -m http.server ${HTTP_PORT}

0 commit comments

Comments
 (0)