# Makefile for src/
# $Id: Makefile.in,v 1.13 2005-08-22 03:32:33 wcc Exp $

SHELL = @SHELL@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

@SET_MAKE@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

CC = @CC@
LD = @CC@
STRIP = @STRIP@
CFLAGS = @CFLAGS@ -I.. -I$(top_srcdir) @DEFS@ $(CFLGS)

eggdrop_objs = bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o \
dccutil.o dns.o debug.o flags.o help.o language.o logfile.o match.o main.o \
mem.o misc.o misc_file.o modules.o net.o rfc1459.o tcl.o tcldcc.o tclhash.o \
tclmisc.o tcluser.o traffic.o userent.o userfile.o userrec.o users.o

MAKE_GENERIC = $(MAKE) 'MAKE=$(MAKE)' 'CC=$(CC)' 'LD=$(LD)' \
'STRIP=$(STRIP)' 'CFLGS=$(CFLGS)'


doofus:
	@echo ""
	@echo "Let's try this from the right directory..."
	@echo ""
	@cd .. && $(MAKE)

build_msg:
	@echo ""
	@echo "Compiling Eggdrop: $(EGGBUILD)."
	@echo ""

../$(EGGEXEC): build_msg $(eggdrop_objs) $(XREQS) compile_md5 compatability
	@echo ""
	@echo "Linking Eggdrop: $(EGGBUILD)."
	@echo ""
	@touch mod/mod.xlibs
	$(LD) -o ../$(EGGEXEC) $(eggdrop_objs) $(MODOBJS) $(XLIBS) md5/md5c.o compat/*.o `cat mod/mod.xlibs`
	$(STRIP) ../$(EGGEXEC)
	@echo ""
	@echo "Successful compile: $(EGGEXEC)."
	@echo ""

$(EGGEXEC): ../$(EGGEXEC)

depend:
	$(CC) -I.. -DMAKING_DEPEND -DHAVE_CONFIG_H -MM *.c > .depend

clean:
	@rm -f .depend *.o *.a *~

main.o:
	$(CC) $(CFLAGS) '-DCCFLAGS="$(CC) $(CFLAGS)"' '-DLDFLAGS="$(LD)"' '-DSTRIPFLAGS="$(STRIP)"' -c $(srcdir)/main.c

compatability:
	@cd compat && $(MAKE_GENERIC) compat

compile_md5:
	@cd md5 && $(MAKE_GENERIC) md5

libtcle.a: $(TCLLIB)/lib$(TCLLIBFN)
	@echo "[ Fixing lib$(TCLLIBFN) -> libtcle.a ]"
	cp $(TCLLIB)/lib$(TCLLIBFN) libtcle.a
	chmod u+rw libtcle.a
	ar d libtcle.a tclMain.o
	$(RANLIB) libtcle.a

eggdrop.h:
	@echo "You do not have the eggdrop source!"
	@exit 1

.SUFFIXES:
.SUFFIXES: .c .h .o .a

.c.o:
	$(CC) $(CFLAGS) -c $<

#safety hash
bg.o: bg.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h bg.h
botcmd.o: botcmd.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h botcmd.h botnet.h botmsg.h dcc.h dccutil.h help.h misc.h \
  net.h userrec.h
botmsg.o: botmsg.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h botmsg.h botnet.h dcc.h dccutil.h \
  misc.h net.h
botnet.o: botnet.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h botnet.h botmsg.h dcc.h dccutil.h \
  dns.h mem.h net.h userrec.h
chanprog.o: chanprog.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h chanprog.h misc.h rfc1459.h \
  userrec.h
cmds.o: cmds.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h cmds.h chanprog.h botmsg.h botnet.h dcc.h dccutil.h \
  help.h mem.h misc.h net.h userfile.h userrec.h
dcc.o: dcc.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h dcc.h md5/md5.h botcmd.h botmsg.h botnet.h chanprog.h \
  cmds.h dccutil.h dns.h help.h match.h mem.h misc.h net.h userfile.h \
  userrec.h
dccutil.o: dccutil.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h dccutil.h dcc.h botmsg.h help.h mem.h misc.h net.h
debug.o: debug.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h bg.h stat.h dcc.h dccutil.h mem.h \
  misc.h net.h
dns.o: dns.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h dns.h dcc.h dccutil.h mem.h \
  misc.h net.h
flags.o: flags.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h chanprog.h dcc.h dccutil.h mem.h \
  misc.h rfc1459.h userent.h
help.o: help.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h help.h botmsg.h dccutil.h dcc.h \
  match.h mem.h misc.h
language.o: language.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h dcc.h dccutil.h help.h mem.h \
  misc.h
logfile.o: logfile.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h stat.h dcc.h dccutil.h mem.h \
  misc.h rfc1459.h
main.o: main.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h bg.h botmsg.h botnet.h cmds.h chanprog.h dcc.h dccutil.h \
  help.h mem.h misc.h net.h traffic.h userfile.h userrec.h patch.h
match.o: match.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h match.h rfc1459.h
mem.o: mem.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h mod/modvals.h ../src/types.h \
  mem.h dccutil.h dcc.h help.h
misc.o: misc.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h stat.h misc.h botmsg.h dcc.h dccutil.h help.h match.h \
  mem.h rfc1459.h userfile.h
misc_file.o: misc_file.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h stat.h
modules.o: modules.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h md5/md5.h botcmd.h botmsg.h botnet.h chanprog.h cmds.h \
  dcc.h dccutil.h dns.h help.h match.h mem.h misc.h net.h rfc1459.h \
  userfile.h userent.h userrec.h
net.o: net.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h net.h dcc.h dccutil.h mem.h \
  misc.h traffic.h
rfc1459.o: rfc1459.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h rfc1459.h
tcl.o: tcl.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h dcc.h mem.h misc.h
tcldcc.o: tcldcc.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h tcldcc.h botmsg.h botnet.h chanprog.h cmds.h dcc.h \
  dccutil.h mem.h misc.h net.h userfile.h
tclhash.o: tclhash.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h botmsg.h dcc.h cmds.h dccutil.h \
  match.h mem.h misc.h userrec.h
tclmisc.o: tclmisc.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h md5/md5.h botmsg.h dcc.h dccutil.h help.h match.h misc.h \
  net.h
tcluser.o: tcluser.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h botmsg.h botnet.h chanprog.h dcc.h mem.h misc.h \
  userfile.h userrec.h
traffic.o: traffic.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h traffic.h dcc.h dccutil.h
userent.o: userent.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h userent.h botmsg.h dcc.h \
  dccutil.h match.h mem.h misc.h rfc1459.h userrec.h
userfile.o: userfile.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h userfile.h chanprog.h dcc.h mem.h misc.h rfc1459.h \
  userrec.h
userrec.o: userrec.c main.h ../config.h ../lush.h eggdrop.h types.h \
  debug.h logfile.h lang.h flags.h proto.h misc_file.h language.h \
  tclegg.h tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h userrec.h botmsg.h dcc.h dccutil.h chanprog.h match.h \
  mem.h misc.h rfc1459.h userent.h
users.o: users.c main.h ../config.h ../lush.h eggdrop.h types.h debug.h \
  logfile.h lang.h flags.h proto.h misc_file.h language.h tclegg.h \
  tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
  ../src/main.h compat/snprintf.h compat/memset.h compat/memcpy.h \
  compat/strcasecmp.h compat/strftime.h modules.h mod/modvals.h \
  ../src/types.h botmsg.h botnet.h dcc.h dccutil.h chanprog.h match.h \
  mem.h misc.h net.h rfc1459.h userrec.h
