tinymush-3.0b21/game/bin/
tinymush-3.0b21/game/data/
tinymush-3.0b21/src/tools/
# Makefile for TinyMUSH 3.0
#
# ===================== 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

# Libraries.  Use the second line if you want to use the resolver to get
# hostnames and your libc doesn't use it already.  If you use it, you'd
# better have your nameserver working or things may hang for a while when
# people try to login from distant sites.  Use the third line if you're running
# on a SysV-ish system and BSD support isn't built in to the standard libc.
#
MORELIBS	= -lm
#MORELIBS	= -lm -lnsl -lsocket -L/usr/ucblib -lucb	# Mips
#MORELIBS	= -lm -L/usr/ucblib -lucb			# old Solaris

# ----- TinyMUSH can read and write directly from external databases.
#        If you wish to use this functionality, comment out all definition
#        sets other than the one you wish to use.
#
# No external database.
SQL_INC =
SQL_LIB =
SQL_OBJ = db_empty.o
#
# mSQL database. You must have mSQL already installed. You will need
# to change the pathname, if your mSQL installation is not in the
# normal default location of /usr/local/Hughes
#SQL_INC = -I/usr/local/Hughes/include
#SQL_LIB = -L/usr/local/Hughes/lib -lmsql
#SQL_OBJ = db_msql.o
#
# mySQL database. You must have mySQL already installed. You will need
# to change the pathnames below, if your mySQL installation is not in the
# normal default location of /usr/local
#SQL_INC = -I/usr/local/include/mysql
#SQL_LIB = -L/usr/local/lib/mysql -lmysqlclient
#SQL_OBJ = db_mysql.o

# This set of definitions is for disk-based caching. If you wish to be
# memory based, comment the first set and uncomment the second set. Being
# disk-based usually uses less memory, but more disk-space. Being memory
# entails using more memory, less disk-space, and some gain in performance.
BASED =
UDB_S = udb_ocache.c udb_ochunk.c udb_obj.c udb_misc.c
UDB_O = udb_ocache.o udb_ochunk.o udb_obj.o udb_misc.o
UDB_INC	= udb.h udb_defs.h

#BASED = -DMEMORY_BASED
#UDB_S =
#UDB_O =
#UDB_INC = 

# Uncomment these definitions to use radix tree string compression. This
# will result in less memory usage in both memory and disk based schemes, 
# and reduced disk space as well when disk based. You MUST carefully read 
# README.COMPRESSION and follow the instructions exactly before you define 
# these, or you may cause damage to your database.
# NOTE: You should have a fairly large database before you begin to use
#       radix compression. 
#COMPRESS_DEFS = -DRADIX_COMPRESSION 
#COMPRESS_LIB = -L./radixlib -lcompress

# Miscellaneous options. Add/subtract the definitions if you want to
# add or subtract a feature.
#   -DPUEBLO_SUPPORT	Defining this allows support of the Pueblo client.
#			It is a recommended parameter.
#   -DUSE_COMSYS	Defining this allows the built-in chat channels
#			system to be utilized. It is a recommended parameter.
#			(You can always turn it off at runtime by putting
#			'have_comsys no' in your conf file.)
#   -DUSE_MAIL		Defining this allows the built-in @mail system
#			to be utilized. It is a recommended parameter.
#			(You can always turn it off at runtime by putting
#			'have_mailer no' in your conf file.)
#   -DFLOATING_POINTS	Defining this allows calculations to be performed
#			using floating-point numbers as well as integers.
#			You should always have this enabled, unless you
#			are running on an ancient system that does not
#			have a CPU with a floating-point coprocessor.
#   -DNO_LAG_CHECK	Defining this turns off CPU time calculations
#			for commands. You should not define this unless
#			you have severe problems with computational 
#			resources on your host machine.
#   -DTEST_MALLOC	Defining this results in malloc() keeping track of
#			the number of blocks allocated. It can be useful
#			for tracking down memory leaks. You SHOULD NOT
#			compile with this unless you are doing some
#			heavy-duty source code debugging and no other
#			tools are available to you.
#
MISC_DEFS = -DPUEBLO_SUPPORT -DUSE_COMSYS -DUSE_MAIL -DFLOATING_POINTS

