# Makefile for src/
# $Id: Makefile.in,v 1.11 2000/07/23 20:47:12 fabian 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 = botcmd.o botmsg.o botnet.o chanprog.o cmds.o dcc.o \
dccutil.o dns.o flags.o language.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): $(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 "Successful compile: $(EGGEXEC)"
	@echo ""

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

depend:
	$(CC) $(CFLAGS) $(CPPFLAGS) -MM $(srcdir)/*.c > .depend

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

botcmd.o:
	@echo "(This will take a while. Go make a pizza or something.)"
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/botcmd.c

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

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

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