#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.1.1 95/10/11 10:22:20 raiff Exp $";
#endif /*_BLURB_*/

#/*
#
#                         IBM COPYRIGHT NOTICE
#
#                          Copyright (C) 1986
#             International Business Machines Corporation
#                         All Rights Reserved
#
#This  file  contains  some  code identical to or derived from the 1986
#version of the Andrew File System ("AFS"), which is owned by  the  IBM
#Corporation.    This  code is provded "AS IS" and IBM does not warrant
#that it is free of infringement of  any  intellectual  rights  of  any
#third  party.    IBM  disclaims  liability of any kind for any damages
#whatsoever resulting directly or indirectly from use of this  software
#or  of  any  derivative work.  Carnegie Mellon University has obtained
#permission to distribute this code, which is based on Version 2 of AFS
#and  does  not  contain the features and enhancements that are part of
#Version 3 of AFS.  Version 3 of  AFS  is  commercially  available  and
#supported by Transarc Corporation, Pittsburgh, PA.
#
#*/



CC = $(CC?$(CC):CC)
CPP = /usr/cs/lib/cpp
PLAINC = $(PLAINC?$(PLAINC):/usr/cs/bin/cc)
# Multiversion definitions
CFLAGS = $(CFLAGS)

# Files of interest

# Original Definition of OBJECTS.  timing_paths.c & timing_clock.c, dtcdiv.s  don't compile under cc
# I removed it from this list so that we can find bugs with the C++ compiler
#OBJECTS = util.o olist.o ohash.o dlist.o dhash.o bstree.o dict.o process.o \
#histo.o timing_clock.o dtcdiv.o timing_paths.o \
#rvmlib.o rec_olist.o rec_smolist.o rec_ohash.o rec_dlist.o rec_dhash.o rec_bstree.o

OBJECTS = util.o olist.o ohash.o dlist.o dhash.o bstree.o dict.o process.o \
histo.o  \
rvmlib.o rec_olist.o rec_smolist.o rec_ohash.o rec_dlist.o rec_dhash.o rec_bstree.o \
bitmap.o vmindex.o arrlist.o recvarl.o rvmtesting.o

SOURCES = util.c olist.c ohash.c dlist.c dhash.c bstree.c dict.c process.c \
histo.c  timing_paths.c freeclock.c \
rvmlib.c rec_olist.c rec_smolist.c rec_ohash.c rec_dlist.c rec_dhash.c rec_bstree.c \
vmindex.c bitmap.c arrlist.c recvarl.c rvmtesting.c

HEADERS = util.h olist.h ohash.h dlist.h dhash.h bstree.h dict.h process.h \
histo.h dtcreg.h timing_paths.h \
rvmlib.h rec_olist.h rec_smolist.h rec_ohash.h rec_dlist.h rec_dhash.h rec_bstree.h \
vmindex.h bitmap.h arrlist.h recvarl.h rvmtesting.h


#all:	libutil.a freeclock 
# freeclock fails to compile; check with Gowthami (Satya 12/20/91)

all:	libutil.a

libutil.a: ${OBJECTS} 
	ar rv libutil.a ${OBJECTS}
	ranlib libutil.a

util.o: util.c util.h
	$(CC) ${CFLAGS} -c util.c

olist.o: olist.c olist.h
	$(CC) ${CFLAGS} -c olist.c

ohash.o: ohash.c ohash.h
	$(CC) $(CFLAGS) -c ohash.c

dlist.o: dlist.c dlist.h
	$(CC) $(CFLAGS) -c dlist.c 

dhash.o: dhash.c dhash.h
	$(CC) $(CFLAGS) -c dhash.c

bstree.o: bstree.c bstree.h
	$(CC) $(CFLAGS) -c bstree.c

dict.o: dict.c dict.h
	$(CC) $(CFLAGS) -c dict.c

rvmlib.o: rvmlib.c rvmlib.h
	$(CC) ${CFLAGS} -c rvmlib.c

vmindex.o: vmindex.c vmindex.h 
	$(CC) ${CFLAGS} -c vmindex.c

bitmap.o: bitmap.c bitmap.h 
	$(CC) ${CFLAGS} -c bitmap.c

arrlist.o: arrlist.c arrlist.h
	$(CC) ${CFLAGS} -c arrlist.c

rec_olist.o: rec_olist.c rec_olist.h
	$(CC) ${CFLAGS} -c rec_olist.c

rec_smolist.o: rec_smolist.c rec_smolist.h
	$(CC) ${CFLAGS} -c rec_smolist.c

rec_ohash.o: rec_ohash.c rec_ohash.h
	$(CC) $(CFLAGS) -c rec_ohash.c

rec_dlist.o: rec_dlist.c rec_dlist.h
	$(CC) ${CFLAGS} -c rec_dlist.c

recvarl.o: recvarl.c recvarl.h
	$(CC) ${CFLAGS} -c recvarl.c 

rec_dhash.o: rec_dhash.c rec_dhash.h
	$(CC) $(CFLAGS) -c rec_dhash.c

rec_bstree.o: rec_bstree.c rec_bstree.h
	$(CC) $(CFLAGS) -c rec_bstree.c

process.o: process.c process.h
	$(CC) $(CFLAGS) -c process.c

timing_clock.o: timing_clock.c dtcreg.h
	$(PLAINC) ${CFLAGS} -c timing_clock.c 

timing_paths.o:  timing_paths.c timing_paths.h
	$(PLAINC) -g $(INCLFLAGS) -c timing_paths.c

dtcdiv.o: dtcdiv.s
	$(CPP) -I${INCLDIR} -P dtcdiv.s > t.dtcdiv.s
	$(PLAINC) ${CFLAGS} -c t.dtcdiv.s
	mv t.dtcdiv.o dtcdiv.o
	rm -f t.dtcdiv.s

freeclock: freeclock.c
	$(CC) $(CFLAGS) -o freeclock freeclock.c

# The  following file (histo.o) MUST NOT be compiled
# with C++.  A double to int conversion bug in the C++ compiler causes
# serious runtime errors.

histo.o: histo.c histo.h
	$(PLAINC) $(CFLAGS) -c histo.c

clean:
	-rm -f *.o *.a




libinstall: all
	-chmod 0644 $(LIBUTIL)
	$(INSTALL) libutil.a $(LIBUTIL)
#	$(INSTALL) freeclock  $(BINDIR)
# freeclock fails to compile; check with Gowthami (Satya 12/20/91)
#	-chmod 0644 $(LIBUTIL) $(BINDIR)/freeclock
#	$(INSTALL)  $(BINDIR)

hdrinstall: $(HEADERS)
	-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