# You might want to change the size of the user-named attribute hash table.
#
# Look at '@list hash' on your game from time to time, and the line for
# 'Vattr Names'; you are interested in the 'Entries' column, which is the
# number of user-named attributes in your database. You want a hash table
# that is larger than this; there is, however, a memory trade-off. The
# hash table size must be a power of two; below is a table listing sizes
# and memory used.
#
# Vattr Size	Memory in K		Vattr Size	Memory in K
# 512           8                       8192            128 
# 1024          16                      16384           256 
# 2048          32                      32768           512 
# 4096          64                      65536           1024 
#
# Values under the default of 16384 are not recommended unless your
# database is under 5,000 objects and memory overhead is of very great
# concern.
#
#VSIZE_F = -DVATTR_HASH_SIZE=16384

# If we want to use the port concentrator, comment out the first set and
# uncomment the second set of definitions. There is no need to use the
# concentrator unless you run into problems with too many players being
# online at once.
CONC_S =
CONC_O =
CONC_DEFS =

#CONC_S = newconc.c
#CONC_S = newconc.o
#CONC_DEFS = -DCONCENTRATE

# Malloc options.
# If your system malloc library is broken for some reason, uncomment the
# first set of options.
# If you wish to use malloc debugging, uncomment the second set of options.
# You should not use malloc debugging unless you are looking for memory
# leaks or corruption, as it drastically impacts server performance.
# If you are trying to hunt down memory issues, though, and you have
# access to Purify (a commercial package), it is recommended that you
# use that instead (make netmush-pure).

#MALLOC_S = malloc.c
#MALLOC_O = malloc.o
#MALLOC_DEFS =

#MALLOC_S = malloc.c mcheck.c mstats.c mtrace.c
#MALLOC_O = malloc.o mcheck.o mstats.o mtrace.o
#MALLOC_DEFS = -DMCHECK -DMTRACE_FILE=\"mtrace.out\"

# 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.
SHELL=/bin/sh
srcdir = @srcdir@
VPATH = @srcdir@
BIN = ../game/bin
CC = @CC@
# CPP = @CPP@	# This is broken in autoconf.  Sigh.
CPP = $(CC) -E
LIBS = @LIBS@
LIBOBJS = @LIBOBJS@

# Standalone cache code.
SA_UDB_S = sa-udb_ocache.c sa-udb_ochunk.c sa-udb_obj.c sa-udb_misc.c
SA_UDB_O = sa-udb_ocache.o sa-udb_ochunk.o sa-udb_obj.o sa-udb_misc.o
SA_UDB_INC = udb.h udb_defs.h

# Source common to netmush and standalone code
COM_SRC	=
COM_OBJ	=

# Everything needed to use the database in standalone mode.
SA_SRC	= sa-db.c sa-db_rw.c sa-boolexp.c sa-unparse.c \
	  sa-pred.c sa-stringu.c sa-conf.c sa-log.c sa-object.c \
	  sa-vattr.c sa-htab.c sa-player_c.c sa-flags.c \
	  sa-udb_ocache.c sa-udb_ochunk.c sa-udb_obj.c sa-udb_misc.c
SA_OBJ	= sa-db.o sa-db_rw.o sa-boolexp.o sa-unparse.o \
	  sa-pred.o sa-stringu.o sa-conf.o sa-log.o sa-object.o \
	  sa-vattr.o sa-htab.o sa-player_c.o sa-flags.o

# Distribution source files
D_SRC	= create.c game.c help.c look.c match.c move.c player.c predicates.c \
	  rob.c set.c speech.c wiz.c walkdb.c timer.c boolexp.c log.c cque.c \
	  unparse.c eval.c command.c wild.c netcommon.c functions.c vattr.c \
	  db.c db_rw.c stringutil.c object.c conf.c flags.c htab.c \
	  compat.c file_c.c player_c.c bsd.c alloc.c comsys.c mail.c \
          mguests.c powers.c newconc.c funceval.c regexp.c quota.c \
	  db_empty.c db_msql.c db_mysql.c
D_OBJ	= create.o game.o help.o look.o match.o move.o player.o predicates.o \
	  rob.o set.o speech.o wiz.o walkdb.o timer.o boolexp.o log.o cque.o \
	  unparse.o eval.o command.o wild.o netcommon.o functions.o vattr.o \
	  db.o db_rw.o stringutil.o object.o conf.o flags.o htab.o \
          compat.o file_c.o player_c.o bsd.o alloc.o comsys.o mail.o \
          mguests.o powers.o newconc.o funceval.o regexp.o quota.o
