#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:03:19 raiff Exp $";
#endif /*_BLURB_*/

#/* 
# * Mach Operating System
# * Copyright (c) 1990 Carnegie-Mellon University
# * Copyright (c) 1989 Carnegie-Mellon University
# * All rights reserved.  The CMU software License Agreement specifies
# * the terms and conditions for use and redistribution.
# */
#
#/*
# * This code was written for the Coda file system at Carnegie Mellon University.
# * Contributers include David Steere, James Kistler, and M. Satyanarayanan.
# */

#
# TODO: Update header dependencies
#

# Which C compiler to use
CC = $(CC?$(CC):CC)
PLAINC = $(PLAINC?$(PLAINC):cc)
RP2GEN= ${BINDIR}/rp2gen

CFLAGS= $(CFLAGS) -I$(KERNELDIR)

# Identify files of interest

HFILES = cfs.h cnode.h cfs_opstats.h cfsio.h
CFILES = cfsmount.c cfsunmount.c pioctl.c cfsncstat.c

all: pioctl.o cfsmount cfsunmount cfsncstat

cfsmount: cfsmount.c
	$(PLAINC) $(CFLAGS) -o cfsmount cfsmount.c

cfsunmount: cfsunmount.c
	$(PLAINC) $(CFLAGS) -o cfsunmount cfsunmount.c

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

cfsncstat: cfsncstat.c
	$(PLAINC) $(CFLAGS) -o cfsncstat cfsncstat.c

clean:
	-rm -rf *.o cfsmount cfsunmount cfsncstat

#------------- Installation----------------
libinstall: all
	-cd $(LIBDIR); chmod 0644 pioctl.o 
	${INSTALL} pioctl.o $(PIOCTL_O)
	-cd $(BINDIR); chmod 0755 cfsmount cfsunmount cfsncstat
	${INSTALL} cfsmount cfsunmount cfsncstat ${BINDIR}


hdrinstall: ${HFILES}
	-mkdir ${INCLDIR}/cfs
	-chmod 0644 ${INCLDIR}/cfs/*
	${INSTALL} $> ${INCLDIR}/cfs

#dtcheaders: dtcreg.h dtc.h
#	-chmod 0644 ${INCLDIR}/cfs/*
#	${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 # dtcheaders /* skip dtcheaders for now */
