summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..9984122
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+DESTDIR=
+PREFIX=/usr/local
+LIBEXECDIR=$(PREFIX)/libexec
+LIBDIR=$(PREFIX)/lib
+SYSDDIR=$(LIBDIR)/systemd/system
+DATADIR=$(PREFIX)/share
+MANDIR=$(DATADIR)/man
+MAN8DIR=$(MANDIR)/man8
+
+
+%: %.in
+ sed "s|@LIBEXECDIR@|$(LIBEXECDIR)|g" $< >$@
+ sed -i "s|@SYSDDIR@|$(SYSDDIR)|g" $@
+
+
+all: shutdown-if-no-sessions.service ready-for-shutdown.target.8
+
+
+install: all
+ install -m644 -Dt $(DESTDIR)$(SYSDDIR) ready-for-shutdown.target
+ install -m644 -Dt $(DESTDIR)$(MAN8DIR) ready-for-shutdown.target.8
+ install -m644 -Dt $(DESTDIR)$(SYSDDIR) shutdown-if-no-sessions.service
+ install -m644 -Dt $(DESTDIR)$(MAN8DIR) shutdown-if-no-sessions.service.8
+ install -m755 -Dt $(DESTDIR)$(LIBEXECDIR) shutdown-if-no-sessions
+
+
+uninstall:
+ rm -f $(DESTDIR)$(SYSDDIR)/ready-for-shutdown.target
+ rm -f $(DESTDIR)$(MAN8DIR)/ready-for-shutdown.target.8
+ rm -f $(DESTDIR)$(SYSDDIR)/shutdown-if-no-sessions.service
+ rm -f $(DESTDIR)$(MAN8DIR)/shutdown-if-no-sessions.service.8
+ rm -f $(DESTDIR)$(BINDIR)/shutdown-if-no-sessions
+
+
+clean:
+ rm -f *.service *.target.8
+
+
+.PHONY: all install uninstall clean