0375b8c1c3bde2af5769783af002c78278967283
[ircu2.10.12-pk.git] / ircd / Makefile.in
1 # ircd/Makefile for the Undernet IRC Daemon.
2 # Copyright (C) 1990 Jarkko Oikarinen
3 # Copyright (C) 1997 Carlo Wood
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, or (at your option)
8 # any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18 # 02111-1307, USA.
19
20 #### Start of system configuration section. ####
21
22 # Output variables of the 'configure' script:
23
24 prefix = @prefix@
25 exec_prefix = @exec_prefix@
26 top_srcdir = @top_srcdir@
27 srcdir = @srcdir@
28 VPATH = @srcdir@
29 DEFS = @DEFS@
30 INSTALL = @INSTALL@
31 SHELL = @SHPROG@
32 RM = @RMPROG@
33 AWK = @AWK@
34 LN_S = @LN_S@
35 MV = mv
36 CHMOD = chmod
37 CHOWN = chown
38 CHGRP = chgrp
39 MKDIR = mkdir
40 TOUCH = touch
41 GREP = grep
42 OSDEP_C = @OSDEP_C@
43 ENGINE_C = @ENGINE_C@
44 @SET_MAKE@
45
46 BINDIR = @bindir@
47 INSTALL_RULE = @INSTALL_RULE@
48 SYMLINK = @SYMLINK@
49 IRCDMODE = @IRCDMODE@
50 IRCDOWN = @IRCDOWN@
51 IRCDGRP = @IRCDGRP@
52 DPATH = @DPATH@
53 MPATH = ${DPATH}/ircd.motd
54 RPATH = ${DPATH}/remote.motd
55
56 CC = @CC@
57 CFLAGS = @CFLAGS@
58 CPPFLAGS = -I. -I.. -I${top_srcdir}/include @CPPFLAGS@
59 LDFLAGS = @LDFLAGS@
60 LIBS = @LIBS@
61
62 #### End of system configuration section. ####
63 PURIFY =
64
65 OSDEP_SRC = \
66         os_bsd.c \
67         os_linux.c \
68         os_openbsd.c \
69         os_generic.c \
70         os_solaris.c
71
72 ENGINE_SRC = \
73         engine_devpoll.c \
74         engine_poll.c \
75         engine_kqueue.c \
76         engine_select.c
77
78 IRCD_SRC = \
79         IPcheck.c \
80         channel.c \
81         class.c \
82         client.c \
83         crule.c \
84         dbuf.c \
85         fda.c \
86         fileio.c \
87         gline.c \
88         hash.c \
89         ircd.c \
90         ircd_alloc.c \
91         ircd_events.c \
92         ircd_features.c \
93         ircd_log.c \
94         ircd_relay.c \
95         ircd_reply.c \
96         ircd_signal.c \
97         ircd_snprintf.c \
98         ircd_string.c \
99         ircd_xopen.c \
100         jupe.c \
101         list.c \
102         listener.c \
103         m_admin.c \
104         m_away.c \
105         m_burst.c \
106         m_clearmode.c \
107         m_close.c \
108         m_connect.c \
109         m_cprivmsg.c \
110         m_create.c \
111         m_defaults.c \
112         m_destruct.c \
113         m_desynch.c \
114         m_die.c \
115         m_endburst.c \
116         m_error.c \
117         m_get.c \
118         m_gline.c \
119         m_help.c \
120         m_info.c \
121         m_invite.c \
122         m_ison.c \
123         m_join.c \
124         m_jupe.c \
125         m_kick.c \
126         m_kill.c \
127         m_links.c \
128         m_list.c \
129         m_lusers.c \
130         m_map.c \
131         m_mode.c \
132         m_motd.c \
133         m_names.c \
134         m_nick.c \
135         m_notice.c \
136         m_oper.c \
137         m_opmode.c \
138         m_part.c \
139         m_pass.c \
140         m_ping.c \
141         m_pong.c \
142         m_privmsg.c \
143         m_privs.c \
144         m_proto.c \
145         m_quit.c \
146         m_rehash.c \
147         m_reset.c \
148         m_restart.c \
149         m_rping.c \
150         m_rpong.c \
151         m_server.c \
152         m_set.c \
153         m_settime.c \
154         m_silence.c \
155         m_squit.c \
156         m_stats.c \
157         m_time.c \
158         m_topic.c \
159         m_trace.c \
160         m_uping.c \
161         m_user.c \
162         m_userhost.c \
163         m_userip.c \
164         m_version.c \
165         m_wallchops.c \
166         m_wallops.c \
167         m_wallusers.c \
168         m_who.c \
169         m_whois.c \
170         m_whowas.c \
171         match.c \
172         motd.c \
173         msgq.c \
174         numnicks.c \
175         opercmds.c \
176         packet.c \
177         parse.c \
178         querycmds.c \
179         random.c \
180         res.c \
181         s_auth.c \
182         s_bsd.c \
183         s_conf.c \
184         s_debug.c \
185         s_err.c \
186         s_misc.c \
187         s_numeric.c \
188         s_serv.c \
189         s_stats.c \
190         s_user.c \
191         send.c \
192         support.c \
193         uping.c \
194         userload.c \
195         whocmds.c \
196         whowas.c
197
198 SRC = ${IRCD_SRC} ${OSDEP_C} ${ENGINE_C}
199
200 OBJS = ${SRC:%.c=%.o}
201
202 DEP_SRC = ${IRCD_SRC} ${OSDEP_SRC} ${ENGINE_SRC}
203
204 all:
205         ( cd ..; make -f Makefile )
206
207 .SUFFIXES: .c .o
208
209 .c.o:
210         ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
211
212 build: ircd chkconf
213
214 ircd: ${OBJS} ../include/patchlevel.h version.o
215         ${PURIFY} ${CC} ${OBJS} version.o ${LDFLAGS} ${LIBS} -o ircd
216         ${CHMOD} ${IRCDMODE} ircd
217
218 #
219 # Make sure the anti hack checksums get included when things change
220 # bleah
221 #
222 # Yeah, "bleah" is right.  These checksums don't cover even a fraction of
223 # the "important" .c files...but are useful to determine whether someone
224 # actually is running the version they claim to be running or not.  There
225 # must be a better solution...perhaps sum all of the .c files and include
226 # only that one sum?
227 #
228 version.c: version.c.SH s_serv.c s_user.c channel.c s_bsd.c s_misc.c ircd.c
229         ${SHELL} ${srcdir}/version.c.SH
230
231 ircd_string.o: ircd_string.c chattr.tab.c
232
233 table_gen: table_gen.o
234         ${CC} -o $@ table_gen.o
235
236 chattr.tab.c: table_gen
237         ./table_gen > chattr.tab.c
238
239 chkcrule.o: crule.c
240         ${CC} ${CFLAGS} ${CPPFLAGS} -DCR_CHKCONF -o chkcrule.o -c \
241                 ${srcdir}/crule.c
242
243 chkconf: chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o ircd_string.o
244         ${CC} chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o \
245         ircd_string.o ${LDFLAGS} ${LIBS} -o chkconf
246
247 mkbindir:
248         @test -d ${BINDIR} || mkdir ${BINDIR}
249
250 install: ${INSTALL_RULE}
251
252 install-with-symlink: build mkbindir
253         @if [ ! -d ${DPATH} -a ! -f ${DPATH} ]; then \
254           echo "Creating directory ${DPATH}"; \
255           ${MKDIR} ${DPATH}; \
256           ${CHMOD} 700 ${DPATH}; \
257           ${CHOWN} ${IRCDOWN} ${DPATH}; \
258           ${CHGRP} ${IRCDGRP} ${DPATH}; \
259         fi
260         @echo `date +%Y%m%d%H%M` > /tmp/ircd.tag;
261         @echo "Installing new ircd as ${BINDIR}/ircd.`cat /tmp/ircd.tag` :"
262         ${INSTALL} -m ${IRCDMODE} -o ${IRCDOWN} -g ${IRCDGRP} ircd ${BINDIR}/ircd.`cat /tmp/ircd.tag`
263         @( cd ${BINDIR}; \
264           ${RM} -f ${SYMLINK}; \
265           ${LN_S} ircd.`cat /tmp/ircd.tag` ${SYMLINK}; )
266         @${RM} /tmp/ircd.tag
267         ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR}
268         ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/example.conf ${DPATH}
269 #       ( cd ${DPATH}; \
270 #         ${TOUCH} ${MPATH}; \
271 #         ${TOUCH} ${RPATH}; \
272 #         ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \
273 #         ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; )
274
275 install-no-symlink: build mkbindir
276         @if [ ! -d ${DPATH} -a ! -f ${DPATH} ]; then \
277           echo "Creating directory ${DPATH}"; \
278           ${MKDIR} ${DPATH}; \
279           ${CHMOD} 700 ${DPATH}; \
280           ${CHOWN} ${IRCDOWN} ${DPATH}; \
281           ${CHGRP} ${IRCDGRP} ${DPATH}; \
282         fi
283         @echo "Installing new ircd as ${BINDIR}/ircd :"
284         ${INSTALL} -m ${IRCDMODE} -o ${IRCDOWN} -g ${IRCDGRP} ircd ${BINDIR}/ircd
285         ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR}
286         ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/example.conf ${DPATH}
287 #       ( cd ${DPATH}; \
288 #         ${TOUCH} ${MPATH}; \
289 #         ${TOUCH} ${RPATH}; \
290 #         ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \
291 #         ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; )
292
293 uninstall:
294         @if [ "${BINDIR}" != "${DPATH}" ]; then \
295                 echo "${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9* ${BINDIR}/chkconf"; \
296                 ${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9* ${BINDIR}/chkconf; \
297         fi
298         @echo "Please remove the contents of ${DPATH} manually"
299
300 clean:
301         ${RM} -f *.o *.bak ircd version.c chkconf ircd_osdep.c chattr.tab.c table_gen
302
303 distclean: clean
304         ${RM} -f Makefile stamp-m
305
306 maintainer-clean: distclean
307
308 # If I read this right, this will only work with gcc.  Still, how many admins
309 # are going to be doing "make depend"?
310 depend:
311         @cd ${srcdir}; \
312         if [ -f Makefile.in.bak ]; then \
313           echo "make depend: First remove ircd/Makefile.in.bak"; \
314         else \
315           ( ${MV} Makefile.in Makefile.in.bak; \
316             ${GREP} -A1 -B10000 '^# DO NOT DELETE THIS LINE' Makefile.in.bak > Makefile.in;\
317             ${CC} ${CFLAGS} -MM ${CPPFLAGS} ${DEP_SRC} >> Makefile.in; ) \
318         fi
319
320 # Coders: You need GNU make for this to work
321 # Makefile: ../config/config.status Makefile.in ../config/gen.ircd.Makefile \
322 #         ../config/config.h ../config/.config stamp-m
323 #       @echo "recreating ircd/Makefile"
324 #       @cd ../config; \
325 #         CONFIG_FILES=../ircd/Makefile CONFIG_HEADERS= \
326 #         ./config.status >/dev/null; \
327 #         RM=${RM} ${SHELL} ./gen.ircd.Makefile
328
329 # stamp-m:
330 #       echo timestamp > stamp-m
331
332 # ../config/config.status:
333 #       @cd ../config; ${MAKE} config.status
334
335 # ../config/config.h:
336 #       @cd ../config; ${MAKE} config.h
337
338 # DO NOT DELETE THIS LINE -- make depend depends on it.
339
340 IPcheck.o: IPcheck.c ../config.h ../include/IPcheck.h \
341  ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \
342  ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \
343  ../include/ircd.h ../include/struct.h ../include/msg.h \
344  ../include/numnicks.h ../include/ircd_alloc.h ../include/s_debug.h \
345  ../include/s_user.h ../include/send.h
346 channel.o: channel.c ../config.h ../include/channel.h \
347  ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \
348  ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \
349  ../include/hash.h ../include/ircd.h ../include/struct.h \
350  ../include/ircd_alloc.h ../include/ircd_chattr.h \
351  ../include/ircd_features.h ../include/ircd_log.h \
352  ../include/ircd_policy.h ../include/ircd_reply.h \
353  ../include/ircd_snprintf.h ../include/ircd_string.h ../include/list.h \
354  ../include/match.h ../include/msg.h ../include/numeric.h \
355  ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \
356  ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \
357  ../include/s_user.h ../include/send.h ../include/support.h \
358  ../include/sys.h ../include/whowas.h
359 class.o: class.c ../config.h ../include/class.h ../include/client.h \
360  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
361  ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \
362  ../include/struct.h ../include/ircd_alloc.h \
363  ../include/ircd_features.h ../include/ircd_reply.h ../include/list.h \
364  ../include/numeric.h ../include/s_conf.h ../include/s_debug.h \
365  ../include/send.h
366 client.o: client.c ../config.h ../include/client.h \
367  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
368  ../include/ircd_events.h ../include/ircd_handler.h ../include/class.h \
369  ../include/ircd.h ../include/struct.h ../include/ircd_features.h \
370  ../include/ircd_reply.h ../include/list.h ../include/numeric.h \
371  ../include/s_conf.h ../include/s_debug.h ../include/send.h
372 crule.o: crule.c ../config.h ../include/crule.h ../include/client.h \
373  ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \
374  ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \
375  ../include/struct.h ../include/ircd_alloc.h ../include/ircd_chattr.h \
376  ../include/ircd_string.h ../include/match.h ../include/s_bsd.h \
377  ../include/s_debug.h
378 dbuf.o: dbuf.c ../config.h ../include/dbuf.h ../include/ircd_alloc.h \
379  ../include/ircd_chattr.h ../include/ircd_features.h ../include/send.h \
380  ../include/sys.h
381 fda.o: fda.c ../config.h