-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (42 loc) · 1.66 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
INSTALL = install
INSTALL_PROGRAM = ${INSTALL} -D -m 0755
INSTALL_DATA = ${INSTALL} -D -m 0644
prefix = /usr
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
datarootdir = $(prefix)/share
app = boiling_frog
qualified_app = "com.robwilliamson.$(app)"
data_folder = "./boiling_frog/data"
icon_name = "$(qualified_app).png"
icon_source = "$(data_folder)/$(icon_name)"
scaled_icons = "./scaled_icons"
icon_scales = 128x128 16x16 192x192 24x24 256x256 32x32 36x36 48x48 512x512 64x64 72x72 96x96
app_destination = "$(DESTDIR)$(bindir)/$(app)"
desktop_destination = "$(DESTDIR)$(datarootdir)/applications/$(qualified_app).desktop"
icon_destination = "$(DESTDIR)$(datarootdir)/icons/hicolor"
all: build
clean:
cargo clean
build:
cargo build
cargo build --release
install: do_install refresh
do_install:
$(INSTALL_PROGRAM) "./target/release/$(app)" "$(app_destination)"
$(INSTALL_DATA) "$(data_folder)/$(qualified_app).desktop" "$(desktop_destination)"
for i in $(icon_scales); do $(INSTALL_DATA) "$(scaled_icons)/$(qualified_app)_$${i}.png" "$(icon_destination)/$${i}/apps/$(icon_name)" ; done
$(INSTALL_DATA) "./boiling_frog/data/$(qualified_app).png" "$(icon_destination)"
uninstall: do_uninstall refresh
do_uninstall:
rm -f "$(app_destination)" || true
rm -f "$(desktop_destination)" || true
for i in $(icon_scales); do rm "$(icon_destination)/$${i}/apps/$(icon_name)" ||: ; done
reinstall: do_uninstall install
refresh:
gtk-update-icon-cache
update-desktop-database
#Regenerate the icons. Requires imagemagick to be installed.
icons:
@mkdir -p "$(scaled_icons)"
for i in $(icon_scales); do convert "$(icon_source)" -resize $$i "$(scaled_icons)/$(qualified_app)_$${i}.png"; done