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