| 1 |
# inputlircd -- zeroconf LIRC daemon that reads from /dev/input/event devices |
| 2 |
# Copyright (C) 2006-2019 Guus Sliepen <[email protected]> |
| 3 |
# |
| 4 |
# This program is free software; you can redistribute it and/or modify it |
| 5 |
# under the terms of version 2 of the GNU General Public License as published |
| 6 |
# by the Free Software Foundation. |
| 7 |
# |
| 8 |
# This program is distributed in the hope that it will be useful, |
| 9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
# GNU General Public License for more details. |
| 12 |
# |
| 13 |
# You should have received a copy of the GNU General Public License |
| 14 |
# along with this program; if not, write to the Free Software |
| 15 |
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 16 |
|
| 17 |
SBIN = inputlircd |
| 18 |
MAN8 = inputlircd.8 |
| 19 |
SERVICE = inputlirc.service |
| 20 |
|
| 21 |
CC ?= gcc |
| 22 |
CFLAGS ?= -Wall -g -O2 -pipe |
| 23 |
PREFIX ?= /usr/local |
| 24 |
INSTALL ?= install |
| 25 |
SBINDIR ?= $(PREFIX)/sbin |
| 26 |
SHAREDIR ?= $(PREFIX)/share |
| 27 |
MANDIR ?= $(SHAREDIR)/man |
| 28 |
SYSTEMDDIR ?= $(PREFIX)/lib/systemd/system |
| 29 |
|
| 30 |
all: $(SBIN) |
| 31 |
|
| 32 |
names.h: /usr/include/linux/input-event-codes.h gennames |
| 33 |
./gennames $< > $@ |
| 34 |
|
| 35 |
inputlircd: inputlircd.c /usr/include/linux/input.h names.h |
| 36 |
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< |
| 37 |
|
| 38 |
install: install-sbin install-man install-service |
| 39 |
|
| 40 |
install-sbin: $(SBIN) |
| 41 |
mkdir -p $(DESTDIR)$(SBINDIR) |
| 42 |
$(INSTALL) $(SBIN) $(DESTDIR)$(SBINDIR)/ |
| 43 |
|
| 44 |
install-man: $(MAN1) $(MAN5) $(MAN8) |
| 45 |
mkdir -p $(DESTDIR)$(MANDIR)/man8/ |
| 46 |
$(INSTALL) -m 644 $(MAN8) $(DESTDIR)$(MANDIR)/man8/ |
| 47 |
|
| 48 |
install-service: $(SERVICE) |
| 49 |
mkdir -p $(DESTDIR)$(SYSTEMDDIR) |
| 50 |
$(INSTALL) -m 644 $(SERVICE) $(DESTDIR)$(SYSTEMDDIR)/ |
| 51 |
|
| 52 |
clean: |
| 53 |
rm -f $(SBIN) names.h |
| 54 |
|
| 55 |
.PHONY: all install install-sbin install-man install-service clean |