-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (76 loc) · 5.2 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
PREFIX ?= /usr
CARGO_BUILD_ARGS ?= --release
TARGET_DIR ?= release
build:
@glib-compile-schemas ./schemas
@./scripts/translations.sh update
@cargo build $(CARGO_BUILD_ARGS)
@./scripts/flatpak-cargo-generator.py Cargo.lock -o flatpak.lock || true
install: build
@mkdir -p "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@mkdir -p "$(PREFIX)/share/applications/"
@mkdir -p "$(PREFIX)/share/glib-2.0/schemas/"
@mkdir -p "$(PREFIX)/share/metainfo/"
@mkdir -p "$(PREFIX)/bin"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.About.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Closed.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Alcohol.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.AnimalWelfare.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Cattle.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Fish.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Game.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Garlic.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Lamb.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.MensaVital.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Organic.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Pig.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Poultry.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.SoupOfTheDay.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Vegan.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 icons/io.github.fin_ger.OvGUCanteen.Vegetarian.svg "$(PREFIX)/share/icons/hicolor/scalable/apps/"
@install -m 0644 schemas/io.github.fin_ger.OvGUCanteen.gschema.xml "$(PREFIX)/share/glib-2.0/schemas/"
@install -m 0644 data/io.github.fin_ger.OvGUCanteen.metainfo.xml "$(PREFIX)/share/metainfo/"
@glib-compile-schemas "$(PREFIX)/share/glib-2.0/schemas/"
@desktop-file-install -m 0644 --dir="$(PREFIX)/share/applications/" data/io.github.fin_ger.OvGUCanteen.desktop
@install -s -m 0755 "target/$(TARGET_DIR)/ovgu-canteen-gtk" "$(PREFIX)/bin/"
@./scripts/translations.sh install
@update-desktop-database "$(PREFIX)/share/applications"
@gtk-update-icon-cache
run:
@$(MAKE) -s install PREFIX=$(HOME)/.local CARGO_BUILD_ARGS= TARGET_DIR=debug
@ovgu-canteen-gtk
uninstall:
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.About.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Closed.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Alcohol.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.AnimalWelfare.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Cattle.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Fish.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Game.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Garlic.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Lamb.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.MensaVital.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Organic.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Pig.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Poultry.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.SoupOfTheDay.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Vegan.svg"
@rm "$(PREFIX)/share/icons/hicolor/scalable/apps/io.github.fin_ger.OvGUCanteen.Vegetarian.svg"
@rm "$(PREFIX)/share/glib-2.0/schemas/io.github.fin_ger.OvGUCanteen.gschema.xml"
@glib-compile-schemas "$(PREFIX)/share/glib-2.0/schemas/"
@rm "$(PREFIX)/share/applications/io.github.fin_ger.OvGUCanteen.desktop"
@rm "$(PREFIX)/bin/ovgu-canteen-gtk"
@./scripts/translations.sh uninstall
clean:
@$(MAKE) -s uninstall PREFIX=$(HOME)/.local
@echo "Installation files have been cleaned. To also clean cargo build files run 'cargo clean'"
flatpak:
@mkdir -p target/flatpak
@flatpak-builder --install target/flatpak --force-clean --user -y dist/flatpak/io.github.fin_ger.OvGUCanteen.json
flatpak-clean:
@rm -r .flatpak-builder
@rm -r target/flatpak
release:
@cargo release