41 lines
937 B
Makefile
41 lines
937 B
Makefile
# You can set these variables from the command line.
|
|
.ONESHELL:
|
|
SHELL = /usr/bin/bash
|
|
.SILENT:
|
|
|
|
SPHINXOPTS =
|
|
SPHINXBUILD = venv/bin/sphinx-build
|
|
SPHINXPRJ = $(shell basename `dirname \`pwd\``)
|
|
SOURCEDIR = .
|
|
BUILDDIR = _build
|
|
|
|
|
|
html: venv $(SPHINXPRJ)
|
|
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
|
|
$(SPHINXPRJ):
|
|
make --no-print-directory -C $@/_examples_ all
|
|
|
|
init: venv
|
|
venv:
|
|
echo -e "\033[1;33mCreating venv...\033[00m"
|
|
if [[ ! -e venv ]]; then
|
|
virtualenv -p /usr/bin/python3 venv
|
|
fi
|
|
venv/bin/pip install --upgrade pip
|
|
venv/bin/pip install -r requirements.txt
|
|
|
|
clean:
|
|
echo -e "\033[1;33mCleanung up docs...\033[00m"
|
|
echo -e "\e[1m * Sphix build directory...\e[0m"
|
|
rm -rf $(BUILDDIR)/*
|
|
make --no-print-directory -kC $(SPHINXPRJ)/_examples_ clean
|
|
|
|
release: html
|
|
rm -rf $(SPHINXPRJ)/_docs_
|
|
mv $(BUILDDIR)/html $(SPHINXPRJ)/_docs_
|
|
|
|
view: html
|
|
xdg-open $(BUILDDIR)/html/index.html
|
|
|