tinymush-3.1p2/game/backups/
tinymush-3.1p2/game/bin/
tinymush-3.1p2/game/data/
tinymush-3.1p2/game/modules/
tinymush-3.1p2/game/modules/old/
tinymush-3.1p2/src/modules/comsys/
tinymush-3.1p2/src/modules/hello/
tinymush-3.1p2/src/modules/mail/
tinymush-3.1p2/src/tools/
# Makefile for TinyMUSH 3.1
#
all: install
# ===================== CONFIGURATION SECTION ====================
#
# Select the correct C compiler.  Whatever you choose, it must be able
# to grok ANSI C (function prototypes)
#
#-----CC or GCC (must be able to grok function prototypes)
#
DEFS =
#
#-----GCC if the libraries were built for a pcc-derived cc compiler
#     (most systems)
#
#DEFS = -fpcc-struct-return -Wall -Wno-char-subscripts
#
#-----GCC with GCC-compatible libraries if you want verbose error messages
#
#DEFS = -Wall -Wno-char-subscripts
#
#-----GCC, GCC-compatible libs, very verbose (often useless) warning messages
#
#DEFS = -Wall -W -Wno-char-subscripts -Winline
#
#-----CC on a NeXT system, really weird derivative of GCC
#
#DEFS = -DNEXT -DNEED_STRDUP
#
#-----HP-UX C compiler
#
#DEFS = -w +Obb800 -Aa -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_HPUX_SOURCE -D_INCLUDE_XOPEN_SOURCE
#
#-----MIPS C compiler (also DEC 3xxx, Prime EXL7xxx)
#
#DEFS = -signed

# After we finish beta testing, we'll take away the debugging -g flag.
# If you don't use GCC, don't use -g. Add -pg for profiling (gprof netmush
# gmon.out)
#OPTIM = -O
#OPTIM = -g -pg -O
OPTIM = -g -O

# ----- TinyMUSH can read and write directly from external databases.
#        These variables are set by the configure script (--help for options).
SQL_S = @SQL_S@
SQL_I = @SQL_I@
SQL_O = @SQL_O@

# ----- This set of definitions is for the database layer.
#        These variables are set by the configure script (--help for options).
UDB_S = @UDB_S@
UDB_O = @UDB_O@
UDB_I = @UDB_I@

# ----- This set of definitions is for the port concentrator.
#        These variables are set by the configure script (--help for options).
CONC_S = @CONC_S@
CONC_O = @CONC_O@

# ----- This set of definitions is for using our version of malloc, with
#        optional tracing.
#        These variables are set by the configure script (--help for options).
MALLOC_S = @MALLOC_S@
MALLOC_O = @MALLOC_O@

# ----- This set of definitions causes modules to be built.
#        These variables are set by the configure script (--help for options).
@INCMODULECODE@

# Select the networking support you have.  Currently only BSD networking
# is supported.
#
# ----- BSD networking
NET_S	= bsd.c
NET_O	= bsd.o

# ================== END OF CONFIGURATION SECTION =================

# General parameters.
@SET_MAKE@
SHELL=/bin/sh
srcdir = @srcdir@
subdirs = @subdirs@
top_builddir = @srcdir@
VPATH = @srcdir@
BIN = ../game/bin
CC = @CC@
CPP = @CPP@
MKDEP = @MKDEP@
LIBTOOL = @LIBTOOL@
LIBS = @LIBS@
LIBADD_DL = @LIBADD_DL@
LIBOBJS = @LIBOBJS@
DEBUG	= $(OPTIM)
ALLCFLAGS = $(CFLAGS) $(SQL_I) $(DEBUG) $(DEFS)

# Purify stuff.
PUREDIR = /local/src/purify-4.0.1-sunos4
PURIFYDIR = /local/rational/purify-4.2-sunos4
PURECOVDIR = /local/rational/purecov-4.2-sunos4
QUANTDIR = /local/rational/quantify-4.2-sunos4

