]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/Makefile.am
e96d14bee835d7a73246bc1a709b13eb5f4792e8
[ngircd-alex.git] / src / ngircd / Makefile.am
1 #
2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2012 Alexander Barton (alex@barton.de)
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 # Please read the file COPYING, README and AUTHORS for more information.
10 #
11
12 AUTOMAKE_OPTIONS = ../portab/ansi2knr
13
14 INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool -I$(srcdir)/../ipaddr
15
16 LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN \
17  -varuse -retvalother -emptyret -unrecog
18
19 sbin_PROGRAMS = ngircd
20
21 ngircd_SOURCES = \
22         ngircd.c \
23         array.c \
24         channel.c \
25         class.c \
26         client.c \
27         conf.c \
28         conn.c \
29         conn-func.c \
30         conn-ssl.c \
31         conn-zip.c \
32         hash.c \
33         io.c \
34         irc.c \
35         irc-channel.c \
36         irc-info.c \
37         irc-login.c \
38         irc-mode.c \
39         irc-op.c \
40         irc-oper.c \
41         irc-server.c \
42         irc-write.c \
43         lists.c \
44         log.c \
45         login.c \
46         match.c \
47         numeric.c \
48         op.c \
49         pam.c \
50         parse.c \
51         proc.c \
52         resolve.c \
53         sighandlers.c
54
55 ngircd_LDFLAGS = -L../portab -L../tool -L../ipaddr
56
57 ngircd_LDADD = -lngportab -lngtool -lngipaddr
58
59 noinst_HEADERS = \
60         ngircd.h \
61         array.h \
62         channel.h \
63         class.h \
64         client.h \
65         conf.h \
66         conf-ssl.h \
67         conn.h \
68         conn-func.h \
69         conn-ssl.h \
70         conn-zip.h \
71         defines.h \
72         hash.h \
73         io.h \
74         irc.h \
75         irc-channel.h \
76         irc-info.h \
77         irc-login.h \
78         irc-mode.h \
79         irc-op.h \
80         irc-oper.h \
81         irc-server.h \
82         irc-write.h \
83         lists.h \
84         log.h \
85         login.h \
86         match.h \
87         messages.h \
88         numeric.h \
89         op.h \
90         pam.h \
91         parse.h \
92         proc.h \
93         resolve.h \
94         sighandlers.h
95
96 clean-local:
97         rm -f check-version check-help lint.out
98
99 maintainer-clean-local:
100         rm -f Makefile Makefile.in
101
102 check-version: Makefile
103         echo "#!/bin/sh" > check-version
104         echo "./ngircd --version | grep ngircd >/dev/null 2>&1" >>check-version
105         chmod 755 check-version
106
107 check-help: Makefile
108         echo "#!/bin/sh" > check-help
109         echo "./ngircd --help | grep help >/dev/null 2>&1" >>check-help
110         chmod 755 check-help
111
112 lint:
113         @splint --version >/dev/null 2>&1 \
114          || ( echo; echo "Error: \"splint\" not found!"; echo; exit 1 )
115         @echo; warnings=0; files=0; \
116         for f in *.c; do \
117          echo "checking $$f ..."; \
118          splint $$f $(LINTARGS) -I$(srcdir) -I$(srcdir)/.. \
119           $(INCLUDES) $(AM_CFLAGS) >lint.out 2>&1; \
120          grep "no warnings" lint.out > /dev/null 2>&1; \
121          if [ $$? -ne 0 ]; then \
122           waswarning=1; \
123           echo; grep -v "^Command Line: " lint.out; echo; \
124           w=$$( grep "code warning" lint.out | $(AWK) "{ print \$$4 }" ); \
125           [ "$$w" -gt 0 ] && warnings=`expr $$warnings + $$w`; \
126           files=`expr $$files + 1`; \
127          else \
128           waswarning=0; \
129          fi; \
130          rm -f lint.out; \
131         done; \
132         [ $$waswarning -eq 0 ] && echo; \
133         [ $$warnings -gt 0 ] \
134          && echo "Result: $$warnings warning(s) in $$files file(s)!" \
135          || echo "Result: no warnings found."; \
136         echo; [ $$warnings -gt 0 ] && exit 1
137
138 TESTS = check-version check-help
139
140 # -eof-