1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 10:24:26 +01:00

Makefile: introduce more variables

Instead of repeating things.

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2019-06-15 18:00:17 +02:00
parent a774262a3c
commit 95b6550e49
3 changed files with 15 additions and 9 deletions

View File

@ -2,6 +2,12 @@ DESTDIR ?= /
PREFIX ?= /usr PREFIX ?= /usr
SYSCONFDIR ?= /etc SYSCONFDIR ?= /etc
USR = $(DESTDIR)/$(PREFIX)
BIN = $(USR)/bin/
ETC = $(DESTDIR)/etc/
SHARE = $(USR)/share/
SYSTEMD_UNITS = $(ETC)/systemd/system/
all: gpio-wait pydoorlock/Protocol.py all: gpio-wait pydoorlock/Protocol.py
package: package:
@ -15,19 +21,19 @@ pydoorlock/Protocol.py: avr-code/protocol.h
gpio-wait: gpio-wait.c gpio-wait: gpio-wait.c
install: install:
mkdir -p $(DESTDIR)/$(PREFIX)/bin/ mkdir -p $(BIN)
mkdir -p $(DESTDIR)/$(PREFIX)/share/ mkdir -p $(SHARE)
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/systemd/system mkdir -p $(SYSTEMD_UNITS)
mkdir -p $(DESTDIR)/$(SYSCONFDIR) mkdir -p $(ETC)
install doorlockd gpio-wait doorstate $(DESTDIR)/$(PREFIX)/bin/ install doorlockd gpio-wait doorstate $(BIN)
install doorlockd-passwd $(DESTDIR)/$(PREFIX)/bin/ install doorlockd-passwd $(BIN)
install -m 0644 doorlockd.cfg $(DESTDIR)/$(SYSCONFDIR) install -m 0644 doorlockd.cfg $(ETC)
install -m 0644 doorlockd.service doorstate.service $(DESTDIR)/$(SYSCONFDIR)/systemd/system install -m 0644 systemd/doorlockd.service systemd/doorstate.service $(SYSTEMD_UNITS)
pip install --upgrade --force-reinstall --root=$(DESTDIR) . pip install --upgrade --force-reinstall --root=$(DESTDIR) .
cp -av share/* $(DESTDIR)/$(PREFIX)/share cp -av share/* $(SHARE)
clean: clean:
rm -f gpio-wait rm -f gpio-wait