-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.sphinx
55 lines (45 loc) · 1.64 KB
/
Makefile.sphinx
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
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXAPIDOC ?= sphinx-apidoc
SOURCEDIR = docs
BUILDDIR = build.docs
PACKAGEDIR = rlscope
MAKEFILE = Makefile.sphinx
# File output by "sphinx-apidoc"; used to detect changes and re-run apidoc.
#APIDOC_TARGET = $(SOURCEDIR)/rlscope.rst
APIDOC_IGNORE_FILES = \
rlscope/scripts/rlscope_plot_index.py \
"**/*_pb2.py"
# https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html#environment
#SPHINX_APIDOC_OPTIONS ?= members,undoc-members,show-inheritance
SPHINX_APIDOC_OPTIONS ?= members,show-inheritance
export SPHINX_APIDOC_OPTIONS
# Put it first so that "make" without argument is like "make help".
help:
@echo "To build RL-Scope documentation:"
@echo " $$ make -f $(MAKEFILE) docs"
@echo
@echo "To run specific \"sphinx-build <cmd>\" command:"
@echo " $$ make -f $(MAKEFILE) <cmd>"
@echo
@echo "\"sphinx-build <cmd>\" usage:"
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
MK_APIDOC = $(SPHINXAPIDOC) -f -o "$(SOURCEDIR)" "$(PACKAGEDIR)" $(SPHINXOPTS) $(O) $(APIDOC_IGNORE_FILES)
apidoc: $(MAKEFILE)
$(MK_APIDOC)
# $(1) = sphinx-build command (e.g., html)
define SPHINX_CMD
$(SPHINXBUILD) -M $(1) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -j auto
endef
docs:
$(MK_APIDOC)
$(call SPHINX_CMD,html)
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: $(MAKEFILE) $(APIDOC_TARGET)
$(call SPHINX_CMD,html)
.PHONY: help $(MAKEFILE) apidoc docs