-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (36 loc) · 1.32 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
INSTALL=install
INSTALL_PROGRAM=$(INSTALL)
INSTALL_DATA=$(INSTALL) -m 644
bin_dir=$(HOME)/.local/bin
data_dir=$(HOME)/.local/share
config_dir=$(HOME)/.config
name=com.github.ankjevel.tick-tock
.PHONY : clean install uninstall
target/release/tick-tock : src
cargo build --release
install : target/release/tick-tock
# Install binary
$(INSTALL_PROGRAM) target/release/tick-tock $(bin_dir)/$(name)
# Install config
$(INSTALL_DATA) config.json $(config_dir)/$(name).json
# Install icon(s)
# $(INSTALL_DATA) data/$(name).svg $(data_dir)/icons/hicolor/scalable/apps/$(name).svg
# $(INSTALL_DATA) data/$(name).64.png $(data_dir)/icons/hicolor/64x64/apps/$(name).png
# $(INSTALL_DATA) data/$(name).128.png $(data_dir)/icons/hicolor/128x128/apps/$(name).png
# Force icon cache refresh
# touch $(data_dir)/icons/hicolor
# Install desktop file
$(INSTALL_DATA) data/$(name).desktop $(data_dir)/applications/$(name).desktop
uninstall :
# Remove the desktop file
rm -f $(data_dir)/applications/$(name).desktop
# Remove the icon(s)
# rm -f $(data_dir)/icons/hicolor/scalable/apps/$(name).svg
# rm -f $(data_dir)/icons/hicolor/64x64/apps/$(name).png
# rm -f $(data_dir)/icons/hicolor/128x128/apps/$(name).png
# Remove the config
rm -f $(config_dir)/$(name).json
# Remove the binary
rm -f $(bin_dir)/bin/$(name)
clean :
cargo clean