# Distribution source files
D_S	= alloc.c api.c boolexp.c command.c compat.c conf.c cque.c create.c \
	  db.c db_rw.c eval.c file_c.c flags.c fnhelper.c functions.c \
	  funext.c funiter.c funlist.c funmath.c funmisc.c funobj.c \
	  funstring.c funvars.c game.c help.c htab.c log.c look.c ltdl.c \
	  match.c mguests.c move.c netcommon.c object.c pcre.c player.c \
	  player_c.c powers.c predicates.c quota.c rob.c set.c speech.c \
	  stringutil.c timer.c unparse.c vattr.c walkdb.c wild.c wiz.c
D_O	= alloc.o api.o boolexp.o command.o compat.o conf.o cque.o create.o \
	  db.o db_rw.o eval.o file_c.o flags.o fnhelper.o functions.o \
	  funext.o funiter.o funlist.o funmath.o funmisc.o funobj.o \
	  funstring.o funvars.o game.o help.o htab.o log.o look.o ltdl.o \
	  match.o mguests.o move.o netcommon.o object.o pcre.o player.o \
	  player_c.o powers.o predicates.o quota.o rob.o set.o speech.o \
	  stringutil.o timer.o unparse.o vattr.o walkdb.o wild.o wiz.o
D_I	= copyright.h flags.h help.h htab.h interface.h match.h functions.h \
	  fnproto.h cmdtabs.h command.h config.h db.h externs.h mudconf.h \
	  walkdb.h vattr.h file_c.h alloc.h attrs.h powers.h slave.h \
	  api.h pcre.h bitstring.h db_sql.h ltdl.h

# Auxiliary source files: only used by offline utilities.
AUX_S	= mkindx.c unsplit.c slave.c portconc.c recover.c logwatch.c

# Version number routine
VER_S	= version.c
VER_O	= version.o
VER_I	= patchlevel.h
VER_FLG	= -DMUSH_BUILD_DATE="\"`date`\"" \
	  -DMUSH_BUILD_NUM="\"`sh ./buildnum.sh`\"" \
	  -DMUSH_BUILD_COMPILER="\"$(CC)\"" \
	  -DMUSH_BUILD_CFLAGS="\"$(ALLCFLAGS)\"" \
	  -DMUSH_CONFIGURE_CMD="\"@CONFIGURE_CMD@\""

# Compilation source files
ALL_S	= $(D_S) $(NET_S) $(UDB_S) $(MALLOC_S) $(CONC_S) $(SQL_S) $(VER_S) \
	  $(AUX_S)

ALL_I	= $(D_I) $(UDB_I) $(VER_I)

MUSH_S	= $(D_S) $(NET_S) $(UDB_S) $(MALLOC_S) $(CONC_S) $(SQL_S) $(VER_S)
MUSH_O	= $(D_O) $(NET_O) $(UDB_O) $(MALLOC_O) $(CONC_O) $(SQL_O) $(VER_O) \
	  $(LIBOBJS)

OUT	= netmush mkindx slave recover logwatch

depend: $(ALL_S) $(ALL_I) unsplit Makefile
	for i in $(ALL_S); do $(MKDEP) $(ALLCFLAGS) $$i || :; done | sed -e 's:/usr[^ ]* *::g' | ./unsplit > .depend~
	mv .depend~ .depend
	touch depend

build: depend
	$(MAKE) $(OUT)
	touch build

install: build
	cd ../game/bin ; rm -f dbconvert ; ln -s ../../src/netmush dbconvert
	cd ../game/bin ; rm -f mkindx ; ln -s ../../src/mkindx mkindx
	cd ../game/bin ; rm -f netmush ; ln -s ../../src/netmush netmush
	cd ../game/bin ; rm -f slave ; ln -s ../../src/slave slave
	cd ../game/bin ; rm -f recover ; ln -s ../../src/recover recover
	cd ../game/bin ; rm -f logwatch ; ln -s ../../src/logwatch logwatch
	cd ../game/text; rm -f mkindx; ln -s ../../src/mkindx mkindx
	touch install

install-modules:
	touch install-modules

.c.o:
	$(CC) $(ALLCFLAGS) -c $<

