#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.3.2.1 95/10/11 10:01:27 raiff Exp $";
#endif /*_BLURB_*/




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

CFLAGS = $(CFLAGS) 
#-I$(INCLDIR) -I/usr/cs/include -I/usr/include

LIBS =	$(LIBRPC2)\
	$(LIBSE)\
	$(LIBOLDLWP)\
	$(LIBUTIL)

OTHERLIBS = -lsys -lcs 

HEADERS=	admon.h			\
		adsrv.h			\
		$(INCLDIR)/advice.h	\
		$(INCLDIR)/rpc2.h       \
                $(INCLDIR)/se.h         \
		$(INCLDIR)/lwp.h

CFILES= advice_srv.c miss.c mybstree.c

HFILES= advice_srv.h miss.h mybstree.h

AOBJS= advice_srv.o miss.o admon.server.o adsrv.client.o mybstree.o

TCLSCRIPTS= discomiss hoardlist misslist reconnection user_initiated

LFLAGS = -L$(LIBDIR)

all: advice_srv

advice: advice_srv

advice_srv: $(AOBJS)
	$(CC) -o advice_srv $(CFLAGS) $(AOBJS) $(LFLAGS) $(LIBS) $(OTHERLIBS)

advice_srv.o: $(HFILES) $(HEADERS)

miss.o: $(HFILES) $(HEADERS)

admon.server.o: admon.h adsrv.h $(HFILES) $(HEADERS)

adsrv.client.o: adsrv.h admon.h $(HFILES) $(HEADERS)

admon.h admon.server.c admon.client.c: $(ADMON_RPC2) $(RP2GEN)
	$(RP2GEN) -n $(RP2FLAGS) $(ADMON_RPC2)

adsrv.h adsrv.server.c adsrv.client.c: $(ADSRV_RPC2) $(RP2GEN)
	$(RP2GEN) -n $(RP2FLAGS) $(ADSRV_RPC2)

test_bstree.o: test_bstree.h test_bstree.c mybstree.h mybstree.c

test_bstree: test_bstree.o mybstree.o
	$(CC) -o test_bstree $(CFLAGS) test_bstree.o mybstree.o $(LFLAGS) $(LIBS) $(OTHERLIBS)

clean:
	-rm -rf *.o advice_srv admon.client.c admon.server.c adsrv.client.o adsrv.server.c admon.h admon.server.o adsrv.h admon.multi.c adsrv.client.c adsrv.multi.c advice_srv.o

bininstall: advice_srv
	-chmod 0755 ${BINDIR}/advice_srv
	${INSTALL} advice_srv ${BINDIR}

scriptinstall: $(TCLSCRIPTS)
	-chmod 0755 ${SCRIPTDIR}/discomiss
	-chmod 0755 ${SCRIPTDIR}/hoardlist
	-chmod 0755 ${SCRIPTDIR}/misslist
	-chmod 0755 ${SCRIPTDIR}/reconnection
	-chmod 0755 ${SCRIPTDIR}/user_initiated
	${INSTALL} $> ${SCRIPTDIR}

hdrinstall: 

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

install: bininstall scriptinstall hdrinstall srcinstall

