-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
123 lines (82 loc) · 2.38 KB
/
Makefile
File metadata and controls
123 lines (82 loc) · 2.38 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
.PHONY : all clean clean-python compile coverage idris lint machines rust test test-all type
all : machines idris lint test tools
clean-python :
rm -rf __pycache__ **/__pycache__ .mypy_cache .ruff_cache .coverage* html* build/ *.so **/*.so classes.png packages.png mypyc_annotation.html
clean : clean-python clean-rust
$(MAKE) -C machines clean
$(MAKE) -C idris clean
refresh : clean-python rust
quick-check : refresh trust lint coverage
## Odd langs ###########################
machines :
$(MAKE) -C machines
idris :
$(MAKE) -C idris
## Rust ################################
CARGO = cargo
RUSTFLAGS = RUSTFLAGS="-C target-cpu=native"
BUILD = $(RUSTFLAGS) $(CARGO) build
REL_TARGET = target/release/libexport.so
DEV_TARGET = target/debug/libexport.so
PYEXTENSIONS = tm/rust_stuff.so
MOVE_BUILD = cp $(BUILD_TARGET) $(PYEXTENSIONS)
rust :
$(BUILD) --release --package export
cp $(REL_TARGET) $(PYEXTENSIONS)
dev :
$(BUILD) --package export
cp $(DEV_TARGET) $(PYEXTENSIONS)
CARGO_VERSION = cargo --version
clippy :
$(CARGO_VERSION)
$(CARGO) fmt --check
$(CARGO) clippy --all-targets
CARGO_TEST = $(CARGO) test
trust :
$(CARGO_VERSION)
$(CARGO_TEST)
run :
$(CARGO_VERSION)
$(BUILD) --release --package run
$(RUSTFLAGS) time -p cargo run --release -p run
run-all:
$(CARGO_VERSION)
$(RUSTFLAGS) $(CARGO) run --release -p run -- --all
clean-rust :
cargo clean
## Python ##############################
PYTHON = python3
MODULES = tm tools test *.py
RUFF = $(PYTHON) -m ruff
PYLINT = $(PYTHON) -m pylint
lint : clippy rust
$(RUFF) --version
$(RUFF) check $(MODULES)
$(MAKE) type
$(PYLINT) --version
$(PYLINT) --enable-all-extensions $(MODULES) --ignore-patterns=.*.pyi
MYPY = $(PYTHON) -m mypy
type :
$(MYPY) --version
$(MYPY) $(MODULES)
MYPYC = $(PYTHON) -m mypyc
compile : rust
$(MYPYC) --version
$(MYPYC) tm tools test/lin_rec.py --exclude rust_stuff
mypyc-report : rust
$(MYPYC) --version
$(MYPYC) tm tools --exclude rust_stuff -a mypyc-report.html
PYTEST = $(PYTHON) -m unittest
test :
$(PYTEST) discover -v
test-all : compile
RUN_SLOW=1 $(MAKE) test
COVERAGE = $(PYTHON) -m coverage
COV_TESTS = test.test_coverage test.test_program test.test_num
coverage : rust
$(COVERAGE) --version
$(COVERAGE) run -m unittest -v $(COV_TESTS)
$(COVERAGE) combine --quiet
$(COVERAGE) html
diagrams :
pyreverse --only-classnames --no-standalone --colorized -o png tm tools test