2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
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.
12 AUTOMAKE_OPTIONS = ../portab/ansi2knr
14 INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool -I$(srcdir)/../ipaddr
16 LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN \
17 -varuse -retvalother -emptyret -unrecog
19 sbin_PROGRAMS = ngircd
21 ngircd_SOURCES = ngircd.c array.c channel.c class.c client.c conf.c conn.c \
22 conn-func.c conn-ssl.c conn-zip.c hash.c io.c irc.c irc-channel.c \
23 irc-info.c irc-login.c irc-mode.c irc-op.c irc-oper.c irc-server.c \
24 irc-write.c lists.c log.c match.c op.c numeric.c pam.c parse.c \
25 proc.c resolve.c sighandlers.c
27 ngircd_LDFLAGS = -L../portab -L../tool -L../ipaddr
29 ngircd_LDADD = -lngportab -lngtool -lngipaddr
31 noinst_HEADERS = ngircd.h array.h channel.h class.h client.h conf.h \
32 conf-ssl.h conn.h conn-func.h conn-ssl.h conn-zip.h hash.h io.h \
33 irc.h irc-channel.h irc-info.h irc-login.h irc-mode.h irc-op.h \
34 irc-oper.h irc-server.h irc-write.h lists.h log.h match.h numeric.h \
35 op.h pam.h parse.h proc.h resolve.h sighandlers.h defines.h messages.h
38 rm -f check-version check-help lint.out
40 maintainer-clean-local:
41 rm -f Makefile Makefile.in
43 check-version: Makefile
44 echo "#!/bin/sh" > check-version
45 echo "./ngircd --version | grep ngircd >/dev/null 2>&1" >>check-version
46 chmod 755 check-version
49 echo "#!/bin/sh" > check-help
50 echo "./ngircd --help | grep help >/dev/null 2>&1" >>check-help
54 @splint --version >/dev/null 2>&1 \
55 || ( echo; echo "Error: \"splint\" not found!"; echo; exit 1 )
56 @echo; warnings=0; files=0; \
58 echo "checking $$f ..."; \
59 splint $$f $(LINTARGS) -I$(srcdir) -I$(srcdir)/.. \
60 $(INCLUDES) $(AM_CFLAGS) >lint.out 2>&1; \
61 grep "no warnings" lint.out > /dev/null 2>&1; \
62 if [ $$? -ne 0 ]; then \
64 echo; grep -v "^Command Line: " lint.out; echo; \
65 w=$$( grep "code warning" lint.out | $(AWK) "{ print \$$4 }" ); \
66 [ "$$w" -gt 0 ] && warnings=`expr $$warnings + $$w`; \
67 files=`expr $$files + 1`; \
73 [ $$waswarning -eq 0 ] && echo; \
74 [ $$warnings -gt 0 ] \
75 && echo "Result: $$warnings warning(s) in $$files file(s)!" \
76 || echo "Result: no warnings found."; \
77 echo; [ $$warnings -gt 0 ] && exit 1
79 TESTS = check-version check-help