-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.58 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.58 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
RUNTESTCASE = _run_test_case() { \
case="$(filter-out $@,$(MAKECMDGOALS))"; \
if [ -n "$${case}" ]; then \
RUST_BACKTRACE=full cargo test $${case} -- --nocapture --test-threads=1; \
else \
RUST_BACKTRACE=full cargo test -- --nocapture --test-threads=1; \
fi \
}
RUNBENCHCASE = _run_bench_case() { \
case="$(filter-out $@,$(MAKECMDGOALS))"; \
if [ -n "$${case}" ]; then \
RUST_BACKTRACE=full cargo test $${case} --release -- --nocapture --test-threads=1; \
else \
echo should specify test case; \
fi \
}
INSTALL_GITHOOKS = _install_githooks() { \
git config core.hooksPath ./git-hooks; \
}
.PHONY: git-hooks
git-hooks:
@$(INSTALL_GITHOOKS); _install_githooks
.PHONY: init
init: git-hooks
.PHONY: fmt
fmt: init
cargo fmt
.PHONY: test
test: init
@echo "Run test"
@${RUNTESTCASE}; _run_test_case
@echo "Done"
.PHONY: bench
bench:
@${RUNBENCHCASE}; _run_bench_case
.PHONY: build
build: init
cargo build
.DEFAULT_GOAL = build
# Target name % means that it is a rule that matches anything, @: is a recipe;
# the : means do nothing
%:
@: