-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
49 lines (33 loc) · 1.08 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
45
46
47
48
49
SHELL = /bin/bash -o pipefail
# some platform compatibility hacks
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
execsuffix := $(if $(findstring Windows_NT,$(OS)),.exe, )
pathchar := $(if $(findstring Windows_NT,$(OS)),\,/)
sourcefiles := $(call rwildcard,src,*.rs)
all: test build
debugtarget := target$(pathchar)debug$(pathchar)ucg$(execsuffix)
releasetarget := target$(pathchar)release$(pathchar)ucg$(execsuffix)
$(debugtarget): $(sourcefiles)
cargo build
$(releasetarget): $(sourcefiles)
cargo build --release
build: $(debugtarget)
cargo build
buildrelease: $(releasetarget)
test: unit integration stdlibtest
unit:
cargo test
integration:
cargo run -- test -r integration_tests
stdlibtest:
cargo run -- test -r std$(pathchar)tests
install: test
cargo install --path . --force
publish: build test
cargo publish
(cd docsite; make deploysite)
bench: buildrelease
hyperfine --warmup=5 --runs=50 "target$(pathchar)release$(pathchar)ucg$(execsuffix) test -r integration_tests"
clean:
rm -f integration.log stdlibtest.log unittest.log
cargo clean