forked from sccn/eegprep
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (76 loc) · 2.37 KB
/
Copy pathMakefile
File metadata and controls
83 lines (76 loc) · 2.37 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXBUILD ?= sphinx-build
SPHINXOPTS ?= --keep-going
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make help" is always printed when you enter `make` without arguments
.PHONY: help
help:
@echo "Sphinx documentation build targets:"
@echo ""
@echo " make html - Build HTML documentation"
@echo " make clean - Remove build artifacts"
@echo " make linkcheck - Check for broken links"
@echo " make spelling - Check spelling"
@echo " make serve - Serve documentation locally on port 8000"
@echo ""
@echo "Variables:"
@echo " SPHINXBUILD = $(SPHINXBUILD)"
@echo " SPHINXOPTS = $(SPHINXOPTS)"
@echo " SOURCEDIR = $(SOURCEDIR)"
@echo " BUILDDIR = $(BUILDDIR)"
# Clean build artifacts
.PHONY: clean
clean:
@echo "Removing build artifacts..."
@rm -rf $(BUILDDIR)
@rm -rf $(SOURCEDIR)/auto_examples
@echo "Build artifacts removed successfully."
# Build HTML documentation
.PHONY: html
html:
@echo "Building HTML documentation..."
@$(SPHINXBUILD) -b html $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html
@if [ $$? -eq 0 ]; then \
echo ""; \
echo "Build finished successfully! The HTML pages are in $(BUILDDIR)/html"; \
else \
echo "Build failed!"; \
exit 1; \
fi
# Check for broken links
.PHONY: linkcheck
linkcheck:
@echo "Checking for broken links..."
@$(SPHINXBUILD) -b linkcheck $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/linkcheck
@if [ $$? -eq 0 ]; then \
echo ""; \
echo "Link check finished! Results are in $(BUILDDIR)/linkcheck"; \
else \
echo "Link check failed!"; \
exit 1; \
fi
# Check spelling
.PHONY: spelling
spelling:
@echo "Checking spelling..."
@$(SPHINXBUILD) -b spelling $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/spelling
@if [ $$? -eq 0 ]; then \
echo ""; \
echo "Spelling check finished! Results are in $(BUILDDIR)/spelling"; \
else \
echo "Spelling check failed!"; \
exit 1; \
fi
# Serve documentation locally
.PHONY: serve
serve: html
@echo "Serving documentation on http://localhost:8000"
@echo "Press Ctrl+C to stop the server"
@cd $(BUILDDIR)/html && python -m http.server 8000
# 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) -b $@ $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/$@