-
Notifications
You must be signed in to change notification settings - Fork 59
/
Makefile
42 lines (36 loc) · 1.88 KB
/
Makefile
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
# Minimal makefile for Sphinx documentation
# You can set these variables from the command line, and also
# from the environment for the first two.
LANGUAGE ?= zh_CN
SPHINXOPTS ?= -j auto -D language='$(LANGUAGE)' $(AUTOBUILDOPTS)
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
HTMLAPI ?= reference/api
AUTOBUILDOPTS ?=
# Put it first so that "make" without argument is like "make help".
help:
@echo "============================================== Target ======================================================"
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo " \033[36m livehtml\033[0m to make standalone HTML files and auto re-build while detects changes"
@echo "============================================= Variables ===================================================="
@echo "Default variables in makefile:"
@echo " SOURCEDIR: ${SOURCEDIR}"
@echo " BUILDDIR: ${BUILDDIR}"
@echo " HTMLAPI: ${HTMLAPI}"
@echo " SPHINXOPTS: ${SPHINXOPTS}"
@echo " AUTOBUILDOPTS: ${AUTOBUILDOPTS}"
@echo "=============================================== Notes ======================================================"
@echo "1. You can use\033[36m export PYTHONPATH=\"/path/to/megengine\"\033[0m to specify megengine python package path."
@echo "2. You can use\033[36m export MGE_DOC_MODE=\"MINI\"\033[0m to skip generating API Pages, which speeds up a lot."
@echo "For more details, please read the source code in\033[36m Makefile\033[0m."
clean:
rm -rf $(BUILDDIR)
rm -rf $(SOURCEDIR)/$(HTMLAPI)
livehtml:
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help clean Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)