-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (34 loc) · 939 Bytes
/
Makefile
File metadata and controls
42 lines (34 loc) · 939 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
rust-version:
rustc --version # rustc compiler
cargo --version # cargo package manager
rustfmt --version # rust formatter
rustup --version # rust toolchain manager
clippy-driver --version # rust linter
format:
cargo fmt
lint:
cargo clippy
test:
cargo test
run:
cargo run -r
release:
cargo build -r
strip target/release/prepare-commit-msg
install: release
$(eval GIT_HOOKS_PATH := $(shell git config --global core.hooksPath))
@if [ -z "$(GIT_HOOKS_PATH)" ]; then \
GIT_HOOKS_PATH="~/.git_hooks"; \
mkdir -p $(GIT_HOOKS_PATH); \
git config --global core.hooksPath $(GIT_HOOKS_PATH); \
fi
cp -u target/release/prepare-commit-msg $(GIT_HOOKS_PATH)/prepare-commit-msg
clean:
cargo clean
rm -rf target
uninstall:
$(eval GIT_HOOKS_PATH := $(shell git config --global core.hooksPath))
@if [ -z "$(GIT_HOOKS_PATH)" ]; then \
GIT_HOOKS_PATH="~/.git_hooks"; \
fi
rm -f $(GIT_HOOKS_PATH)/prepare-commit-msg