-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (48 loc) · 1.6 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
APPNAME = linijice
PREFIX = build
BINDIR = $(PREFIX)/bin
SHAREDIR = $(PREFIX)/share
RESDIR = $(SHAREDIR)/$(APPNAME)
BINOUT = build
RESOUT = build/resources
.PHONY: $(BINOUT)/$(APPNAME)
all: $(BINOUT)/$(APPNAME)
$(BINOUT)/$(APPNAME): $(RESOUT)/builder.ui $(RESOUT)/shaders $(RESOUT)/data.gresource build
hare build \
-j 4 \
$$(pkg-config --libs-only-l --static libadwaita-1 epoxy) \
-D "resources: str = \"$(RESDIR)\"" \
-o $@ src
$(RESOUT)/shaders: resources/shaders
mkdir -p $@
cp -r $</* $@
$(RESOUT)/builder.ui: resources/builder.blp $(RESOUT)
blueprint-compiler compile $< --output $@
$(RESOUT)/data.gresource: resources/data.gresource.xml $(RESOUT)
glib-compile-resources --sourcedir="resources" --target=$@ --generate $<
$(RESOUT):
mkdir -p build/resources
$(SHAREDIR)/applications: resources/rs.ac.bg.matf.linijice.desktop
mkdir -p $@
cp $< $@
$(SHAREDIR)/icons/hicolor/scalable/apps: resources/icons/rs.ac.bg.matf.linijice.svg
mkdir -p $@
cp $< $@
install: $(BINOUT)/$(APPNAME) $(SHAREDIR)/icons/hicolor/scalable/apps $(SHAREDIR)/applications
install -m755 $< "$(BINDIR)"
cp -r "$(RESOUT)" "$(RESDIR)"
update-desktop-database
uninstall:
rm "$(BINDIR)/$(APPNAME)"
rm -r "$(RESDIR)"
rm $(SHAREDIR)/applications/rs.ac.bg.matf.linijice.desktop
rm $(SHAREDIR)/icons/hicolor/scalable/apps/rs.ac.bg.matf.linijice.svg
update-desktop-database
run: $(BINOUT)/$(APPNAME)
./$<
flatpak:
flatpak-builder --user --install --force-clean .flatpak-build rs.ac.bg.matf.linijice.json
flatpak-run: flatpak
flatpak run rs.ac.bg.matf.linijice
clean:
rm -rf build .flatpak .flatpak-build .flatpak-builder