D_INC	= copyright.h flags.h help.h htab.h interface.h match.h functions.h \
	  command.h config.h db.h externs.h mudconf.h misc.h \
	  vattr.h file_c.h alloc.h attrs.h mguests.h powers.h slave.h \
	  regexp.h bitstring.h db_sql.h

# Version number routine
VER_SRC	= version.c
VER_OBJ	= version.o
VER_INC	= patchlevel.h
VER_FLG	= -DMUSH_BUILD_DATE="\"`date`\"" \
	  -DMUSH_BUILD_NUM="\"`sh ./buildnum.sh`\""

# 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

# Auxiliary source files: only used by offline utilities.
AUX_SRC	= dbconvert.c mkindx.c unsplit.c
LIB_SRC = 
LIB_INC = 
DEBUG	= $(OPTIM)
ALLCFLAGS = $(CFLAGS) $(SQL_INC) $(DEBUG) $(DEFS) $(MISC_DEFS) $(COMPRESS_DEFS) $(BASED) $(MALLOC_DEFS) $(CONC_DEFS) $(VSIZE_F)

#Auxiliary files
A_INST	= CREDITS CHANGES CHANGES.TINY20 CHANGES.TINY22 CHANGES.MUX \
	  CONVERT.TINY22 CONVERT.MUX FAQ INSTALL README README.TOOLS BETA
A_TXT	= badsite.txt connect.txt create_reg.txt down.txt guest.txt help.txt \
	  htmlconn.txt motd.txt news.txt newuser.txt quit.txt register.txt \
	  wizhelp.txt wizmotd.txt full.txt mushman.txt plushelp.txt wiznews.txt
A_SH	= db_load db_unload db_check buildnum.sh
A_RT	= Startmush mush.config
A_CONF	= netmush.conf alias.conf compat.conf
A_MISC	= buildnum.data
A_VMS	= vms_dbm.c vms_dbm.h startmush.com compile.com link.com
A_AUTO	= configure configure.in autoconf.h.in Makefile.in .depend
AUXIL	= $(A_INST) $(A_TXT) $(A_SH) $(A_CONF) $(A_MISC) $(A_RT) $(A_VMS) \
	  $(A_AUTO)

#Installation files
INSTALL_PROG	= Startmush netmush dbconvert mkindx db_load db_unload db_check $(R_SERV)
INSTALL_TARG	= $(INSTALL_PROG) *.txt *.conf
REINSTALL_TARG	= $(INSTALL_PROG) help.txt wizhelp.txt alias.conf compat.conf

#compiliation source files
ALLSRC	= $(D_SRC) $(UDB_SRC) $(UDBA_SRC) $(UDBO_SRC) $(VER_SRC) \
	  $(COM_SRC) $(SA_SRC) $(AUX_SRC) $(LIB_SRC)
ALLINC	= $(D_INC) $(UDB_INC) $(VER_INC) $(NET_INC) $(LIB_INC)
SRC	= $(D_SRC) $(COM_SRC) $(UDB_S) $(MALLOC_S) $(CONC_S)
OBJ	= $(D_OBJ) $(COM_OBJ) $(UDB_O) $(MALLOC_O) $(CONC_O)

# Files in the standard distribution
DIST	= $(ALLSRC) $(ALLINC) $(AUXIL)

OUT	= netmush mkindx dbconvert

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

# paths is likely to remain broken
all: slave $(OUT) links 

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

links: dbconvert mkindx netmush slave
	cd ../game/bin ; rm -f conc ; ln -s ../../src/conc conc
	cd ../game/bin ; rm -f dbconvert ; ln -s ../../src/dbconvert 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/text; rm -f mkindx; ln -s ../../src/mkindx mkindx

conc: portconc.o
	$(CC) $(ALLCFLAGS) $(LIBS) -o conc portconc.o

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

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

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

