# Makefile for eggdrop 0.9+
# [26-Apr/Jamie Rishaw]
# modified many times since by Robey Pointer
#
# successfully compiled on the following systems:
#   SunOS, NeXT, Linux, Ultrix, IRIX, BSD/386 (maybe), HP-UX (allegedly),
#   AIX

# Binaries
CC = cc
RM = rm
AWK = awk
MAKE = make
CFLG = -O
# for memory debugging:  -DMEMORY_DEBUGGING
# (only robey will find this useful, usually)
# beware: memory debugging swallows 300+k of memory


# SunOS or NeXT or Ultrix: (they work fine)
OS = BSD

# Linux or IRIX:
#OS = LINUX
#CFLG = -c -O2

# BSD/386 (seems to be buggy lately):
#OS = BSD386

# HP-UX (may have to twiddle code):
#OS = HPUX

# AIX:  you must use gcc!
#OS = AIX
#CC = gcc

#### TCL ####

# If you want to compile WITHOUT Tcl, put a '#' in front of these lines:
XOBJS = tcl.o tclhash.o
TCLDEF = -DTCL
XLIBS = -L. -ltcle -lm
XREQ = ./libtcle.a

# If your TCL include file is in a weird place, specify it here
# (compiling without Tcl?  comment this out)
#TCLINC = -I/usr/local/include
TCLINC = -I/u/r/robey/include

# give the directory the original tcl library is stored
# (eggdrop needs to copy and modify it a bit to be usable)
# (compiling without Tcl?  comment this out)
#TCLLIB = /usr/local/lib
TCLLIB = /u/r/robey/lib


# STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP #
# - - - - - - - - do not edit anything below this line. - - - - - - - - #
# STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP STOP #

CFLAGS = ${CFLG} -c -D${OS} ${TCLDEF} ${TCLINC}

all: eggdrop

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

clean:
	@${RM} -f eggdrop egg core *.o
	@cd src ; ${RM} -f eggdrop egg core *.o

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

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

always:

GMAKE = ${MAKE} 'CC=${CC}' 'RM=${RM}' 'AWK=${AWK}' 'OS=${OS}' \
	'LINT=${LINT}' 'OBJS=${OBJS}' 'CFLAGS=${CFLAGS}' 'XLIBS=${XLIBS}' \
	'XREQ=${XREQ}' 'TCLLIB=${TCLLIB}'

eggdrop.h:
	@echo You do not have the eggdrop source!
	@echo "Type 'make help' for help."
	@exit 1
	
OBJS = net.o io.o chan.o mode.o chanprog.o mem.o reg.o msgnotice.o dcc.o\
	gotdcc.o edit.o misc.o hash.o cmds.o msgcmds.o files.o userrec.o\
	users.o tandem.o tandcmd.o proc.o ${XOBJS}
