Blob


1 #
2 # ngIRCd -- The Next Generation IRC Daemon
3 # Copyright (c)2001-2003 by 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 # $Id: Makefile.am,v 1.43 2004/05/09 18:23:35 alex Exp $
12 #
14 AUTOMAKE_OPTIONS = ../portab/ansi2knr
16 INCLUDES = -I$(srcdir)/../portab -I$(srcdir)/../tool
18 LINTARGS = -weak -warnunixlib +unixlib -booltype BOOLEAN \
19 -varuse -retvalother -emptyret
21 sbin_PROGRAMS = ngircd
23 ngircd_SOURCES = ngircd.c channel.c client.c conf.c conn.c conn-zip.c conn-func.c \
24 hash.c irc.c irc-channel.c irc-info.c irc-login.c irc-mode.c irc-op.c \
25 irc-oper.c irc-server.c irc-write.c lists.c log.c match.c parse.c \
26 rendezvous.c resolve.c
28 ngircd_LDFLAGS = -L../portab -L../tool
30 ngircd_LDADD = -lngportab -lngtool
32 noinst_HEADERS = ngircd.h channel.h client.h conf.h conn.h conn-zip.h conn-func.h \
33 hash.h 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 parse.h \
35 rendezvous.h resolve.h \
36 messages.h defines.h
38 clean-local:
39 rm -f check-version check-help lint.out cvs-version.*
41 maintainer-clean-local:
42 rm -f Makefile Makefile.in
44 check-version: Makefile
45 echo "#!/bin/sh" > check-version
46 echo "./ngircd --version | grep ngircd > /dev/null 2>&1" >> check-version
47 chmod 755 check-version
49 check-help: Makefile
50 echo "#!/bin/sh" > check-help
51 echo "./ngircd --help | grep help > /dev/null 2>&1" >> check-help
52 chmod 755 check-help
54 lint:
55 @echo; warnings=0; files=0; \
56 for f in *.c; do \
57 echo "checking $$f ..."; \
58 splint $$f $(LINTARGS) -I$(srcdir) -I$(srcdir)/.. \
59 $(INCLUDES) $(AM_CFLAGS) >lint.out 2>&1; \
60 grep "no warnings" lint.out > /dev/null 2>&1; \
61 if [ $$? -ne 0 ]; then \
62 waswarning=1; \
63 echo; cat lint.out; echo; \
64 w=$$( grep "code warning" lint.out | awk "{ print \$$4 }" ); \
65 warnings=`expr $$warnings + $$w`; \
66 files=`expr $$files + 1`; \
67 else \
68 waswarning=0; \
69 fi; \
70 rm -f lint.out; \
71 done; \
72 [ $$waswarning -eq 0 ] && echo; \
73 [ $$warnings -gt 0 ] \
74 && echo "Result: $$warnings warning(s) in $$files file(s)!" \
75 || echo "Result: no warnings found."; \
76 echo; [ $$warnings -gt 0 ] && exit 1
78 ngircd.c: cvs-version.h
80 irc-login.c: cvs-version.h
82 irc-info.c: cvs-version.h
84 cvs-version.h: cvs-date
86 cvs-date:
87 grep VERSION ../config.h | grep "CVS" \
88 && echo "#define CVSDATE \"$$( grep "\$$Id" $(srcdir)/*.c \
89 | $(AWK) "{ print \$$9 }" | sort | tail -1 \
90 | sed -e "s/\//-/g" )\"" > cvs-version.new \
91 || echo "" > cvs-version.new
92 diff cvs-version.h cvs-version.new 2>/dev/null \
93 || cp cvs-version.new cvs-version.h
95 TESTS = check-version check-help
97 # -eof-