$(VER_O): $(VER_S) $(MUSH_S) $(ALL_I) $(MOD_S) $(MOD_I)
	$(CC) $(ALLCFLAGS) $(VER_FLG) -c $<

conc: portconc.o
	$(CC) $(ALLCFLAGS) $(LIBS) -o conc portconc.o
	cd ../game/bin ; rm -f conc ; ln -s ../../src/conc conc

slave: slave.o
	$(CC) $(ALLCFLAGS) -o slave slave.o $(LIBS)

mkindx: mkindx.o
	$(CC) $(ALLCFLAGS) -o mkindx mkindx.o

logwatch: logwatch.o
	$(CC) $(ALLCFLAGS) -o logwatch logwatch.o

recover: recover.o
	$(CC) $(ALLCFLAGS) -o recover recover.o $(LIBS)

unsplit: unsplit.o
	$(CC) $(ALLCFLAGS) -o unsplit unsplit.o

netmush: $(MUSH_O) install-modules
	-mv -f netmush netmush~
	$(LIBTOOL) --mode=link $(CC) -export-dynamic $(ALLCFLAGS) -o netmush $(MUSH_O) $(MOD_DL) $(LIBS) $(LIBADD_DL)

netmush-pure: $(MUSH_O) install-modules
	-rm -f netmush-pure
	$(PUREDIR)/purify -view-file=purify/netmush.pv \
	-log-file=purify/netmush.plog \
	$(LIBTOOL) --mode=link $(CC) -export-dynamic $(ALLCFLAGS) -o netmush-pure $(MUSH_O) $(MOD_DL) $(LIBS) $(LIBADD_DL)

netmush-purecov: $(MUSH_O) install-modules
	-rm -f netmush-purecov
	$(PURECOVDIR)/purecov -counts-file=purify/netmush.pcv \
	-log-file=purify/netmush.plog \
	$(LIBTOOL) --mode=link $(CC) -export-dynamic $(ALLCFLAGS) -o netmush-purecov $(MUSH_O) $(MOD_DL) $(LIBS) $(LIBADD_DL)

netmush-realpure: $(MUSH_O) install-modules
	-rm -f netmush-realpure
	$(PURIFYDIR)/purify -view-file=purify/netmush.pv \
	-log-file=purify/netmush.plog \
	$(PURECOVDIR)/purecov -counts-file=purify/netmush.pcv \
	$(LIBTOOL) --mode=link $(CC) -export-dynamic $(ALLCFLAGS) -o netmush-realpure $(MUSH_O) $(MOD_DL) $(LIBS) $(LIBADD_DL)

netmush-quant: $(MUSH_O) install-modules
	-rm -f netmush-quant
	$(QUANTDIR)/quantify -view-file=purify/quant.pv \
	-log-file=purify/quant.plog \
	$(LIBTOOL) --mode=link $(CC) -export-dynamic $(ALLCFLAGS) -o netmush-pure $(MUSH_O) $(MOD_DL) $(LIBS) $(LIBADD_DL)

verify:
	runtest --tool mush --src ./testsuite

clean:
	-rm -f *.o *.lo a.out core gmon.out mush.*log mush.*sum Compile.log
	-rm -rf .libs
	curdir=`pwd`
	cd gdbm-1.8.0 && $(MAKE) clean
	cd $$curdir

realclean: clean
	-rm -f $(OUT) netmush~ conc unsplit

distclean: realclean
	curdir=`pwd`
	cd gdbm-1.8.0 && $(MAKE) distclean
	cd $$curdir
	-rm -f libtool config.log config.cache config.status autoconf.h
	-rm -f depend build install install-modules
	-rm -f .depend buildnum.data
	touch .depend
	-rm -f Makefile

TAGS: *.c *.h
	etags *.c *.h

indent:
	indent -bad -bap -ncdb -nsob -fca -sc -br -ce -ss -npcs -nbc -lp -i8 -ip0 -cp5 -ncs -npsl -di1 *.c tools/*.c web/*.c

include .depend