OBJS = rstat_svc.o rstat_xdr.o rstat_prog.o
CFLAGS = -O6

# Uncomment this unless RPC functions are in libc
#RPCLIB = -lrpclib

all:	rpc.rstatd librpcsvc.a

install:all
	cp librpcsvc.a /usr/lib
	cp rstat.h /usr/include/rpcsrv
	cp rpc.rstatd /usr/sbin

rpc.rstatd:$(OBJS)
	$(CC) -o $@ $(OBJS) $(RPCLIB)
	strip $@

librpcsvc.a:rstat.o rstat_xdr.o
	ar crv librpcsvc.a rstat.o rstat_xdr.o

rstat.h rstat_clnt.c rstat_svc.c rstat_xdr.c:rstat.x
	rpcgen rstat.x

clean:
	-rm -f rpc.rstatd librpcsvc.a *.o
	-rm -f rstat.h rstat_clnt.c rstat_svc.c rstat_xdr.c
