forked from apache/cassandra-gocql-driver
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathMakefile
More file actions
110 lines (93 loc) · 2.79 KB
/
Makefile
File metadata and controls
110 lines (93 loc) · 2.79 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
SHELL=bash
# Global variables
# You can set these variables from the command line.
UV = uv
SPHINXOPTS = -j auto
SPHINXBUILD = $(UV) run sphinx-build
PAPER =
BUILDDIR = _build
SOURCEDIR = source
# Internal variables
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
TESTSPHINXOPTS = $(ALLSPHINXOPTS) -W --keep-going
.PHONY: all
all: dirhtml
# Setup commands
.PHONY: setupenv
setupenv:
@while IFS= read -r line; do \
if [[ "$${line}" =~ ^[[:space:]]*requires[[:space:]]*= ]]; then\
content="$${line#*=}";\
content="$${content//[[:space:]]/}";\
content="$${content#[}";\
content="$${content%]}";\
IFS=',' read -ra items <<< "$$content";\
for item in "$${items[@]}"; do\
item="$${item%\"}";\
item="$${item#\"}";\
pip install -q uv;\
done;\
fi;\
done < pyproject.toml
.PHONY: setup
setup:
$(UV) sync
.PHONY: update
update:
$(UV) sync --upgrade
# Clean commands
.PHONY: pristine
pristine: clean
git clean -dfX
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
# Generate output commands
.PHONY: dirhtml
dirhtml: setup
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
singlehtml: setup
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: epub
epub: setup
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: epub3
epub3: setup
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
.PHONY: multiversion
multiversion: setup
$(UV) run sphinx-multiversion source $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: redirects
redirects: setup
$(UV) run redirects-cli fromfile --yaml-file _utils/redirects.yaml --output-dir $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
# Preview commands
.PHONY: preview
preview: setup
$(UV) run sphinx-autobuild -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml --port 5500
.PHONY: multiversionpreview
multiversionpreview: multiversion
$(UV) run python -m http.server 5500 --directory $(BUILDDIR)/dirhtml
# Test commands
.PHONY: test
test: setup
$(SPHINXBUILD) -b dirhtml $(TESTSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: linkcheck
linkcheck: setup
$(SPHINXBUILD) -b linkcheck $(SOURCEDIR) $(BUILDDIR)/linkcheck