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 irk.html irk.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
27 xmlto html-nochunks irkerhook.xml
29 install.html: install.txt
30 asciidoc -o install.html install.txt
31 security.html: security.txt
32 asciidoc -o security.html security.txt
33 hacking.html: hacking.txt
34 asciidoc -o hacking.html hacking.txt
36 install: irk.1 irkerd.8 irkerhook.1 uninstall
37 install -m 755 -o 0 -g 0 -d "$(target)/bin"
38 install -m 755 -o 0 -g 0 irkerd "$(target)/bin/irkerd"
39 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
40 install -m 755 -o 0 -g 0 -d "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
41 install -m 644 -o 0 -g 0 irkerd.service "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)"
43 install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man8"
44 install -m 755 -o 0 -g 0 irkerd.8 "$(target)$(mandir)/man8/irkerd.8"
45 install -m 755 -o 0 -g 0 -d "$(target)$(mandir)/man1"
46 install -m 755 -o 0 -g 0 irkerhook.1 "$(target)$(mandir)/man1/irkerhook.1"
47 install -m 755 -o 0 -g 0 irk.1 "$(target)$(mandir)/man1/irk.1"
50 rm -f "$(target)/bin/irkerd"
51 ifneq ($(strip $(SYSTEMDSYSTEMUNITDIR)),)
52 rm -f "$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/irkerd.service"
54 rm -f "$(target)$(mandir)/man8/irkerd.8"
55 rm -f "$(target)$(mandir)/man1/irkerhook.1"
56 rm -f "$(target)$(mandir)/man1/irk.1"
59 rm -f irkerd.8 irkerhook.1 irk.1 irker-*.tar.gz *~ *.html
61 PYLINTOPTS = --rcfile=/dev/null --reports=n --dummy-variables-rgx='^_' --msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --disable="C0103,C0111,C0301,C0302,C1001,R0201,R0902,R0903,R0912,R0913,R0914,R0915,E1101,W0142,W0201,W0212,W0621,W0702,W0703,W1201,F0401,E0611"
63 @pylint $(PYLINTOPTS) irkerd
64 @pylint $(PYLINTOPTS) irkerhook.py
67 @echo "LOC:"; wc -l irkerd irkerhook.py
68 @echo -n "LLOC: "; grep -vE '(^ *#|^ *$$)' irkerd irkerhook.py | wc -l
91 org.catb.irkerd.plist \
98 irker-$(VERS).tar.gz: $(SOURCES) irkerd.8 irkerhook.1 irk.1
100 cp -pR $(SOURCES) $(EXTRA_DIST) irker-$(VERS)/
101 @COPYFILE_DISABLE=1 tar -cvzf irker-$(VERS).tar.gz irker-$(VERS)
104 dist: irker-$(VERS).tar.gz
106 release: irker-$(VERS).tar.gz irkerd.html irk.html irkerhook.html install.html security.html hacking.html
107 shipper version=$(VERS) | sh -e -x