]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/Makefile.am
3a411a964b266a2ab9874342ee618018c953ba86
[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         client-cap.c \
28         conf.c \
29         conn.c \
30         conn-func.c \
31         conn-ssl.c \
32         conn-zip.c \
33         hash.c \
34         io.c \
35         irc.c \
36         irc-cap.c \
37         irc-channel.c \
38         irc-info.c \
39         irc-login.c \
40         irc-mode.c \
41         irc-op.c \
42         irc-oper.c \
43         irc-server.c \
44         irc-write.c \
45         lists.c \
46         log.c \
47         login.c \
48         match.c \
49         numeric.c \
50         op.c \
51         pam.c \
52         parse.c \
53         proc.c \
54         resolve.c \
55         sighandlers.c
56
57 ngircd_LDFLAGS = -L../portab -L../tool -L../ipaddr
58
59 ngircd_LDADD = -lngportab -lngtool -lngipaddr
60
61 noinst_HEADERS = \
62         ngircd.h \
63         array.h \
64         channel.h \
65         class.h \
66         client.h \
67         client-cap.h \
68         conf.h \
69         conf-ssl.h \
70         conn.h \
71         conn-func.h \
72         conn-ssl.h \
73         conn-zip.h \
74         defines.h \
75         hash.h \
76         io.h \
77         irc.h \
78         irc-cap.h \
79         irc-channel.h \
80         irc-info.h \
81         irc-login.h \
82         irc-mode.h \
83         irc-op.h \
84         irc-oper.h \
85         irc-server.h \
86         irc-write.h \
87         lists.h \
88         log.h \
89         login.h \
90         match.h \
91         messages.h \
92         numeric.h \
93         op.h \
94         pam.h \
95         parse.h \
96         proc.h \
97         resolve.h \
98         sighandlers.h
99
100 clean-local:
101         rm -f check-version check-help lint.out
102
103 maintainer-clean-local:
104         rm -f Makefile Makefile.in
105
106 check-version: Makefile
107         echo "#!/bin/sh" > check-version
108         echo "./ngircd --version | grep ngircd >/dev/null 2>&1" >>check-version
109         chmod 755 check-version
110
111 check-help: Makefile
112         echo "#!/bin/sh" > check-help
113         echo "./ngircd --help | grep help >/dev/null 2>&1" >>check-help
114         chmod 755 check-help
115
116 lint:
117         @splint --version >/dev/null 2>&1 \
118          || ( echo; echo "Error: \"splint\" not found!"; echo; exit 1 )
119         @echo; warnings=0; files=0; \
120         for f in *.c; do \
121          echo "checking $$f ..."; \
122          splint $$f $(LINTARGS) -I$(srcdir) -I$(srcdir)/.. \
123           $(INCLUDES) $(AM_CFLAGS) >lint.out 2>&1; \
124          grep "no warnings" lint.out > /dev/null 2>&1; \
125          if [ $$? -ne 0 ]; then \
126           waswarning=1; \
127           echo; grep -v "^Command Line: " lint.out; echo; \
128           w=$$( grep "code warning" lint.out | $(AWK) "{ print \$$4 }" ); \
129           [ "$$w" -gt 0 ] && warnings=`expr $$warnings + $$w`; \
130           files=`expr $$files + 1`; \
131          else \
132           waswarning=0; \
133          fi; \
134          rm -f lint.out; \
135         done; \
136         [ $$waswarning -eq 0 ] && echo; \
137         [ $$warnings -gt 0 ] \
138          && echo "Result: $$warnings warning(s) in $$files file(s)!" \
139          || echo "Result: no warnings found."; \
140         echo; [ $$warnings -gt 0 ] && exit 1
141
142 TESTS = check-version check-help
143
144 # -eof-