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