2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2012 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
55 ngircd_LDFLAGS = -L../portab -L../tool -L../ipaddr
57 ngircd_LDADD = -lngportab -lngtool -lngipaddr
97 rm -f check-version check-help lint.out
99 maintainer-clean-local:
100 rm -f Makefile Makefile.in
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
108 echo "#!/bin/sh" > check-help
109 echo "./ngircd --help | grep help >/dev/null 2>&1" >>check-help
113 @splint --version >/dev/null 2>&1 \
114 || ( echo; echo "Error: \"splint\" not found!"; echo; exit 1 )
115 @echo; warnings=0; files=0; \
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 \
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`; \
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
138 TESTS = check-version check-help