1 # Makefile for the irker relaying daemon
3 VERS := $(shell sed -n 's/version = "\(.\+\)"/\1/p' irkerd)
4 SYSTEMDSYSTEMUNITDIR := $(shell pkg-config --variable=systemdsystemunitdir systemd)
6 # `prefix`, `mandir` & `DESTDIR` can and should be set on the command
7 # line to control installation locations
10 target = $(DESTDIR)$(prefix)
12 docs: irkerd.html irkerd.8 irkerhook.html irkerhook.1
16 irkerd.html: irkerd.xml
17 xmlto html-nochunks irkerd.xml
19 irkerhook.1: irkerhook.xml
20 xmlto man irkerhook.xml
21 irkerhook.html: irkerhook.xml
22 xmlto html-nochunks irkerhook.xml
24 install.html: install.txt
25 asciidoc -o install.html install.txt
26 security.html: security.txt
27 asciidoc -o security.html security.txt
28 hacking.html: hacking.txt
29 asciidoc -o hacking.html hacking.txt
31 install: irkerd.8 irkerhook.1 uninstall
32 install -m 755 -o 0 -g 0 -d "$(target)/bin"
33 install -m 755 -o 0 -g 0 irkerd "$(target)/bin/irkerd"
34 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
35 install -m 755 -o 0 -g 0 -d "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
36 install -m 644 -o 0 -g 0 irkerd.service "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
38 install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man8"
39 install -m 755 -o 0 -g 0 irkerd.8 "$(target)$(mandir)/man8/irkerd.8"
40 install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man1"
41 install -m 755 -o 0 -g 0 irkerhook.1 "$(target)$(mandir)/man1/irkerhook.1"
44 rm -f "$(target)/bin/irkerd"
45 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
46 rm -f "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/irkerd.service"
48 rm -f "$(target)$(mandir)/man8/irkerd.8"
49 rm -f "$(target)$(mandir)/man1/irkerhook.1"
52 rm -f irkerd.8 irkerhook.1 irker-*.tar.gz *~ *.html
54 PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,R0201,R0902,R0903,R0912,R0913,R0914,R0915,E1101,W0201,W0212,W0621,W0702,F0401"
56 @pylint --output-format=parseable $(PYLINTOPTS) irkerd
57 @pylint --output-format=parseable $(PYLINTOPTS) irkerhook.py
60 @echo "LOC:"; wc -l irkerd irkerhook.py
61 @echo -n "LLOC: "; grep -vE '(^ *#|^ *$$)' irkerd irkerhook.py | wc -l
83 org.catb.irkerd.plist \
90 irker-$(VERS).tar.gz: $(SOURCES) irkerd.8 irkerhook.1
92 cp -pR $(SOURCES) $(EXTRA_DIST) irker-$(VERS)/
93 @COPYFILE_DISABLE=1 tar -cvzf irker-$(VERS).tar.gz irker-$(VERS)
96 dist: irker-$(VERS).tar.gz
98 release: irker-$(VERS).tar.gz irkerd.html irkerhook.html install.html security.html hacking.html
99 shipper version=$(VERS) | sh -e -x