#ifndef _BLURB_
#define _BLURB_
#/*
#
#            Coda: an Experimental Distributed File System
#                             Release 3.1
#
#          Copyright (c) 1987-1995 Carnegie Mellon University
#                         All Rights Reserved
#
#Permission  to  use, copy, modify and distribute this software and its
#documentation is hereby granted,  provided  that  both  the  copyright
#notice  and  this  permission  notice  appear  in  all  copies  of the
#software, derivative works or  modified  versions,  and  any  portions
#thereof, and that both notices appear in supporting documentation, and
#that credit is given to Carnegie Mellon University  in  all  documents
#and publicity pertaining to direct or indirect use of this code or its
#derivatives.
#
#CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS  KNOWN  TO  HAVE  BUGS,
#SOME  OF  WHICH MAY HAVE SERIOUS CONSEQUENCES.  CARNEGIE MELLON ALLOWS
#FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.   CARNEGIE  MELLON
#DISCLAIMS  ANY  LIABILITY  OF  ANY  KIND  FOR  ANY  DAMAGES WHATSOEVER
#RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE  OR  OF
#ANY DERIVATIVE WORK.
#
#Carnegie  Mellon  encourages  users  of  this  software  to return any
#improvements or extensions that  they  make,  and  to  grant  Carnegie
#Mellon the rights to redistribute these changes without encumbrance.
#*/
#
#static char *rcsid = "$Header: Makefile,v 3.2.2.1 95/10/11 10:11:16 raiff Exp $";
#endif /*_BLURB_*/






# Which C compiler to use
CC = $(CC?$(CC):CC)


RESLIBOBJS=logalloc.o pdlist.o remotelog.o resclient.o lockqueue.o\
           rescoord.o  resforce.o reslock.o reslog.o \
           resutil.o rescomm.o timing.o\
	   res.server.o res.client.o res.multi.o weres.o 

CFILES=logalloc.c pdlist.c remotelog.c resclient.c rescomm.c rescoord.c \
       resforce.c reslock.c reslog.c \
	resutil.c lockqueue.c timing.c weres.c 

HFILES=res.h  rescomm.h logalloc.h pdlist.h remotelog.h resforce.h \
       reslog.h resutil.h lockqueue.h timing.h


all: libreslib.a

${RESLIBOBJS}: ${HFILES}

libreslib.a:	${RESLIBOBJS}
	ar rv libreslib.a $?
	ranlib libreslib.a

# Test programs
resc: resc.o  vice.client.o callback.server.o ${PIOCTL_O}
	$(CC) -o resc resc.o\
	vice.client.o callback.server.o\
	${PIOCTL_O} ${LIBRPC2} ${LIBOLDLWP}

testpdlist: testpdlist.o pdlist.o logalloc.o 
	$(CC) -o testpdlist testpdlist.o\
	logalloc.o pdlist.o ${LIBUTIL}

test: test.o logalloc.o
	$(CC) -o test test.o logalloc.o ${LIBUTIL}

timetest: timetest.o timing.o 
	$(CC) -o timetest timetest.o timing.o ${LIBUTIL}


# Objects for libreslib.a
pdlist.o: logalloc.h 

vice.h vice.client.c: $(VICE_RPC2)
	${RP2GEN} ${RP2FLAGS} -n $(VICE_RPC2)

callback.h callback.server.c: $(CALLBACK_RPC2)
	$(RP2GEN) ${RP2FLAGS} -n $(CALLBACK_RPC2)

resc.o: vice.h callback.h

res.h res.server.c res.client.c res.multi.c : $(RES_RPC2) ${RP2GEN}
	${RP2GEN} -n ${RP2FLAGS} $(RES_RPC2)

reslog.o: logalloc.h

clean:
	rm -f *.o *.client.c *.server.c resc

# Installation
libinstall: all
	-chmod 0644  $(LIBRESLIB)
	$(INSTALL) libreslib.a $(LIBRESLIB)

hdrinstall: ${HFILES}
	-chmod 0644 $(INCLDIR)/*
	for F in ${INCLSUBS}; do chmod 0755 "$$F"; done
	${INSTALL} $> ${INCLDIR}

srcinstall:
# Manually setenv SUPPRESS_ALPHACI if you want to suppress the RCS checkin by alphaci
	SRCDIR=$(SRCDIR); export SRCDIR; $(ALPHACI)

install: libinstall hdrinstall srcinstall

