-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathMakefile
44 lines (32 loc) · 1.11 KB
/
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
%:
@:
.PHONY: all build test check clean doc
args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
CARGO = cargo
FEATURES := fs unstable
all: test build
build:
${CARGO} build --release --features full,unstable
test:
${CARGO} test --features full,unstable
check:
${CARGO} check --release --all-features --all-targets
${CARGO} clippy --release --all-features --all-targets
${CARGO} fmt --check
clean:
${CARGO} clean
doc:
${CARGO} doc --no-deps --open --features full
# Compute the powerset of all the given features and save it to a file
.feature-sets:
powerset() { [ $$# -eq 0 ] && echo || (shift; powerset "$$@") | while read r ; do echo "$$1 $$r"; echo "$$r"; done };\
powerset $$(echo "$(FEATURES)") > .features-sets
check-all-features-set: .feature-sets
# Read the file to run cargo clippy on all those features sets
cat .features-sets | while read features_set; do \
echo "Clippy client with feature '$$features_set''"; \
${CARGO} clippy -p mithril-client --features "$$features_set"; \
done
echo "Clippy client without features"; \
${CARGO} clippy -p mithril-client
rm .features-sets