-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
133 lines (104 loc) · 4.7 KB
/
Copy pathMakefile
File metadata and controls
133 lines (104 loc) · 4.7 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
122
123
124
125
126
127
128
129
130
131
132
133
SHELL := /bin/bash
PY_MODULE := limbo
ALL_PY_SRCS := $(shell find $(PY_MODULE) -name '*.py')
# Optionally overriden by the user, if they're using a virtual environment manager.
VENV ?= .venv
# On Windows, venv scripts/shims are under `Scripts` instead of `bin`.
VENV_BIN := $(VENV)/bin
ifeq ($(OS),Windows_NT)
VENV_BIN := $(VENV)/Scripts
endif
NEEDS_VENV = $(VENV)/pyvenv.cfg
# Optionally overridden by the user/CI, to limit the installation to a specific
# subset of development dependencies.
INSTALL_EXTRA := dev
.PHONY: all
all:
@echo "Run my targets individually!"
$(NEEDS_VENV): pyproject.toml
uv venv $(VENV)
uv pip install -e .[$(INSTALL_EXTRA)]
.PHONY: dev
dev: $(NEEDS_VENV)
.PHONY: lint
lint: $(NEEDS_VENV)
. $(VENV_BIN)/activate && \
ruff format --check $(ALL_PY_SRCS) && \
ruff check $(ALL_PY_SRCS) && \
mypy $(PY_MODULE)
.PHONY: reformat
reformat: $(NEEDS_VENV)
. $(VENV_BIN)/activate && \
ruff check --fix $(ALL_PY_SRCS) && \
ruff format $(ALL_PY_SRCS)
.PHONY: edit
edit:
$(EDITOR) $(ALL_PY_SRCS)
.PHONY: run
run: $(NEEDS_VENV)
@./$(VENV_BIN)/python -m $(PY_MODULE) $(ARGS)
limbo-schema.json: $(NEEDS_VENV) $(PY_MODULE)/models.py
$(MAKE) run ARGS="schema -o limbo-schema.json"
.PHONY: limbo.json
limbo.json: $(NEEDS_VENV)
$(MAKE) run ARGS="compile -o limbo.json"
.PHONY: online-cases
online-cases: $(NEEDS_VENV)
$(MAKE) run ARGS="online-cases"
.PHONY: testcases
testcases: $(NEEDS_VENV)
$(MAKE) run ARGS="compile --testcases testcases/ --force"
.PHONY: build-harnesses
build-harnesses:
$(MAKE) -C harness/gocryptox509
$(MAKE) -C harness/openssl
cargo build --bin rust-rustls-harness
.PHONY: test-go
test-go:
$(MAKE) -C harness/gocryptox509
$(MAKE) run ARGS="harness ./harness/gocryptox509/gocryptox509 --output ./results/go.json"
.PHONY: test-openssl
test-openssl:
$(MAKE) -C harness/openssl openssl-1.1.1 openssl-3.0 openssl-3.2 openssl-3.3 openssl-3.4 openssl-3.5 openssl-3.6 openssl-4.0
$(MAKE) run ARGS="harness --output ./results/openssl-1.1.1.json -- docker run --rm -i x509-limbo-openssl-1.1.1"
$(MAKE) run ARGS="harness --output ./results/openssl-3.0.json -- docker run --rm -i x509-limbo-openssl-3.0"
$(MAKE) run ARGS="harness --output ./results/openssl-3.2.json -- docker run --rm -i x509-limbo-openssl-3.2"
$(MAKE) run ARGS="harness --output ./results/openssl-3.3.json -- docker run --rm -i x509-limbo-openssl-3.3"
$(MAKE) run ARGS="harness --output ./results/openssl-3.4.json -- docker run --rm -i x509-limbo-openssl-3.4"
$(MAKE) run ARGS="harness --output ./results/openssl-3.5.json -- docker run --rm -i x509-limbo-openssl-3.5"
$(MAKE) run ARGS="harness --output ./results/openssl-3.6.json -- docker run --rm -i x509-limbo-openssl-3.6"
$(MAKE) run ARGS="harness --output ./results/openssl-4.0.json -- docker run --rm -i x509-limbo-openssl-4.0"
.PHONY: test-libressl
test-libressl:
$(MAKE) -C harness/openssl libressl-3.9 libressl-4.0 libressl-4.1 libressl-4.2 libressl-4.3
$(MAKE) run ARGS="harness --output ./results/libressl-3.9.json -- docker run --rm -i x509-limbo-libressl-3.9"
$(MAKE) run ARGS="harness --output ./results/libressl-4.0.json -- docker run --rm -i x509-limbo-libressl-4.0"
$(MAKE) run ARGS="harness --output ./results/libressl-4.1.json -- docker run --rm -i x509-limbo-libressl-4.1"
$(MAKE) run ARGS="harness --output ./results/libressl-4.2.json -- docker run --rm -i x509-limbo-libressl-4.2"
$(MAKE) run ARGS="harness --output ./results/libressl-4.3.json -- docker run --rm -i x509-limbo-libressl-4.3"
.PHONY: test-boringssl
test-boringssl:
$(MAKE) -C harness/openssl boringssl
$(MAKE) run ARGS="harness --output ./results/boringssl-legacy.json -- docker run --rm -i x509-limbo-boringssl"
.PHONY: test-aws-lc
test-aws-lc:
$(MAKE) -C harness/openssl aws-lc
$(MAKE) run ARGS="harness --output ./results/aws-lc.json -- docker run --rm -i x509-limbo-aws-lc"
.PHONY: test-rustls-webpki
test-rustls-webpki:
@cargo build --bin rust-rustls-harness
$(MAKE) run ARGS="harness ./target/debug/rust-rustls-harness --output ./results/rustls-webpki.json"
.PHONY: test-pyca-cryptography
test-pyca-cryptography: $(NEEDS_VENV)
$(MAKE) run ARGS="harness --output ./results/pyca-cryptography.json -- ./$(VENV_BIN)/python ./harness/pyca-cryptography/main.py"
.PHONY: test-certvalidator
test-certvalidator: $(NEEDS_VENV)
$(MAKE) run ARGS="harness --output ./results/certvalidator.json -- ./$(VENV_BIN)/python ./harness/certvalidator/main.py"
.PHONY: test-gnutls
test-gnutls:
$(MAKE) run ARGS="harness --output ./results/gnutls.json -- ./$(VENV_BIN)/python ./harness/gnutls/test-gnutls"
.PHONY: test
test: test-go test-openssl test-libressl test-boringssl test-aws-lc test-rustls-webpki test-pyca-cryptography test-certvalidator test-gnutls
.PHONY: site
site: $(NEEDS_VENV)
./$(VENV_BIN)/mkdocs build