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

# things you can put here:
#   -Wall                 if you're using gcc and it supports it
#   -DMEMORY_DEBUGGING    to be able to debug memory allocation
#   -DLINUX_THREADS       to try out threads on Linux 1.3.29 or higher
#   -DDEBUG_TCL           writes a DEBUG.TCL file which grows really
#                           fast and logs every code sent to Tcl
CFLGS = 


# 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
XREQ = @TCL_REQS@
TCLLIB = @TCLLIB@

CFLAGS = -c @CFLAGS@ -I.. @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
	@echo "all:" >Makefile
	@echo "	@echo Run 'configure' first." >>Makefile

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}/lib@TCLLIBFN@
	@echo "[ Fixing lib@TCLLIBFN@ -> libtcle.a ]"
	cp ${TCLLIB}/lib@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 chanset.o cmds.o dcc.o dccutil.o filedb.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\
	tcl.o tclhash.o userrec.o users.o
