# This file is part of libdyn.a, the C Dynamic Object library.  It
# contains the Makefile.
#
# There are no restrictions on this code; however, if you make any
# changes, I request that you document them so that I do not get
# credit or blame for your modifications.
#
# Written by Barr3y Jaspan, Student Information Processing Board (SIPB)
# and MIT-Project Athena, 1989.

SRCTOP	= ../../src/dyn++
DESTDIR = /afs/.athena.mit.edu/contrib/sipb
LIBDIR 	= $(DESTDIR)/$(MACHINE)lib
MANDIR	= $(DESTDIR)/man/man3
HDRDIR	= $(DESTDIR)/include

CFLAGS	= -O
DEST	= libDynObject.a
MAN	= DynObject.3
HDR	= DynObject.h

SRCS	= dyn_create.C dyn_put.C dyn_debug.C dyn_delete.C\
	dyn_append.C dyn_realloc.C dyn_paranoid.C dyn_insert.C
OBJS	= dyn_create.o dyn_put.o dyn_debug.o dyn_delete.o\
	dyn_append.o dyn_realloc.o dyn_paranoid.o dyn_insert.o
HDRS	= DynObject.h

$(DEST): $(OBJS)
	rm -f $(DEST)
	ar rc $(DEST) $(OBJS)
	ranlib $(DEST)

all: $(DEST) test

test: $(DEST) test.o
	$(CXX) $(LDFLAGS) -o test test.o $(DEST)

makefile:
	mv Makefile Makefile.bak; cp $(SRCTOP)/Makefile Makefile

depend:
	makedepend -- $(CXXINC) -- $(HDRS) $(SRCS) test.C

install: $(DEST)
	install -c $(HDR) $(HDRDIR)/$(HDR)
	install -c $(DEST) $(LIBDIR)/$(DEST)
	ranlib $(LIBDIR)/$(DEST)
	install -c $(MAN) $(MANDIR)/$(MAN)

clean:
	-rm -f $(OBJS) $(DEST) test.o test *~

$(OBJS): DynObject.h

.C.o:
	$(CXX) -c $(CFLAGS) $*.C

.SUFFIXES: .o .C

# DO NOT DELETE THIS LINE -- make depend depends on it.
