-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (61 loc) · 1.91 KB
/
Copy pathMakefile
File metadata and controls
84 lines (61 loc) · 1.91 KB
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
74
75
76
77
78
79
80
81
82
83
84
prog := termusic
server :=termusic-server
ifeq ($(OS),Windows_NT)
# Windows
prog := termusic.exe
server := termusic-server.exe
endif
default_cargo_home = $(HOME)/.local/share/cargo
# define CARGO_HOME if not defined
ifndef CARGO_HOME
CARGO_HOME=$(default_cargo_home)
endif
# needs to be after CARGO_HOME, otherwise the default is not ever added
install_to = $(CARGO_HOME)/bin
ifeq ($(OS),Windows_NT)
install_to = $(USERPROFILE)\.cargo\bin
endif
default: fmt
fmt:
cargo fmt --all
cargo check --all --features cover,all-backends
cargo clippy --all --features cover,all-backends
# cargo clippy -- -D warnings
run:
cargo run
# default backend, default features
release:
cargo build --release --all
# backends + cover
rusty:
cargo build --features cover --release --all
mpv:
# disable "rusty" backend default
cargo build --no-default-features --features cover,mpv --release --all
gst:
# disable "rusty" backend default
cargo build --no-default-features --features cover,gst --release --all
all-backends:
export "CARGO_PROFILE_RELEASE_LTO=off" && cargo build --features cover,all-backends --release --all
all-backends-test:
cargo build --features cover,all-backends --all
test:
cargo test --features cover,all-backends --release --all
# end backends + cover
full: all-backends post
minimal: release post
post:
echo $(install_to)
cp -f target/release/$(prog) "$(install_to)"
cp -f target/release/$(server) "$(install_to)"
install: release post
win:
cargo build --workspace --features rusty-soundtouch
winrelease:
set "CARGO_PROFILE_RELEASE_LTO=off" && cargo build --release --workspace --features rusty-soundtouch
winpost:
powershell -command "Copy-Item -force -Path 'target\release\$(prog)' -Destination '$(install_to)'"
powershell -command "Copy-Item -force -Path 'target\release\$(server)' -Destination '$(install_to)'"
wininstall: winrelease winpost
wintest: win winpost
fulltest: all-backends-test post