/
driver3.2@242/autoconf/
driver3.2@242/doc/LPC/
driver3.2@242/hosts/
driver3.2@242/hosts/amiga/NetIncl/
driver3.2@242/hosts/amiga/NetIncl/netinet/
driver3.2@242/hosts/amiga/NetIncl/sys/
driver3.2@242/hosts/atari/
driver3.2@242/hosts/fcrypt/
driver3.2@242/mudlib/
driver3.2@242/mudlib/sys/
driver3.2@242/util/
driver3.2@242/util/indent/hosts/next/
driver3.2@242/util/make_docs/
# This line is needed on some machines.
MAKE=make
#
# Chose one of these mallocs:
MALLOC=smalloc
#
# Gnu malloc, fastest but uses most memory.
#MALLOC=gmalloc
#
# Use the standard malloc on your system:
#MALLOC=sysmalloc
#
# Lars special malloc for LPmud. Uses least memory, but has an inefficient
# recombination scheme that may slow down the game after long uptimes.
#MALLOC=malloc
#
# Set MUD_LIB to the directory which contains the mud data. Was formerly
# defined in config.h !
MUD_LIB = e:/mud/mudlib
#
# Set BINDIR to the directory where you want to install the executables.
BINDIR = e:/mud/mudbin
#
# Define what random number generator to use.
# If no one is specified, a guaranteed bad one will be used.
#
RAND=RANDOM
YFLAGS=-d -y
#
# If you don't have 'strchr', then add next flag to CFLAGS.
# -Dstrchr=index -Dstrrchr=rindex
#
PROFIL= -DOPCPROF -DVERBOSE_OPCPROF
#PROFIL=-p -DMARK
#PROFIL=-pg
#Enable warnings from the compiler, if wanted.
#WARN=
#WARN= -Wall -Wshadow -Dlint
WARN= -Wall -Wshadow
#
# Enable run time debugging. It will use more time and space.
# When the flag is changed, be sure to recompile everything.
# Simply comment out this line if not wanted.
# If you change anything in the source, you are strongly encouraged to have
# DEBUG defined.
# If you will not change anything, you are still encouraged to have
# it defined, if you want to locate any game driver bugs.
#DEBUG=-DDEBUG
MPATH=-DMUD_LIB='"$(MUD_LIB)"'
#
# If you have a NeXT, add this to CFLAGS:
# -DNeXT -bsd
#
# to compile interpret.c on an atari ST/TT with only 4 MB, remove -O
CFLAGS= -O -fomit-frame-pointer -fcombine-regs -fstrength-reduce -D$(RAND) -DMALLOC_$(MALLOC) $(WARN) $(DEBUG) $(MPATH) -DBINDIR='"$(BINDIR)"' -DCOMM_STAT -DAPPLY_CACHE_STAT
#CFLAGS= -O -fomit-frame-pointer -fcombine-regs -fstrength-reduce -D$(RAND) -DMALLOC_$(MALLOC) $(WARN) -DTRACE_CODE $(PROFIL) $(DEBUG) $(MPATH) -DBINDIR='"$(BINDIR)"' -DCOMM_STAT -DAPPLY_CACHE_STAT
#CFLAGS= -O -fomit-frame-pointer -fcombine-regs -fstrength-reduce -m68020 -m68881 -DATARI_TT -D$(RAND) -DMALLOC_$(MALLOC) $(WARN) -DTRACE_CODE $(PROFIL) $(DEBUG) $(MPATH) -DBINDIR='"$(BINDIR)"' -DCOMM_STAT -DAPPLY_CACHE_STAT
#CFLAGS= $(PROFIL) -DDEBUG -DTRACE_CODE -fomit-frame-pointer -fcombine-regs -fstrength-reduce -D$(RAND) -DMALLOC_$(MALLOC) $(WARN) $(MPATH) -DBINDIR='"$(BINDIR)"' -DCOMM_STAT -DAPPLY_CACHE_STAT
#CFLAGS= -DYYDEBUG=1 -D$(RAND) -DMALLOC_$(MALLOC) $(WARN) -DTRACE_CODE $(PROFIL) $(DEBUG) $(MPATH) -DBINDIR='"$(BINDIR)"' -DCOMM_STAT -DAPPLY_CACHE_STAT
CC=gcc
#
# Add extra libraries here.
#
LIBS= '-Id:/gnu/lib -lm -s' strtol.o
MFLAGS = "BINDIR=$(BINDIR)" "MUD_LIB=$(MUD_LIB)"
#
# Add str.c here if you don't have memcpy() or strtol()
#
SRC=prolang.y lex.c main.c interpret.c simulate.c object.c backend.c array.c\
    comm1.c ed.c regexp.c mapping.c wiz_list.c swap.c $(MALLOC).c\
    call_out.c otable.c dumpstat.c stralloc.c hash.c indentp.c port.c\
    access_check.c clilib.c parse_old.c parse.c simul_efun.c sprintf.c\
    gcollect.c closure.c
#
# Add str.o here if you don't have memcpy() or strtol().
# Add alloca.o if you don't have alloca() on your machine.
#
OBJ=lang.o lex.o main.o interpret.o simulate.o object.o backend.o array.o\
    comm1.o ed.o regexp.o mapping.o wiz_list.o swap.o $(MALLOC).o\
    call_out.o otable.o dumpstat.o stralloc.o hash.o indentp.o port.o\
    access_check.o clilib.o parse_old.o parse.o simul_efun.o sprintf.o\
    gcollect.o cloosure.o