dbconvert: dbconvert.o $(SA_OBJ) $(SA_UDB_O) $(ALLOC_O) $(LIBOBJS)
	$(CC) $(ALLCFLAGS) -o dbconvert dbconvert.o $(SA_OBJ) $(COM_OBJ) $(SA_UDB_O) $(ALLOC_O) $(LIBS) $(COMPRESS_LIB) $(MORELIBS) $(LIBOBJS)

$(VER_OBJ):
	$(CC) $(ALLCFLAGS) $(VER_FLG) -c $(VER_SRC)

update_buildnum:
	-rm -f $(VER_OBJ)

netmush: update_buildnum $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ)
	-mv -f netmush netmush~
	$(CC) $(ALLCFLAGS) -o netmush $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ) $(LIBS) $(COMPRESS_LIB) $(MORELIBS) $(SQL_LIB)

netmush-pure: update_buildnum $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ)
	-rm -f netmush-pure
	$(PUREDIR)/purify -view-file=purify/netmush.pv \
	-log-file=purify/netmush.plog \
	$(CC) $(ALLCFLAGS) -o netmush-pure $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ) \
	$(LIBS) $(COMPRESS_LIB) $(MORELIBS) $(SQL_LIB)

netmush-purecov: update_buildnum $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ)
	-rm -f netmush-purecov
	$(PURECOVDIR)/purecov -counts-file=purify/netmush.pcv \
	-log-file=purify/netmush.plog \
	$(CC) $(ALLCFLAGS) -o netmush-purecov $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ) \
	$(LIBS) $(COMPRESS_LIB) $(MORELIBS) $(SQL_LIB)

netmush-realpure: update_buildnum $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ)
	-rm -f netmush-realpure
	$(PURIFYDIR)/purify -view-file=purify/netmush.pv \
	-log-file=purify/netmush.plog \
	$(PURECOVDIR)/purecov -counts-file=purify/netmush.pcv \
	$(CC) $(ALLCFLAGS) -o netmush-realpure $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ) \
	$(LIBS) $(COMPRESS_LIB) $(MORELIBS) $(SQL_LIB)

netmush-quant: update_buildnum $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ)
	-rm -f netmush-quant
	$(QUANTDIR)/quantify -view-file=purify/quant.pv \
	-log-file=purify/quant.plog \
	$(CC) $(ALLCFLAGS) -o netmush-pure $(OBJ) $(LIBOBJS) $(SQL_OBJ) $(VER_OBJ) \
	$(LIBS) $(COMPRESS_LIB) $(MORELIBS) $(SQL_LIB)

cvs:
	rm -f buildnum.data
	echo "0" > buildnum.data

dist.tar.Z: $(DIST)
	-rm -f buildnum.data
	echo 0 > buildnum.data
	tar cvhf - $(DIST) | compress -c > dist.tar.Z.NEW
	mv dist.tar.Z.NEW dist.tar.Z

dist.tar.gz: $(DIST)
	-rm -f buildnum.data
	echo 0 > buildnum.data
	tar cvhf - $(DIST) | gzip -c > dist.tar.gz.NEW
	mv dist.tar.gz.NEW dist.tar.gz

depend: $(ALLSRC) unsplit
	for i in $(D_SRC) $(COM_SRC) $(SA_SRC) $(UDBA_SRC) $(UDBO_SRC) $(AUX_SRC) $(LIB_SRC) $(MALLOC_S) $(CONC_S) slave.c portconc.c ; do $(CPP) $(ALLCFLAGS) -M $$i || :; done | sed -e 's:/usr[^ ]* ::g' | ./unsplit > .depend~
	mv .depend~ .depend

index: help.indx news.indx wizhelp.indx mushman.indx plushelp.indx wiznews.indx

help.indx: help.txt
	./mkindx help.txt help.indx

news.indx: news.txt
	./mkindx news.txt news.indx

wizhelp.indx: wizhelp.txt
	./mkindx wizhelp.txt wizhelp.indx

mushman.indx: mushman.txt
	./mkindx mushman.txt mushman.indx

plushelp.indx: plushelp.txt
	./mkindx plushelp.txt plushelp.indx

wiznews.indx: wiznews.txt
	./mkindx wiznews.txt wiznews.indx

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

realclean:
	-rm -f *.o a.out core gmon.out mush.*log mush.*sum $(OUT) netmush~ slave conc

clean:
	-rm -f *.o a.out core gmon.out mush.*log mush.*sum

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

include .depend