From a769d555e533fbbf4a8793c97a6ba56521d28225 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Mon, 30 Oct 2023 18:59:01 +0900 Subject: [PATCH] Add Makefile Signed-off-by: Hector Martin --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cfd3522 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +# SPDX-Licence-Identifier: MIT +# Copyright The Asahi Linux Contributors + +BINDIR ?= /usr/bin +UNITDIR ?= /lib/systemd/system +UDEVDIR ?= /lib/udev/rules.d +SHAREDIR ?= /usr/share/ +VARDIR ?= /var/ + +all: + cargo build --release + +install: + install -dDm0755 $(DESTDIR)/$(BINDIR) + install -pm0755 target/release/speakersafetyd $(DESTDIR)/$(BINDIR)/speakersafetyd + 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/*) + install -dDm0755 $(DESTDIR)/$(VARDIR)/speakersafetyd/blackbox + +uninstall: + rm -f $(DESTDIR)/$(BINDIR)/speakersafetyd $(DESTDIR)/$(UNITDIR)/speakersafetyd.service $(DESTDIR)/$(UDEVDIR)/95-speakersafetyd.rules + rm -rf $(DESTDIR)/$(SHAREDIR)/speakersafetyd