Files
outlay/Makefile

59 lines
2.1 KiB
Makefile

PREFIX ?= /usr/local
DESTDIR ?=
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
ICON_DATA = outlay-gtk/data/icons
DESKTOP_FILE = outlay-gtk/data/com.outlay.app.desktop
METAINFO_FILE = outlay-gtk/data/com.outlay.app.metainfo.xml
SCHEMA_FILE = outlay-gtk/data/com.outlay.app.gschema.xml
.PHONY: build install uninstall
build:
cargo build --release -p outlay-gtk
install: build
install -Dm755 target/release/outlay-gtk $(DESTDIR)$(BINDIR)/outlay-gtk
# Desktop file
install -Dm644 $(DESKTOP_FILE) $(DESTDIR)$(DATADIR)/applications/com.outlay.app.desktop
# AppStream metainfo
install -Dm644 $(METAINFO_FILE) $(DESTDIR)$(DATADIR)/metainfo/com.outlay.app.metainfo.xml
# GSettings schema
install -Dm644 $(SCHEMA_FILE) $(DESTDIR)$(DATADIR)/glib-2.0/schemas/com.outlay.app.gschema.xml
# App icons (raster sizes)
for size_dir in $(ICON_DATA)/hicolor/*/apps; do \
size=$$(basename "$$(dirname "$$size_dir")"); \
for icon in "$$size_dir"/com.outlay.app.*; do \
[ -f "$$icon" ] || continue; \
install -Dm644 "$$icon" $(DESTDIR)$(DATADIR)/icons/hicolor/$$size/apps/$$(basename "$$icon"); \
done; \
done
# Scalable action icons (outlay custom + tabler)
for svg in $(ICON_DATA)/hicolor/scalable/actions/outlay-*.svg \
$(ICON_DATA)/hicolor/scalable/actions/tabler-*.svg; do \
[ -f "$$svg" ] || continue; \
install -Dm644 "$$svg" $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/actions/$$(basename "$$svg"); \
done
# Bundled fonts
for ttf in outlay-gtk/data/fonts/*.ttf; do \
[ -f "$$ttf" ] || continue; \
install -Dm644 "$$ttf" $(DESTDIR)$(DATADIR)/fonts/outlay/$$(basename "$$ttf"); \
done
uninstall:
rm -f $(DESTDIR)$(BINDIR)/outlay-gtk
rm -f $(DESTDIR)$(DATADIR)/applications/com.outlay.app.desktop
rm -f $(DESTDIR)$(DATADIR)/metainfo/com.outlay.app.metainfo.xml
rm -f $(DESTDIR)$(DATADIR)/glib-2.0/schemas/com.outlay.app.gschema.xml
rm -rf $(DESTDIR)$(DATADIR)/icons/hicolor/*/apps/com.outlay.app.*
rm -rf $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/actions/outlay-*.svg
rm -rf $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/actions/tabler-*.svg
rm -rf $(DESTDIR)$(DATADIR)/fonts/outlay