Skip to content
Snippets Groups Projects
Commit d11363c7 authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #220 from rbberger/fix-doc-makefile

Allow building non-html doc targets without Python3 and virtualenv
parents 5aefb2a8 95cca1bd
No related branches found
No related tags found
No related merge requests found
...@@ -8,13 +8,15 @@ VENV = $(BUILDDIR)/docenv ...@@ -8,13 +8,15 @@ VENV = $(BUILDDIR)/docenv
TXT2RST = $(VENV)/bin/txt2rst TXT2RST = $(VENV)/bin/txt2rst
PYTHON = $(shell which python3) PYTHON = $(shell which python3)
HAS_PYTHON3 = NO
HAS_VIRTUALENV = NO
ifeq ($(shell which python3 >/dev/null 2>&1; echo $$?), 1) ifeq ($(shell which python3 >/dev/null 2>&1; echo $$?), 0)
$(error Python3 was not found! Please check README.md for further instructions) HAS_PYTHON3 = YES
endif endif
ifeq ($(shell which virtualenv >/dev/null 2>&1; echo $$?), 1) ifeq ($(shell which virtualenv >/dev/null 2>&1; echo $$?), 0)
$(error virtualenv was not found! Please check README.md for further instructions) HAS_VIRTUALENV = YES
endif endif
SOURCES=$(wildcard src/*.txt) SOURCES=$(wildcard src/*.txt)
...@@ -109,6 +111,8 @@ $(RSTDIR)/%.rst : src/%.txt $(TXT2RST) ...@@ -109,6 +111,8 @@ $(RSTDIR)/%.rst : src/%.txt $(TXT2RST)
) )
$(VENV): $(VENV):
@if [ "$(HAS_PYTHON3)" == "NO" ] ; then echo "Python3 was not found! Please check README.md for further instructions" 1>&2; exit 1; fi
@if [ "$(HAS_VIRTUALENV)" == "NO" ] ; then echo "virtualenv was not found! Please check README.md for further instructions" 1>&2; exit 1; fi
@( \ @( \
virtualenv -p $(PYTHON) $(VENV); \ virtualenv -p $(PYTHON) $(VENV); \
. $(VENV)/bin/activate; \ . $(VENV)/bin/activate; \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment