-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathMakefile
More file actions
121 lines (88 loc) · 2.73 KB
/
Copy pathMakefile
File metadata and controls
121 lines (88 loc) · 2.73 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
111
112
113
114
115
116
117
118
119
120
121
export OPAM_SWITCH ?= alectryon
export OCAML_VERSION ?= 5.4.0
export ROCQ_VERSION ?= 9.1.0
export ROCQ_VERSIONS ?= $(ROCQ_VERSION)
export VSROCQ_VERSION ?= 2.4.3
export EASYCRYPT_VERSION ?= r2026.03
export DAFNY_VERSION ?= 4.11.0
export LEAN3_VERSION ?= 3.51.1
export ELAN_VERSION ?= 4.2.1
export LEAN4_VERSION ?= 4.28.0
export TYPST_VERSION ?= 0.14.2
PYTHON ?= python3
PYTHON_VENV ?= deps/.venv.$(shell hostname)
python_bin := $(PYTHON_VENV)/bin
export PATH := $(abspath $(python_bin)):$(PATH)
export PYTHONIOENCODING ?= utf-8
dependencies := $(python_bin)/pip
.PHONY: test rocq coverage develop lint-changes lint elisp init git-init pixel-diff
## Main targets
make := $(MAKE)
ifneq (,$(wildcard $(HOME)/.opam/$(OPAM_SWITCH)))
make := eval $$(opam env --switch=$(OPAM_SWITCH)); $(make)
endif
typeguard:
+$(make) TYPEGUARD=1 test
test: $(dependencies)
+$(make) -C recipes clean
+$(make) -C recipes all
rocq: $(dependencies)
+$(make) -C recipes --always-make rocq
elisp:
etc/tests/elisp.sh
FORCE:
recipes/%: FORCE
+$(make) -C recipes --always-make "$*"
## Screenshot
recipes/_output/tests/screenshot.pdf: recipes/_output/tests/screenshot.html
etc/pixel-diffs/screenshot.sh $< $@
etc/screenshot.svg: recipes/_output/tests/screenshot.pdf
pdf2svg $< $@
svgcleaner --multipass --indent 2 $@ $@
## Pixel diff
pixel-diff:
etc/pixel-diffs/diff.sh $$(git describe --tags --abbrev=0)
## Dependencies
ifeq ($(MAKECMDGOALS), init)
$(PYTHON_VENV):
$(PYTHON) -m venv $(PYTHON_VENV)
init: $(PYTHON_VENV)
python -m pip install -r deps/requirements.dev
git-init:
git config --local include.path ../etc/gitconfig
else
$(dependencies):
$(error Dependency $(notdir $@) not set up; try `make init`?)
endif
## Local development
.PHONY: _opam
lint-changes: $(dependencies)
etc/lint_changes.py CHANGES.rst
lint: $(dependencies)
vermin --target=3.9- --eval-annotations --violations alectryon
pylint alectryon
mypy --install-types alectryon/
pyright --project .
pyrefly check alectryon/
coverage: $(dependencies)
+$(make) -C recipes coverage
_opam:
deps/opam.sh $(OCAML_VERSION) \
--switch $(OPAM_SWITCH) \
--rocq-version $(ROCQ_VERSION) \
--vsrocq-version $(VSROCQ_VERSION) \
--easycrypt-version $(EASYCRYPT_VERSION)
## Docker
### Use `etc/docker.sh make …` to run in docker
# Either .dev or .ci
docker-build%: deps/Dockerfile%
docker build -t alectryon$* -f $< \
--build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) \
--build-arg OPAM_SWITCH --build-arg OCAML_VERSION \
--build-arg ROCQ_VERSION --build-arg ROCQ_VERSIONS --build-arg VSROCQ_VERSION \
--build-arg EASYCRYPT_VERSION \
--build-arg DAFNY_VERSION \
--build-arg LEAN3_VERSION \
--build-arg ELAN_VERSION --build-arg LEAN4_VERSION \
--build-arg TYPST_VERSION \
.