# Makefile for src/
# $Id: Makefile.in,v 1.23 2006-11-20 11:38:25 tothwolf 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)
CPPFLAGS = @CPPFLAGS@

eggdrop_objs = bg.o botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o \
dccutil.o dns.o flags.o language.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 \
userent.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)

../$(EGGEXEC): build_msg $(eggdrop_objs) $(XREQS) compile_md5 compatability
	@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 *~

build_msg:
	@echo ""
	@echo "This may take a while. Go get some runts."
	@echo ""

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

compatability:
	@cd compat && $(MAKE_GENERIC) compat
	@echo ""
	@echo "---------- Yeah! That's the compiling, now the linking! ----------"
	@echo ""

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) $(CPPFLAGS) -c $<

#safety hash
bg.o: bg.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h proto.h \
  misc_file.h cmdt.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 lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 \
  tandem.h modules.h mod/modvals.h
botmsg.o: botmsg.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 \
  tandem.h
botnet.o: botnet.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 \
  tandem.h
chanprog.o: chanprog.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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
cmds.o: cmds.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 \
  tandem.h modules.h mod/modvals.h
dcc.o: dcc.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 tandem.h md5/md5.h
dccutil.o: dccutil.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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 tandem.h
dns.o: dns.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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
flags.o: flags.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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
language.o: language.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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
main.o: main.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 tandem.h bg.h patch.h
match.o: match.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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
mem.o: mem.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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
misc.o: misc.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 \
  tandem.h modules.h mod/modvals.h stat.h
misc_file.o: misc_file.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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 lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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 tandem.h md5/md5.h
net.o: net.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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.o: rfc1459.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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
tcl.o: tcl.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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
tcldcc.o: tcldcc.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 \
  tandem.h modules.h mod/modvals.h
tclhash.o: tclhash.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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
tclmisc.o: tclmisc.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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 tandem.h md5/md5.h
tcluser.o: tcluser.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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 \
  tandem.h modules.h mod/modvals.h
userent.o: userent.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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
userrec.o: userrec.c main.h ../config.h ../lush.h lang.h eggdrop.h \
  flags.h proto.h misc_file.h cmdt.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 tandem.h
users.o: users.c main.h ../config.h ../lush.h lang.h eggdrop.h flags.h \
  proto.h misc_file.h cmdt.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 tandem.h
