# ircd/Makefile for the Undernet IRC Daemon. # Copyright (C) 1990 Jarkko Oikarinen # Copyright (C) 1997 Carlo Wood # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #### Start of system configuration section. #### # Output variables of the 'configure' script: prefix = @prefix@ exec_prefix = @exec_prefix@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ DEFS = @DEFS@ INSTALL = @INSTALL@ SHELL = @SHPROG@ RM = @RMPROG@ AWK = @AWK@ LN_S = @LN_S@ MV = mv CHMOD = chmod CHOWN = chown CHGRP = chgrp MKDIR = mkdir TOUCH = touch GREP = grep OSDEP_C = @OSDEP_C@ ENGINE_C = @ENGINE_C@ @SET_MAKE@ BINDIR = @bindir@ INSTALL_RULE = @INSTALL_RULE@ SYMLINK = @SYMLINK@ IRCDMODE = @IRCDMODE@ IRCDOWN = @IRCDOWN@ IRCDGRP = @IRCDGRP@ DPATH = @DPATH@ MPATH = ${DPATH}/ircd.motd RPATH = ${DPATH}/remote.motd CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I. -I.. -I${top_srcdir}/include @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ #### End of system configuration section. #### PURIFY = OSDEP_SRC = \ os_bsd.c \ os_linux.c \ os_openbsd.c \ os_generic.c \ os_solaris.c ENGINE_SRC = \ engine_devpoll.c \ engine_poll.c \ engine_kqueue.c \ engine_select.c IRCD_SRC = \ IPcheck.c \ channel.c \ class.c \ client.c \ crule.c \ dbuf.c \ fda.c \ fileio.c \ gline.c \ hash.c \ ircd.c \ ircd_alloc.c \ ircd_events.c \ ircd_features.c \ ircd_log.c \ ircd_relay.c \ ircd_reply.c \ ircd_signal.c \ ircd_snprintf.c \ ircd_string.c \ ircd_xopen.c \ jupe.c \ list.c \ listener.c \ m_admin.c \ m_away.c \ m_burst.c \ m_clearmode.c \ m_close.c \ m_connect.c \ m_cprivmsg.c \ m_create.c \ m_defaults.c \ m_destruct.c \ m_desynch.c \ m_die.c \ m_endburst.c \ m_error.c \ m_get.c \ m_gline.c \ m_help.c \ m_info.c \ m_invite.c \ m_ison.c \ m_join.c \ m_jupe.c \ m_kick.c \ m_kill.c \ m_links.c \ m_list.c \ m_lusers.c \ m_map.c \ m_mode.c \ m_motd.c \ m_names.c \ m_nick.c \ m_notice.c \ m_oper.c \ m_opmode.c \ m_part.c \ m_pass.c \ m_ping.c \ m_pong.c \ m_privmsg.c \ m_privs.c \ m_proto.c \ m_quit.c \ m_rehash.c \ m_reset.c \ m_restart.c \ m_rping.c \ m_rpong.c \ m_server.c \ m_set.c \ m_settime.c \ m_silence.c \ m_squit.c \ m_stats.c \ m_time.c \ m_topic.c \ m_trace.c \ m_uping.c \ m_user.c \ m_userhost.c \ m_userip.c \ m_version.c \ m_wallchops.c \ m_wallops.c \ m_wallusers.c \ m_who.c \ m_whois.c \ m_whowas.c \ match.c \ motd.c \ msgq.c \ numnicks.c \ opercmds.c \ packet.c \ parse.c \ querycmds.c \ random.c \ res.c \ s_auth.c \ s_bsd.c \ s_conf.c \ s_debug.c \ s_err.c \ s_misc.c \ s_numeric.c \ s_serv.c \ s_stats.c \ s_user.c \ send.c \ support.c \ uping.c \ userload.c \ whocmds.c \ whowas.c SRC = ${IRCD_SRC} ${OSDEP_C} ${ENGINE_C} OBJS = ${SRC:%.c=%.o} DEP_SRC = ${IRCD_SRC} ${OSDEP_SRC} ${ENGINE_SRC} all: ( cd ..; make -f Makefile ) .SUFFIXES: .c .o .c.o: ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@ build: ircd chkconf ircd: ${OBJS} ../include/patchlevel.h version.o ${PURIFY} ${CC} ${OBJS} version.o ${LDFLAGS} ${LIBS} -o ircd ${CHMOD} ${IRCDMODE} ircd # # Make sure the anti hack checksums get included when things change # bleah # # Yeah, "bleah" is right. These checksums don't cover even a fraction of # the "important" .c files...but are useful to determine whether someone # actually is running the version they claim to be running or not. There # must be a better solution...perhaps sum all of the .c files and include # only that one sum? # version.c: version.c.SH s_serv.c s_user.c channel.c s_bsd.c s_misc.c ircd.c ${SHELL} ${srcdir}/version.c.SH ircd_string.o: ircd_string.c chattr.tab.c table_gen: table_gen.o ${CC} -o $@ table_gen.o chattr.tab.c: table_gen ./table_gen > chattr.tab.c chkcrule.o: crule.c ${CC} ${CFLAGS} ${CPPFLAGS} -DCR_CHKCONF -o chkcrule.o -c \ ${srcdir}/crule.c chkconf: chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o ircd_string.o ${CC} chkconf.o fda.o match.o chkcrule.o ircd_alloc.o fileio.o \ ircd_string.o ${LDFLAGS} ${LIBS} -o chkconf mkbindir: @test -d ${BINDIR} || mkdir ${BINDIR} install: ${INSTALL_RULE} install-with-symlink: build mkbindir @if [ ! -d ${DPATH} -a ! -f ${DPATH} ]; then \ echo "Creating directory ${DPATH}"; \ ${MKDIR} ${DPATH}; \ ${CHMOD} 700 ${DPATH}; \ ${CHOWN} ${IRCDOWN} ${DPATH}; \ ${CHGRP} ${IRCDGRP} ${DPATH}; \ fi @echo `date +%Y%m%d%H%M` > /tmp/ircd.tag; @echo "Installing new ircd as ${BINDIR}/ircd.`cat /tmp/ircd.tag` :" ${INSTALL} -m ${IRCDMODE} -o ${IRCDOWN} -g ${IRCDGRP} ircd ${BINDIR}/ircd.`cat /tmp/ircd.tag` @( cd ${BINDIR}; \ ${RM} -f ${SYMLINK}; \ ${LN_S} ircd.`cat /tmp/ircd.tag` ${SYMLINK}; ) @${RM} /tmp/ircd.tag ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/example.conf ${DPATH} # ( cd ${DPATH}; \ # ${TOUCH} ${MPATH}; \ # ${TOUCH} ${RPATH}; \ # ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \ # ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; ) install-no-symlink: build mkbindir @if [ ! -d ${DPATH} -a ! -f ${DPATH} ]; then \ echo "Creating directory ${DPATH}"; \ ${MKDIR} ${DPATH}; \ ${CHMOD} 700 ${DPATH}; \ ${CHOWN} ${IRCDOWN} ${DPATH}; \ ${CHGRP} ${IRCDGRP} ${DPATH}; \ fi @echo "Installing new ircd as ${BINDIR}/ircd :" ${INSTALL} -m ${IRCDMODE} -o ${IRCDOWN} -g ${IRCDGRP} ircd ${BINDIR}/ircd ${INSTALL} -s -m 700 -o ${IRCDOWN} -g ${IRCDGRP} chkconf ${BINDIR} ${INSTALL} -m 600 -o ${IRCDOWN} -g ${IRCDGRP} ${top_srcdir}/doc/example.conf ${DPATH} # ( cd ${DPATH}; \ # ${TOUCH} ${MPATH}; \ # ${TOUCH} ${RPATH}; \ # ${CHOWN} ${IRCDOWN} ${MPATH} ${RPATH}; \ # ${CHGRP} ${IRCDGRP} ${MPATH} ${RPATH}; ) uninstall: @if [ "${BINDIR}" != "${DPATH}" ]; then \ echo "${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9* ${BINDIR}/chkconf"; \ ${RM} -f ${BINDIR}/${SYMLINK} ${BINDIR}/ircd.9* ${BINDIR}/chkconf; \ fi @echo "Please remove the contents of ${DPATH} manually" clean: ${RM} -f *.o *.bak ircd version.c chkconf ircd_osdep.c chattr.tab.c table_gen distclean: clean ${RM} -f Makefile stamp-m maintainer-clean: distclean # If I read this right, this will only work with gcc. Still, how many admins # are going to be doing "make depend"? depend: @cd ${srcdir}; \ if [ -f Makefile.in.bak ]; then \ echo "make depend: First remove ircd/Makefile.in.bak"; \ else \ ( ${MV} Makefile.in Makefile.in.bak; \ ${GREP} -A1 -B10000 '^# DO NOT DELETE THIS LINE' Makefile.in.bak > Makefile.in;\ ${CC} ${CFLAGS} -MM ${CPPFLAGS} ${DEP_SRC} >> Makefile.in; ) \ fi # Coders: You need GNU make for this to work # Makefile: ../config/config.status Makefile.in ../config/gen.ircd.Makefile \ # ../config/config.h ../config/.config stamp-m # @echo "recreating ircd/Makefile" # @cd ../config; \ # CONFIG_FILES=../ircd/Makefile CONFIG_HEADERS= \ # ./config.status >/dev/null; \ # RM=${RM} ${SHELL} ./gen.ircd.Makefile # stamp-m: # echo timestamp > stamp-m # ../config/config.status: # @cd ../config; ${MAKE} config.status # ../config/config.h: # @cd ../config; ${MAKE} config.h # DO NOT DELETE THIS LINE -- make depend depends on it. IPcheck.o: IPcheck.c ../config.h ../include/IPcheck.h \ ../include/client.h ../include/ircd_defs.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ ../include/ircd.h ../include/struct.h ../include/msg.h \ ../include/numnicks.h ../include/ircd_alloc.h ../include/s_debug.h \ ../include/s_user.h ../include/send.h channel.o: channel.c ../config.h ../include/channel.h \ ../include/ircd_defs.h ../include/client.h ../include/dbuf.h \ ../include/msgq.h ../include/ircd_events.h ../include/ircd_handler.h \ ../include/hash.h ../include/ircd.h ../include/struct.h \ ../include/ircd_alloc.h ../include/ircd_chattr.h \ ../include/ircd_features.h ../include/ircd_log.h \ ../include/ircd_policy.h ../include/ircd_reply.h \ ../include/ircd_snprintf.h ../include/ircd_string.h ../include/list.h \ ../include/match.h ../include/msg.h ../include/numeric.h \ ../include/numnicks.h ../include/querycmds.h ../include/s_bsd.h \ ../include/s_conf.h ../include/s_debug.h ../include/s_misc.h \ ../include/s_user.h ../include/send.h ../include/support.h \ ../include/sys.h ../include/whowas.h class.o: class.c ../config.h ../include/class.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h \ ../include/ircd_features.h ../include/ircd_reply.h ../include/list.h \ ../include/numeric.h ../include/s_conf.h ../include/s_debug.h \ ../include/send.h client.o: client.c ../config.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/class.h \ ../include/ircd.h ../include/struct.h ../include/ircd_features.h \ ../include/ircd_reply.h ../include/list.h ../include/numeric.h \ ../include/s_conf.h ../include/s_debug.h ../include/send.h crule.o: crule.c ../config.h ../include/crule.h ../include/client.h \ ../include/ircd_defs.h ../include/dbuf.h ../include/msgq.h \ ../include/ircd_events.h ../include/ircd_handler.h ../include/ircd.h \ ../include/struct.h ../include/ircd_alloc.h ../include/ircd_chattr.h \ ../include/ircd_string.h ../include/match.h ../include/s_bsd.h \ ../include/s_debug.h dbuf.o: dbuf.c ../config.h ../include/dbuf.h ../include/ircd_alloc.h \ ../include/ircd_chattr.h ../include/ircd_features.h ../include/send.h \ ../include/sys.h fda.o: fda.c ../config.h