-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
68 lines (52 loc) · 2.3 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
# Install to /usr unless otherwise specified, such as `make PREFIX=/app`
PREFIX=/usr
# What to run to install various files
INSTALL=install -D
# Run to install the actual binary
INSTALL_PROGRAM=$(INSTALL)
# Run to install application data, with differing permissions
INSTALL_DATA=$(INSTALL) -m 644
# Directories into which to install the various files
bindir=$(DESTDIR)$(PREFIX)/bin
sharedir=$(DESTDIR)$(PREFIX)/share
.PHONY: clean clean-all install copy-data uninstall cargo-publish push
# Build the application
target/release/machin: src
cargo build --release
test:
cargo test
install: target/release/machin copy-data
# Install binary
$(INSTALL_PROGRAM) target/release/machin $(bindir)/machconvert
$(INSTALL_PROGRAM) target/release/machin $(bindir)/machmap
$(INSTALL_PROGRAM) target/release/machin $(bindir)/machreduce
copy-data:
$(INSTALL_DATA) machconvert.bash $(sharedir)/bash-completion/completions/machconvert.bash
$(INSTALL_DATA) machconvert.fish $(sharedir)/fish/vendor_completions.d/machconvert.fish
$(INSTALL_DATA) _machconvert $(sharedir)/zsh/site-functions/_machconvert
$(INSTALL_DATA) machmap.bash $(sharedir)/bash-completion/completions/machmap.bash
$(INSTALL_DATA) machmap.fish $(sharedir)/fish/vendor_completions.d/machmap.fish
$(INSTALL_DATA) _machmap $(sharedir)/zsh/site-functions/_machmap
$(INSTALL_DATA) machreduce.bash $(sharedir)/bash-completion/completions/machreduce.bash
$(INSTALL_DATA) machreduce.fish $(sharedir)/fish/vendor_completions.d/machreduce.fish
$(INSTALL_DATA) _machreduce $(sharedir)/zsh/site-functions/_machreduce
uninstall:
rm -f $(sharedir)/bash-completion/completions/machconvert.bash
rm -f $(sharedir)/fish/vendor_completions.d/machconvert.fish
rm -f $(sharedir)/zsh/site-functions/_machconvert
rm -f $(sharedir)/bash-completion/completions/machmap.bash
rm -f $(sharedir)/fish/vendor_completions.d/machmap.fish
rm -f $(sharedir)/zsh/site-functions/_machmap
rm -f $(sharedir)/bash-completion/completions/machreduce.bash
rm -f $(sharedir)/fish/vendor_completions.d/machreduce.fish
rm -f $(sharedir)/zsh/site-functions/_machreduce
# Remove the binary
rm -f $(bindir)/machconvert
rm -f $(bindir)/machmap
rm -f $(bindir)/machreduce
cargo-publish:
cargo clippy && cargo fmt && cargo publish --no-verify
clean:
cargo clean
push:
cargo clippy && cargo fmt && git push