forked from MPAS-Dev/MPAS-Tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (44 loc) · 1.68 KB
/
Makefile
File metadata and controls
54 lines (44 loc) · 1.68 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
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS ?=
SPHINXBUILD = sphinx-build
SPHINXPROJ = mpas_tools
SOURCEDIR = .
BUILDDIR = _build
# Select behavior via an environment/CLI variable
# make versioned-html # normal
# make versioned-html WERROR=1 # treat warnings as errors
ifeq ($(WERROR),1)
SPHINXWARNOPTS = -W --keep-going
else
SPHINXWARNOPTS =
endif
# Build into a versioned subdirectory
versioned-html:
@echo "Building version: $(DOCS_VERSION) (WERROR=$(WERROR))"
$(SPHINXBUILD) $(SPHINXWARNOPTS) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html/$(DOCS_VERSION)"
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/$(DOCS_VERSION)."
@echo "Setting up shared version switcher for local preview..."
mkdir -p _build/html/shared
cp shared/version-switcher.js _build/html/shared/version-switcher.js
python generate_versions_json.py --local
# Override html target to include local setup
html:
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
clean:
rm -rf generated
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
clean-versioned-html:
rm -rf $(BUILDDIR)/html/*
@echo "Cleaned versioned HTML builds."
.PHONY: help 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)