1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
# pgmp -- documentation makefile
#
# Use 'make env' once, then 'make html' to build the HTML documentation.
# You can use PYTHON=python3.6 to use a different Python version to build.
#
# Copyright (C) 2011-2020 Daniele Varrazzo
ENV_DIR = $(shell pwd)/env
ENV_BIN = $(ENV_DIR)/bin
ENV_LIB = $(ENV_DIR)/lib
SPHINXOPTS =
SPHINXBUILD = $(ENV_BIN)/sphinx-build
PAPER =
BUILDDIR = .
PYTHON ?= python
PLOTS = $(patsubst ../bench/%.txt,html/img/%.png,$(sort $(wildcard ../bench/*.txt)))
.PHONY: env html upload clean
default: html
html: $(PLOTS) html/.gitignore html/.nojekill
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) \
. $(BUILDDIR)/html
html/img/%.png: ../bench/%.txt
mkdir -p html/img
$(ENV_BIN)/python ../bench/plot_result.py $< -o $@
# The environment is currently required to build the documentation.
# It is not clean by 'make clean'
env:
virtualenv -p $(PYTHON) $(ENV_DIR)
$(ENV_BIN)/pip install -r requirements.txt
# Clone the github pages repository to update
# Fail silently if this is not a git repos (upload won't work of course)
git status 2>/dev/null \
&& git clone -b gh-pages \
$$(git remote show -n origin | awk '/URL/ {print $$NF; exit}') \
html \
|| true
html/.gitignore: html-gitignore
cp $< $@
html/.nojekill:
touch $@
upload:
cd html && test -d .git \
&& git add --all \
&& git commit -m "website update on $$(date)" \
&& git push
clean:
# Do not delete .gitignore and .git directories
$(RM) -r html/*
|