-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 988 Bytes
/
Makefile
File metadata and controls
48 lines (36 loc) · 988 Bytes
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
SOURCE_FILES := $(shell find src -type f)
ifeq ($(OS),Windows_NT)
TARGET_EXTENSION := .exe
else
TARGET_EXTENSION :=
endif
TARGET := versioned-files$(TARGET_EXTENSION)
target/debug/$(TARGET): Cargo.toml Cargo.lock src/ $(SOURCE_FILES)
cargo build
target/release/$(TARGET): Cargo.toml Cargo.lock src/ $(SOURCE_FILES)
cargo build --release
$(TARGET): target/release/$(TARGET)
mv target/release/$@ .
.PHONY=clean
clean:
rm -rf target/
rm -f $(TARGET)
.PHONY=check
lint:
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings -D clippy::all -D clippy::pedantic -D clippy::cargo -A clippy::multiple-crate-versions
cargo check
.PHONY=format
format:
cargo fix --allow-dirty --allow-staged
cargo fmt --all
.PHONY=test-integration
test-integration: target/release/$(TARGET)
cargo test --test '*' --locked
.PHONY=test-unit
test-unit:
cargo test --bins --locked
.PHONY=test
test: test-unit test-integration
.PHONY=precommit
precommit: lint test