#
#	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

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:	malloctrace.a

mtests:	mtest1 mtest2 mtest3

install: malloctrace.a
	mv malloctrace.a /usr/lib/malloctrace.a
	
.c.o:	$*.c
	${CC} -c ${CARGS} $*.c

$(MALLOC_O):	malloc.h

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

mtest1:	mtest1.c

mtest2:	mtest2.c

mtest3:	mtest3.c

mtest1 mtest2 mtest3:	malloctrace.a
	${CC} -O $@.c malloctrace.a -o $@

clean:
	rm -f *.o tstmalloc core
