1#
2# (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
3# You may copy, distribute, and use this software as long as this
4# copyright statement is not removed.
5#
6#
7# This is the Makefile for the malloc debugging library
8#
9# $Id: makefile,v 1.1.1.1 2000-09-22 15:33:26 hr Exp $
10#
11CC=cc
12# for System V systems use this CFLAGS
13#CFLAGS=-g -DSYS5
14# else for BSD use:
15#CFLAGS=-g
16LINT=lint
17SHARCMD=shar -o mallocshar -l50 -x -a -n Malloclib
18SHELL=/bin/sh
19
20LIB=libmalloc.a
21
22SRCS=	malloc.c	\
23	free.c		\
24	realloc.c	\
25	calloc.c	\
26	string.c	\
27	mlc_chk.c	\
28	mlc_chn.c	\
29	memory.c	\
30	tostring.c	\
31	m_perror.c	\
32	m_init.c	\
33	mallopt.c	\
34	dump.c
35
36OBJS=	malloc.o	\
37	free.o		\
38	realloc.o	\
39	calloc.o	\
40	string.o	\
41	mlc_chk.o	\
42	mlc_chn.o	\
43	memory.o	\
44	tostring.o	\
45	m_perror.o	\
46	m_init.o	\
47	mallopt.o	\
48	dump.o
49
50TESTS=testmlc testmem
51
52all:	$(LIB) $(TESTS)
53
54clean:
55	rm -f $(TESTS) pgm $(LIB) *.o *.ln
56
57sharfile:
58	$(SHARCMD) Makefile README patchlevel *.[ch3]
59
60$(LIB): $(OBJS)
61	ar ru $(LIB) $(OBJS)
62	-if test -s /bin/ranlib; then /bin/ranlib $(LIB); else exit 0; fi
63	-if test -s /usr/bin/ranlib; then /usr/bin/ranlib $(LIB); else exit 0; fi
64
65testmlc:	$(LIB) testmlc.o
66	$(CC) -o $@ testmlc.o $(LIB)
67
68testmem:	$(LIB) testmem.o
69	$(CC) -o $@ testmem.o $(LIB)
70
71lint:
72	$(LINT) $(CFLAGS) $(SRCS) testmlc.c testmem.c
73
74
75$(OBJS):	malloc.h
76
77tostring.o malloc.o dump.o:	tostring.h
78