-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (52 loc) · 1.45 KB
/
Makefile
File metadata and controls
60 lines (52 loc) · 1.45 KB
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
# 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-multiversion
SOURCEDIR = source
BUILDDIR = build
UNAME = "Windows_NT"
ifeq ($(OS),Windows_NT)
UNAME_AVAIL = "false"
else
UNAME_AVAIL = "true"
endif
ifeq ($(UNAME_AVAIL), "true")
UNAME = $(shell uname -s)
endif
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) --help
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx
# $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
ifeq ($(UNAME_AVAIL), "true")
ifeq ($(UNAME), Darwin)
#We are on OSX
mkdir -p tmptmp
TMPDIR=$(CURDIR)/tmptmp $(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)
rm -r tmptmp
cp ./index.html "$(BUILDDIR)/index.html"
else
#We are on Linux
@$(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)
cp ./index.html "$(BUILDDIR)/index.html"
endif
else
#We are on Windows_NT
@$(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)
copy .\index.html "$(BUILDDIR)\index.html"
endif
local:
sphinx-build "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)
# We are no longer using make functionality of sphinx-build
# because sphinx-multiverison does not support it
# therefore we must define make clean ourselves.
clean:
ifeq ($(OS),Windows_NT)
del /s "$(BUILDDIR)"
else
rm -rf "$(BUILDDIR)/"* || true
endif