From 03648bf821f9e29659ecb115a4c2fbe4eb5c219c Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Wed, 5 Sep 2018 19:58:54 +0000 Subject: [PATCH] Add Makefile Signed-off-by: Ralf Ramsauer --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3f0175d --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +DESTDIR ?= / +PREFIX ?= /usr +SYSCONFDIR ?= /etc + +all: + sed -i -r -e "s@(^SYSCONFDIR = ').*('$$)@\1$(SYSCONFDIR)\2@" doorlockd + sed -i -r -e "s@(^PREFIX = ').*('$$)@\1$(PREFIX)\2@" doorlockd + +install: + mkdir -p $(DESTDIR)/$(PREFIX)/bin/ + mkdir -p $(DESTDIR)/$(PREFIX)/share/ + mkdir -p $(DESTDIR)/$(SYSCONFDIR)/systemd/system + mkdir -p $(DESTDIR)/$(SYSCONFDIR) + + install doorlockd $(DESTDIR)/$(PREFIX)/bin/ + install -m 0644 doorlockd.cfg $(DESTDIR)/$(SYSCONFDIR) + install -m 0644 doorlockd.service $(DESTDIR)/$(SYSCONFDIR)/systemd/system + + cp -av share/* $(DESTDIR)/$(PREFIX)/share