#  
#  $Id: Makefile,v 1.8 91/04/05 19:52:31 qjb Exp $
#  $Source: /afs/athena.mit.edu/astaff/project/qrpc/src/RCS/Makefile,v $
#  $Author: qjb $
#
#  This is the makefile for libqrpc
#

QRPC		= /mit/qrpc
DESTDIR		= $(QRPC)/install
INSTALLDIR	= /usr/athena/lib
SRCDIR		= $(QRPC)/src

INCLUDES	= -I.
DFLAGS		= -O
CFLAGS 		= $(DFLAGS) $(INCLUDES)
RANLIB		= ranlib

CSRCS		= packet.c util.c krb.c qrpc.c
ALLSRCS		= $(CSRCS) qrpc_err.et Makefile qrpc.h \
			qrpc_private.h internal_opcodes.h
OBJS		= packet.o util.o krb.o qrpc.o qrpc_err.o

all: libqrpc.a

ps2:
	make CC="cc -q" RANLIB="echo > /dev/null" $(CMD)

mac: 
	make RANLIB="echo > /dev/null" $(CMD)

config: 
	for i in $(ALLSRCS); do \
		rm -f $$i; \
		ln -s $(SRCDIR)/$$i $$i; \
	done

libqrpc.a: $(OBJS)
	-rm -f libqrpc.a
	ar cru libqrpc.a $(OBJS)
	$(RANLIB) libqrpc.a

saber: qrpc_err.h 
	#load ${CFLAGS} ${CSRCS} qrpc_err.c

$(CSRCS): qrpc_err.h

qrpc_err.h qrpc_err.c: qrpc_err.et
	compile_et qrpc_err.et

depend: qrpc_err.h
	makedepend $(CFLAGS) $(CSRCS)

install:
	install -c libqrpc.a $(DESTDIR)$(INSTALLDIR)/libqrpc.a

clean:
	rm -f core *.o *~ *.bak qrpc_err.h qrpc_err.c libqrpc.a

# DO NOT DELETE THIS LINE -- make depend depends on it.
