2023-10-30 12:59:01 +03:00
|
|
|
# SPDX-Licence-Identifier: MIT
|
|
|
|
# Copyright The Asahi Linux Contributors
|
|
|
|
|
|
|
|
BINDIR ?= /usr/bin
|
|
|
|
UNITDIR ?= /lib/systemd/system
|
|
|
|
UDEVDIR ?= /lib/udev/rules.d
|
2023-12-09 11:51:58 +03:00
|
|
|
TMPFILESDIR ?= /usr/lib/tmpfiles.d
|
2023-10-30 12:59:01 +03:00
|
|
|
SHAREDIR ?= /usr/share/
|
|
|
|
VARDIR ?= /var/
|
|
|
|
|
|
|
|
all:
|
|
|
|
cargo build --release
|
|
|
|
|
2023-11-14 17:08:20 +03:00
|
|
|
install: install-data
|
2023-10-30 12:59:01 +03:00
|
|
|
install -dDm0755 $(DESTDIR)/$(BINDIR)
|
|
|
|
install -pm0755 target/release/speakersafetyd $(DESTDIR)/$(BINDIR)/speakersafetyd
|
2023-11-14 17:08:20 +03:00
|
|
|
|
|
|
|
install-data:
|
2023-10-30 12:59:01 +03:00
|
|
|
install -dDm0755 $(DESTDIR)/$(UNITDIR)
|
|
|
|
install -pm0644 speakersafetyd.service $(DESTDIR)/$(UNITDIR)/speakersafetyd.service
|
|
|
|
install -dDm0755 $(DESTDIR)/$(UDEVDIR)
|
|
|
|
install -pm0644 95-speakersafetyd.rules $(DESTDIR)/$(UDEVDIR)/95-speakersafetyd.rules
|
|
|
|
install -dDm0755 $(DESTDIR)/$(SHAREDIR)/speakersafetyd/apple
|
|
|
|
install -pm0644 -t $(DESTDIR)/$(SHAREDIR)/speakersafetyd/apple $(wildcard conf/apple/*)
|
2023-12-09 11:41:07 +03:00
|
|
|
install -dDm0755 $(DESTDIR)/$(VARDIR)/lib/speakersafetyd/blackbox
|
2023-12-09 11:51:58 +03:00
|
|
|
install -dDm0755 $(DESTDIR)/$(TMPFILESDIR)
|
|
|
|
install -pm0644 speakersafetyd.tmpfiles $(DESTDIR)/$(TMPFILESDIR)/speakersafetyd.conf
|
2023-10-30 12:59:01 +03:00
|
|
|
|
|
|
|
uninstall:
|
2023-12-09 11:51:58 +03:00
|
|
|
rm -f $(DESTDIR)/$(BINDIR)/speakersafetyd $(DESTDIR)/$(UNITDIR)/speakersafetyd.service $(DESTDIR)/$(UDEVDIR)/95-speakersafetyd.rules $(DESTDIR)/$(TMPFILESDIR)/speakersafetyd.conf
|
2023-10-30 12:59:01 +03:00
|
|
|
rm -rf $(DESTDIR)/$(SHAREDIR)/speakersafetyd
|
2023-11-14 17:08:20 +03:00
|
|
|
|
|
|
|
.PHONY: all install install-data uninstall
|