#
# $Id: Makefile.all,v 1.1.1.1 2005/05/20 19:58:29 gray Exp $
#

HFLS	= mpool.h
OBJS	= mpool.o

CC	= gcc

CFLAGS	= -g -I. $(DEFINES) -fPIC
#CFLAGS	= -g -I.
LDFLAGS	=
RANLIB	= ranlib

DESTDIR	= /usr/local
TEST	= mpool_t
LIBRARY	= libmpool.a

all : $(LIBRARY) $(UTIL)

clean :
	rm -f a.out core *.o *.t
	rm -f $(LIBRARY) $(TEST)

install : $(HFLS) $(LIBRARY)
	install -c -m 444 $(HFLS) $(DESTDIR)/include
	install -c -m 444 $(LIBRARY) $(DESTDIR)/lib
	$(RANLIB) $(DESTDIR)/libo/$(LIBRARY)

$(LIBRARY) : $(OBJS)
	ar cr $(LIBRARY) $?
	$(RANLIB) $@

tests : $(TEST)

$(TEST) : $(TEST).o $(LIBRARY)
	rm -f $@
	$(CC) $(LDFLAGS) $(TEST).o $(LIBRARY)
	mv a.out $@

$(UTIL) : $(UTIL).o $(LIBRARY)
	rm -f $@
	$(CC) $(LDFLAGS) $(UTIL).o $(LIBRARY)
	mv a.out $@

.c.o :
	rm -f $@
	$(CC) $(CFLAGS) -c $< -o $@

#
# Below are dependencies that are automatically generated by make
# depend.  Please do not edit by hand.
#

mpool.o: mpool.c mpool.h mpool_loc.h
mpool_t.o: mpool_t.c mpool.h
