#
#  This is the Makefile for EGGDROP (the irc bot)
#  You should never need to edit this.
#

# for memory debugging:  -DMEMORY_DEBUGGING
CFLGS = 
# (only robey will find this useful, usually)
# beware: memory debugging swallows 450+k of memory


# STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP #
# - - - - - - - - do not edit anything below this line. - - - - - - - - #
# - - - - - - - - -  it's all done by configure now.  - - - - - - - - - #
# STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP #


# stuff for Tcl
XOBJS = @TCL_OBJS@
XREQ = @TCL_REQS@
TCLLIB = @TCLLIB@

CFLAGS = -c @CFLAGS@ -I.. @TCL_DEFS@ @DEFS@ ${CFLGS}
@SET_MAKE@

all: eggdrop

help:
	@echo Makefile for Eggdrop.
	@echo "To make eggdrop (the bot):"
	@echo "   % make eggdrop"

clean:
	@rm -f eggdrop egg core *.o *.a
	@cd src ; rm -f eggdrop egg core *.o *.a

dist: clean
	@rm -f Makefile config.cache config.log config.status config.h lush.h

eggdrop: always
	@cd src ; ${GMAKE} eggdrop
	@mv src/eggdrop .
	@echo ""
	@echo "To copy the help files and executables into your bot's"
	@echo "directory, type:"
	@echo "   putegg <my-bot's-directory>"
	@echo ""

egg: always
	@cd src ; ${GMAKE} egg
	@mv src/egg .

always: 

# Justin Slootsky says some systems need this (?)
src/libtcle.a: ${TCLLIB}/@TCLLIBFN@
	@echo "[ Fixing @TCLLIBFN@ -> libtcle.a ]"
	cp ${TCLLIB}/@TCLLIBFN@ src/libtcle.a
	chmod u+rw src/libtcle.a
	ar d src/libtcle.a tclMain.o
	@RANLIB@ src/libtcle.a

GMAKE = ${MAKE} 'CC=@CC@' 'AWK=@AWK@' 'OBJS=${OBJS}' 'TCLLIBFN=@TCLLIBFN@'\
	'CFLAGS=${CFLAGS}' 'XREQ=${XREQ}' 'XLIBS=@LIBS@ @TCL_LIBS@'\
	'TCLLIB=${TCLLIB}' 'RANLIB=@RANLIB@' 'STRIP=@STRIP@'

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

OBJS = chan.o chanprog.o cmds.o dcc.o dccutil.o edit.o fileq.o files.o\
	gotdcc.o hash.o	main.o match.o mem.o misc.o mode.o msgcmds.o\
	msgnotice.o net.o proc.o tandcmd.o tandem.o ${XOBJS} userrec.o\
	users.o
