-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
73 lines (61 loc) · 1.67 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
export RUST_BACKTRACE := 1
# Usage: make <command> ARGS="--features <feature> --bin <bin_name>"
#
# Avaialble commands:
# all
# build
# run
# test
# clippy
# fmt
# clean
#
# Available features:
# local-tdlib
# download-tdlib
# pkg-config
#
# Available bin_name:
# tgt
# example
# telegram
# get_me
all:
$(MAKE) fmt
$(MAKE) clippy ARGS="--features local-tdlib"
$(MAKE) test ARGS="--features local-tdlib"
run_local:
cargo run --no-default-features --features local-tdlib $(ARGS)
build_local:
cargo build --no-default-features --features local-tdlib $(ARGS)
# Example 1: make build ARGS="--features download-tdlib"
# Example 2: make build ARGS="--features download-tdlib --example telegram"
build:
cargo build --no-default-features $(ARGS)
# Example 1: make run ARGS="--features download-tdlib"
# Example 2: make run ARGS="--features download-tdlib --example telegram"
run:
cargo run --no-default-features $(ARGS)
test:
cargo test --no-default-features $(ARGS) -- --nocapture --test-threads=1
clippy:
cargo clippy --no-default-features --all-targets $(ARGS) -- -D warnings
fmt:
cargo fmt --all
cargo fmt --all -- --check
clean:
cargo clean
help:
@echo "Usage: make [target]"
@echo ""
@echo "Available targets:"
@echo " all # Run fmt, clippy and test"
@echo " build # Build the project"
@echo " run # Run the project"
@echo " test # Run the tests"
@echo " clippy # Run clippy"
@echo " fmt # Run rustfmt"
@echo " clean # Clean the project"
@echo " help # Display this help message"
# Each entry of .PHONY is a target that is not a file
.PHONY: build run test clean