-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
52 lines (37 loc) · 983 Bytes
/
Makefile
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
CARGO := @cargo
MOLC := moleculec
MOLC_VERSION := 0.7.5
NEXTEST_RUN_ARGS := --no-fail-fast --success-output never --failure-output final
#
# Generate Codes
#
.PHONY: generate-protocols
GEN_MOL_IN_DIR := verifier/schemas
GEN_MOL_OUT_DIR := verifier/src/types/generated
GEN_MOL_FILES := ${GEN_MOL_OUT_DIR}/types.rs
generate-protocols: check-moleculec-version ${GEN_MOL_FILES}
${GEN_MOL_OUT_DIR}/%.rs: ${GEN_MOL_IN_DIR}/%.mol
${MOLC} --language rust --schema-file $< | rustfmt > $@
.PHONY: check-moleculec-version
check-moleculec-version:
test "$$(${MOLC} --version | awk '{ print $$2 }' | tr -d ' ')" = ${MOLC_VERSION}
#
# Check
#
check:
${CARGO} check --workspace
fmt:
${CARGO} fmt --all --check
clippy:
${CARGO} clippy --locked --workspace --tests -- --deny warnings
test:
${CARGO} nextest run ${NEXTEST_RUN_ARGS} --workspace
#
# Build
#
doc:
${CARGO} doc --workspace --no-deps
build:
${CARGO} build --workspace
release:
${CARGO} build --workspace --release