|
|
|
|
|
SPHINXOPTS ?= |
|
SPHINXBUILD ?= $(shell which sphinx-build) |
|
SPHINXMULTIVERSION ?= $(shell which sphinx-multiversion) |
|
SOURCEDIR ?= source |
|
BUILDDIR ?= build |
|
|
|
|
|
DIAGRAMS_MK := ${SOURCEDIR}/diagrams.mk |
|
DIAGRAMS := $(MAKE) -f "${DIAGRAMS_MK}" SOURCE=${SOURCEDIR} |
|
GRAPHVIZ_MK := ${SOURCEDIR}/graphviz.mk |
|
GRAPHVIZ := $(MAKE) -f "${GRAPHVIZ_MK}" SOURCE=${SOURCEDIR} |
|
DEMOS_MK := ${SOURCEDIR}/demos.mk |
|
DEMOS := $(MAKE) -f "${DEMOS_MK}" SOURCE=${SOURCEDIR} |
|
NOTEBOOK_MK := ${SOURCEDIR}/notebook.mk |
|
NOTEBOOK := $(MAKE) -f "${NOTEBOOK_MK}" SOURCE=${SOURCEDIR} |
|
|
|
_CURRENT_PATH := ${PATH} |
|
_PROJ_DIR := $(shell readlink -f ${CURDIR}/..) |
|
_LIBS_DIR := $(shell readlink -f ${SOURCEDIR}/_libs) |
|
_SHIMS_DIR := $(shell readlink -f ${SOURCEDIR}/_shims) |
|
|
|
.EXPORT_ALL_VARIABLES: |
|
|
|
PYTHONPATH = ${_PROJ_DIR}:${_LIBS_DIR} |
|
PATH = ${_SHIMS_DIR}:${_CURRENT_PATH} |
|
NO_CONTENTS_BUILD = true |
|
|
|
|
|
|
|
|
|
.PHONY: help contents build html prod clean sourcedir builddir Makefile |
|
|
|
help: |
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
|
|
|
contents: |
|
@$(DIAGRAMS) build |
|
@$(GRAPHVIZ) build |
|
@$(DEMOS) build |
|
@$(NOTEBOOK) build |
|
build: html |
|
html: contents |
|
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
|
@touch "$(BUILDDIR)/html/.nojekyll" |
|
prod: |
|
@NO_CONTENTS_BUILD='' $(SPHINXMULTIVERSION) "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) |
|
@cp main_page.html "$(BUILDDIR)/html/index.html" |
|
@touch "$(BUILDDIR)/html/.nojekyll" |
|
|
|
clean: |
|
@$(DIAGRAMS) clean |
|
@$(GRAPHVIZ) clean |
|
@$(DEMOS) clean |
|
@$(NOTEBOOK) clean |
|
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
|
|
|
sourcedir: |
|
@echo $(shell readlink -f ${SOURCEDIR}) |
|
builddir: |
|
@echo $(shell readlink -f ${BUILDDIR}/html) |