driver: $(OBJ) strtol.o
	$(CC) $(CFLAGS) $(OBJ) -o $@ $(LIBS)
	fixstk 64k driver

make_func.c: make_func.y
	yacc -v make_func.y
	mv y_tab.c make_func.c

make_func: make_func.o hash.o
	$(CC) make_func.o hash.o -o make_func
	fixstk 64k make_func

make_func.o: config.h
#	$(CC) -DYYDEBUG=1 -c make_func.c

install: driver
	install -c $? $(BINDIR)/parse

install.utils:
	(cd util; $(MAKE) $(MFLAGS) install)

utils:	
	(cd util; $(MAKE) $(MFLAGS))

parse: driver
	-mv parse parse.old
	cp driver parse

lint: *.c
	lint *.c

call_out.o: object.h interpret.h comm.h stralloc.h exec.h wiz_list.h config.h

swap.o: swap.c object.h config.h interpret.h exec.h

lang.c lang.h: lang.y
	yacc -d -v lang.y
	mv y_tab.c lang.c
	mv y_tab.h lang.h

#interpret.o: interpret.h config.h object.h instrs.h exec.h\
#	switch.h lang.h $(MALLOC).o

#simulate.o: interpret.h object.h config.h sent.h wiz_list.h exec.h instrs.h\
#   comm.h $(MALLOC).o
simulate.o: interpret.h object.h config.h sent.h wiz_list.h exec.h instrs.h\
    comm.h

sprintf.o: interpret.h object.h config.h sent.h instrs.h

wiz_list.o: wiz_list.h interpret.h config.h

main.o: config.h object.h interpret.h lex.h

clean:
	-rm -f *.o lang.h lang.c lexical.c mon.out *.ln tags
	-rm -f parse core frontend mudlib/core mudlib/debug.log TAGS frontend.c
	-rm -f config.status lpmud.log
	(cd util ; echo "Cleaning in util." ; $(MAKE) clean)

#include has problems when the toplevel source file is in a subdirectory.
frontend: hosts/atari/frontend.c config.h comm.h
	cp hosts/atari/frontend.c .
	$(CC) $(CFLAGS) frontend.c -o frontend $(LIBS)
	rm frontend.c
	fixstk 16k frontend

tags: $(SRC)
	ctags $(SRC)

TAGS: $(SRC)
	etags $(SRC)

diff:
	make_diffs

count_active: count_active.o
	$(CC) count_active.o -o count_active

object.o: interpret.h object.h sent.h config.h wiz_list.h exec.h

#backend.o: object.h config.h interpret.h wiz_list.h exec.h comm.h $(MALLOC).o
backend.o: object.h config.h interpret.h wiz_list.h exec.h comm.h

comm1.o: comm.h sent.h interpret.h object.h config.h mudwho.h patchlevel.h

clilib.o: config.h

comm2.o: config.h comm.h

ed.o: regexp.h object.h config.h interpret.h comm.h

regexp.o: regexp.h config.h

otable.o: config.h object.h interpret.h

dumpstat.o: object.h interpret.h exec.h config.h

parse.o: interpret.h config.h object.h wiz_list.h

parse_old.o: interpret.h config.h object.h wiz_list.h

stralloc.o: config.h smalloc.h

array.o: array.c interpret.h object.h config.h wiz_list.h exec.h instrs.h

mapping.o: interpret.h object.h config.h wiz_list.h regexp.h instrs.h

hash.o: hosts/atari/hash.s
	$(CC) $(CFLAGS) -c hosts/atari/hash.s
access_check.o: config.h

#lang.y efun_defs.c instrs.h: func_spec make_func prolang.y config.h $(MALLOC).o
lang.y efun_defs.c instrs.h: func_spec make_func prolang.y config.h
	rm -f efun_defs.c
	rm -f lang.y
	./make_func > efun_defs.c

interpret.s: interpret.c interpret.h config.h object.h instrs.h exec.h\
	switch.h lang.h comm.h smalloc.h
	$(CC) $(CFLAGS) -S interpret.c

interpret.o: interpret.s
	$(CC) $(CFLAGS) -c interpret.s

closure.o: exec.h interpret.h object.h lang.h instrs.h

lang.s: lang.c config.h object.h interpret.h exec.h instrs.h switch.h lex.h
	$(CC) $(CFLAGS) -S lang.c

lang.o: lang.s
	$(CC) $(CFLAGS) -c lang.s

lex.s: config.h instrs.h interpret.h exec.h efun_defs.c lang.h lex.h lex.c\
	patchlevel.h
	$(CC) $(CFLAGS) -S lex.c

lex.o: lex.s
	$(CC) $(CFLAGS) -c lex.s

simul_efun.o: interpret.h object.h config.h

strtol.o:
	$(CC) $(CFLAGS) -c hosts/atari/strtol.c

gcollect.o: smalloc.h config.h

$(MALLOC).o: $(MALLOC).c config.h
	rm -f smalloc.o
	rm -f gmalloc.o
	rm -f sysmalloc.o
	rm -f malloc.o
	$(CC) $(CFLAGS) -c $(MALLOC).c

debug_clean:
	rm -f array.o backend.o call_out.o comm1.o efun_defs.o
	rm -f interpret.s lang.s lex.s
	rm -f main.o make_func.o object.o regexp.o simul_efun.o simulate.o
	rm -f smalloc.o stralloc.o