srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.pthread

objects = assert.o casestrcpy.o rbtree.o

all: $(TOP_INCDIR)/afs/opr.h \
     $(TOP_INCDIR)/afs/opr_assert.h \
     $(TOP_INCDIR)/opr/jhash.h \
     $(TOP_INCDIR)/opr/queue.h \
     $(TOP_INCDIR)/opr/rbtree.h \
     $(TOP_LIBDIR)/libopr.a

libopr.a: $(objects)
	-$(RM) -f $@
	$(AR) crv $@ $(objects)
	$(RANLIB) $@

$(TOP_LIBDIR)/libopr.a: libopr.a
	$(INSTALL_DATA) libopr.a $@

$(TOP_INCDIR)/afs/opr.h: opr.h
	$(INSTALL_DATA) opr.h $@

$(TOP_INCDIR)/afs/opr_assert.h: opr_assert.h
	$(INSTALL_DATA) opr_assert.h $@

$(TOP_INCDIR)/opr/jhash.h: jhash.h
	$(INSTALL_DATA) jhash.h $@

$(TOP_INCDIR)/opr/queue.h: queue.h
	$(INSTALL_DATA) queue.h $@

$(TOP_INCDIR)/opr/rbtree.h: rbtree.h
	$(INSTALL_DATA) rbtree.h $@

clean:
	rm -f $(objects) libopr.a

install: libopr.a
	$(INSTALL_DATA) libopr.a $(DESTDIR)$(libdir)/libopr.a

dest: libopr.a
	$(INSTALL_DATA) libopr.a $(DEST)/lib/libopr.a

