-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (72 loc) · 3.54 KB
/
Copy pathMakefile
File metadata and controls
100 lines (72 loc) · 3.54 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env bash
pwd = ${shell pwd}
app-name = wayshot
version = `git describe --tags --abbrev=0`
# windows, wayland-portal, wayland-wlr
features ?= wayland-wlr
linux-app-postfix = $(if $(filter wayland-portal,$(features)),portal,wlr)
run-env = RUST_LOG=debug
build-env = SLINT_STYLE=fluent CMAKE_POLICY_VERSION_MINIMUM=3.5
proj-features = --features=${features},database,qrcode,center-window
all: build-release
build:
$(build-env) cargo build --bin ${app-name} --no-default-features --features=${features}
build-release:
$(build-env) cargo build --release --bin ${app-name} --no-default-features --features=${features}
debug:
$(build-env) $(run-env) cargo run --bin ${app-name} --no-default-features --features=${features}
debug-winit:
SLINT_BACKEND=winit-femtovg $(build-env) $(run-env) cargo run --bin ${app-name} --no-default-features --features=${features}
run-release:
$(build-env) RUST_LOG=info cargo run --release --bin ${app-name} --no-default-features --features=${features}
run-release-winit:
SLINT_BACKEND=winit-femtovg $(build-env) RUST_LOG=info cargo run --release --bin ${app-name} --no-default-features --features=${features}
cursor-debug:
$(run-env) cargo run -p wayshot-cursor --bin wayshot-cursor
cursor-release:
cargo build --release -p wayshot-cursor --bin wayshot-cursor
tr:
cargo run -p tr-helper --bin tr-helper -- -x vendor
icon:
cargo run -p icon-helper --bin icon-helper -- -i ${app-name}/ui/images -o ${app-name}/ui/base
icon-strip:
cargo run -p icon-helper --bin icon-helper -- -i ${app-name}/ui/images -o ${app-name}/ui/base --strip
slint-viewer:
$(build-env) slint-viewer --auto-reload -I $(app-name)/ui ${app-name}/ui/desktop-window.slint
clippy:
cargo clippy $(proj-features)
check:
$(build-env) cargo check --no-default-features $(proj-features) --bin ${app-name}
clean:
cargo clean
packing-windows:
- rm -rf target/${app-name}-*-x86_64-windows
- rm -rf target/${app-name}-*-x86_64-windows.tar.gz
cp -rf package/windows target/${app-name}-${version}-x86_64-windows
cp -f target/release/${app-name}.exe target/${app-name}-${version}-x86_64-windows
cd target && tar -zcf ${app-name}-${version}-x86_64-windows.tar.gz ${app-name}-${version}-x86_64-windows
- rm -rf target/${app-name}-${version}-x86_64-windows
packing-linux: linux-bin deb appimage flatpak
linux-bin:
- rm -f target/${app-name}-*-x86_64-linux-${linux-app-postfix}.tar.gz
tar -zcf target/${app-name}-${version}-x86_64-linux-${linux-app-postfix}.tar.gz -C target/release ${app-name}
deb:
- rm -f target/${app-name}-*-x86_64-linux-${linux-app-postfix}.deb
cd package/deb && bash -e "./pkg-deb.sh"
mv package/deb/$(app-name).deb target/${app-name}-${version}-x86_64-linux-${linux-app-postfix}.deb
appimage:
- rm -f target/${app-name}-*-x86_64-linux-${linux-app-postfix}.AppImage
cd package/appimage && bash -e "./pkg-appimage.sh"
mv package/appimage/$(app-name).AppImage target/${app-name}-${version}-x86_64-linux-${linux-app-postfix}.AppImage
flatpak:
- rm -f target/${app-name}-*-x86_64-linux-${linux-app-postfix}.flatpak
cd package/flatpak && bash -e "./pkg-flatpak.sh"
mv package/flatpak/$(app-name).flatpak target/${app-name}-${version}-x86_64-linux-${linux-app-postfix}.flatpak
archlinux:
- rm -f target/${app-name}-*-x86_64-linux-${linux-app-postfix}.pkg.tar.zst
cd package/archlinux && bash -e "./pkg-arch.sh"
mv package/archlinux/$(app-name)-*.pkg.tar.zst target/${app-name}-${version}-x86_64-linux-${linux-app-postfix}.pkg.tar.zst
app-name:
echo "$(app-name)" > target/app-name
get-font-name:
fc-scan ./${app-name}/ui/fonts/*.{ttf,otf} | grep "fullname:"