#
#	SQ sccsid @(#)Makefile	1.4 88/08/25
#	NOT copyright by SoftQuad.  - msb, 1988
#
# This is configured to make the traced version of malloc; see mallck(1)
# and ./TRACE_README.  To make the regular version, delete -DMALLOCTRACE.
#							Mark Brader
#

# CARGS= -O -DMALLOCTRACE
CARGS= -O

MALLOC_C	= malloc.c free.c realloc.c forget.c write_trace.c init_trace.c
MALLOC_O	= malloc.o free.o realloc.o forget.o write_trace.o init_trace.o

all:	libAlloc.a

mtests:	mtest1 mtest2 mtest3

install: libAlloc.a
	install -m 664 libAlloc.a /mit/visual/phils/$(MACHINE)lib/libAlloc.a
	ranlib /mit/visual/phils/$(MACHINE)lib/libAlloc.a
	
.c.o:	$*.c
	${CC} -c ${CARGS} $*.c

$(MALLOC_O):	malloc.h

libAlloc.a:	$(MALLOC_O)
	ar rv libAlloc.a $(MALLOC_O)
	ranlib libAlloc.a

mtest1:	mtest1.c

mtest2:	mtest2.c

mtest3:	mtest3.c

mtest1 mtest2 mtest3:	libAlloc.a
	${CC} -g $@.c libAlloc.a -o $@

clean:
	rm -f *.o tstmalloc core
