1 # ircd/Makefile for the Undernet IRC Daemon.
2 # Copyright (C) 1990 Jarkko Oikarinen
3 # Copyright (C) 1997 Carlo Wood
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)
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.
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
20 #### Start of system configuration section. ####
22 # Output variables of the 'configure' script:
25 exec_prefix = @exec_prefix@
26 top_srcdir = @top_srcdir@
47 INSTALL_RULE = @INSTALL_RULE@
53 MPATH = ${DPATH}/ircd.motd
54 RPATH = ${DPATH}/remote.motd
58 CPPFLAGS = -I. -I.. -I${top_srcdir}/include @CPPFLAGS@
62 #### End of system configuration section. ####
198 SRC = ${IRCD_SRC} ${OSDEP_C} ${ENGINE_C}
200 OBJS = ${SRC:%.c=%.o}
202 DEP_SRC = ${IRCD_SRC} ${OSDEP_SRC} ${ENGINE_SRC}
205 ( cd ..; make -f Makefile )
210 ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
214 ircd: ${OBJS} ../include/patchlevel.h version.o
215 ${PURIFY} ${CC} ${OBJS} version.o ${LDFLAGS} ${LIBS} -o ircd
216 ${CHMOD} ${IRCDMODE} ircd
219 # Make sure the anti hack checksums get included when things change
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
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
231 ircd_string.o: ircd_string.c chattr.tab.c
233 table_gen: table_gen.o
234 ${CC} -o $@ table_gen.o
236 chattr.tab.c: table_gen
237 ./table_gen > chattr.tab.c
240 ${CC} ${CFLAGS} ${CPPFLAGS} -DCR_CHKCONF -o chkcrule.o -c \
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
248 @test -d ${BINDIR} || mkdir ${BINDIR}
250 install: ${INSTALL_RULE}
252 install-with-symlink: build mkbindir
253 @if [ ! -d ${DPATH} -a ! -f ${DPATH} ]; then \
254 echo "Creating directory ${DPATH}"; \
256 ${CHMOD} 700 ${DPATH}; \
257 ${CHOWN} ${IRCDOWN} ${DPATH}; \
258 ${CHGRP} ${IRCDGRP} ${DPATH}; \
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`
264 ${RM} -f ${SYMLINK}; \
265 ${LN_S} ircd.`cat /tmp/ircd.tag` ${SYMLINK}; )
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}
270 # ${TOUCH} ${MPATH}; \
271 # ${TOUCH} ${RPATH}; \
272 # ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \
273 # ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; )
275 install-no-symlink: build mkbindir
276 @if [ ! -d ${DPATH} -a ! -f ${DPATH} ]; then \
277 echo "Creating directory ${DPATH}"; \
279 ${CHMOD} 700 ${DPATH}; \
280 ${CHOWN} ${IRCDOWN} ${DPATH}; \
281 ${CHGRP} ${IRCDGRP} ${DPATH}; \
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}
288 # ${TOUCH} ${MPATH}; \
289 # ${TOUCH} ${RPATH}; \
290 # ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \
291 # ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; )
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; \
298 @echo "Please remove the contents of ${DPATH} manually"
301 ${RM} -f *.o *.bak ircd version.c chkconf ircd_osdep.c chattr.tab.c table_gen
304 ${RM} -f Makefile stamp-m
306 maintainer-clean: distclean
308 # If I read this right, this will only work with gcc. Still, how many admins
309 # are going to be doing "make depend"?
312 if [ -f Makefile.in.bak ]; then \
313 echo "make depend: First remove ircd/Makefile.in.bak"; \
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; ) \
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"
325 # CONFIG_FILES=../ircd/Makefile CONFIG_HEADERS= \
326 # ./config.status >/dev/null; \
327 # RM=${RM} ${SHELL} ./gen.ircd.Makefile
330 # echo timestamp > stamp-m
332 # ../config/config.status:
333 # @cd ../config; ${MAKE} config.status
335 # ../config/config.h:
336 # @cd ../config; ${MAKE} config.h
338 # DO NOT DELETE THIS LINE -- make depend depends on it.
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 \
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 \
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 \
381 fda.o: fda.c ../config.h