2018-09-05 21:58:54 +02:00
|
|
|
DESTDIR ?= /
|
|
|
|
PREFIX ?= /usr
|
|
|
|
SYSCONFDIR ?= /etc
|
|
|
|
|
2019-06-14 20:50:37 +02:00
|
|
|
all: gpio-wait pydoorlock/Protocol.py
|
2019-06-14 21:29:27 +02:00
|
|
|
|
|
|
|
package:
|
2018-09-05 21:58:54 +02:00
|
|
|
sed -i -r -e "s@(^SYSCONFDIR = ').*('$$)@\1$(SYSCONFDIR)\2@" doorlockd
|
|
|
|
sed -i -r -e "s@(^PREFIX = ').*('$$)@\1$(PREFIX)\2@" doorlockd
|
2018-10-16 21:23:52 +02:00
|
|
|
sed -i -r -e "s@(^__version__ = ').*('$$)@\1$(shell cat VERSION)\2@" doorlockd
|
2018-09-05 21:58:54 +02:00
|
|
|
|
2019-06-14 20:50:37 +02:00
|
|
|
pydoorlock/Protocol.py: avr-code/protocol.h
|
|
|
|
./scripts/gen_protocol.sh $^ > $@
|
|
|
|
|
2018-10-07 01:37:31 +02:00
|
|
|
gpio-wait: gpio-wait.c
|
|
|
|
|
2018-09-05 21:58:54 +02:00
|
|
|
install:
|
|
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/bin/
|
|
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/share/
|
|
|
|
mkdir -p $(DESTDIR)/$(SYSCONFDIR)/systemd/system
|
|
|
|
mkdir -p $(DESTDIR)/$(SYSCONFDIR)
|
|
|
|
|
2018-10-07 01:37:31 +02:00
|
|
|
install doorlockd gpio-wait doorstate $(DESTDIR)/$(PREFIX)/bin/
|
2018-09-18 01:27:15 +02:00
|
|
|
install doorlockd-passwd $(DESTDIR)/$(PREFIX)/bin/
|
2019-06-14 22:02:59 +02:00
|
|
|
install -m 0644 doorlockd.cfg $(DESTDIR)/$(SYSCONFDIR)
|
2018-10-07 01:37:31 +02:00
|
|
|
install -m 0644 doorlockd.service doorstate.service $(DESTDIR)/$(SYSCONFDIR)/systemd/system
|
2018-09-05 21:58:54 +02:00
|
|
|
|
2018-10-16 21:34:45 +02:00
|
|
|
pip install --upgrade --force-reinstall --root=$(DESTDIR) .
|
|
|
|
|
2018-09-05 21:58:54 +02:00
|
|
|
cp -av share/* $(DESTDIR)/$(PREFIX)/share
|
2019-06-14 21:34:45 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f gpio-wait
|
|
|
|
rm -rf pydoorlock/__pycache__
|
2019-06-14 20:50:37 +02:00
|
|
|
rm -f pydoorlock/Protocol.py
|