Ignore comments with leading whitespace as well as those without.
[irker.git] / Makefile
1 # Makefile for the irker relaying tool
2
3 VERS=$(shell sed -n 's/version = "\(.\+\)"/\1/p' irkerd)
4
5 docs: irkerd.html irkerd.8 irkerhook.html irkerhook.1
6
7 irkerd.8: irkerd.xml
8         xmlto man irkerd.xml
9 irkerd.html: irkerd.xml
10         xmlto html-nochunks irkerd.xml
11
12 irkerhook.1: irkerhook.xml
13         xmlto man irkerhook.xml
14 irkerhook.html: irkerhook.xml
15         xmlto html-nochunks irkerhook.xml
16
17 security.html: security.txt
18         asciidoc -o security.html security.txt
19 hacking.html: hacking.txt
20         asciidoc -o hacking.html hacking.txt
21
22 install: irkerd.8 irkerhook.1 uninstall
23         install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/bin/
24         install -m 755 -o 0 -g 0 irkerd $(DESTDIR)/usr/bin/irkerd
25         install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/share/man/man8/
26         install -m 755 -o 0 -g 0 irkerd.8 $(DESTDIR)/usr/share/man/man8/irkerd.8
27         install -m 755 -o 0 -g 0 -d $(DESTDIR)/usr/share/man/man1/
28         install -m 755 -o 0 -g 0 irkerhook.1 $(DESTDIR)/usr/share/man/man1/irkerhook.1
29
30 uninstall:
31         rm -f $(DESTDIR)/usr/bin/irkerd
32         rm -f $(DESTDIR)/usr/share/man/man8/irkerd.8
33         rm -f $(DESTDIR)/usr/share/man/man1/irkerhook.1
34
35 clean:
36         rm -f irkerd.8 irkerhook.1 irker-*.tar.gz *~
37         rm -f SHIPPER.* *.html
38
39 PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,R0201,R0902,R0903,R0912,E1101,W0201,W0621,W0702,F0401"
40 pylint:
41         @pylint --output-format=parseable $(PYLINTOPTS) irkerd
42         @pylint --output-format=parseable $(PYLINTOPTS) irkerhook.py
43
44 loc:
45         grep -v '^ *#' irkerd irkerhook.py | wc -l
46
47 SOURCES = README COPYING NEWS BUGS install.txt security.txt hacking.txt \
48         irkerd irkerhook.py Makefile irkerd.xml irkerhook.xml
49 EXTRA_DIST = irker-logo.png org.catb.irkerd.plist
50
51 version:
52         @echo $(VERS)
53
54 irker-$(VERS).tar.gz: $(SOURCES) irkerd.8 irkerhook.1
55         tar --transform='s:^:irker-$(VERS)/:' --show-transformed-names -cvzf irker-$(VERS).tar.gz $(SOURCES) $(EXTRA_DIST)
56
57 dist: irker-$(VERS).tar.gz
58
59 release: irker-$(VERS).tar.gz irkerd.html irkerhook.html security.html hacking.html
60         shipper -u -m -t; make clean