# Uncomment your choice of destination
DEST = /usr/sbin
#DEST = /etc

OBJS = rstat_svc.o rstat_xdr.o rstat_prog.o rstat.o
CFLAGS = -O2 -fomit-frame-pointer -DNO_RPC_LIB

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

all:rstatd

install:all
	install -s -o root -g root -m 0755 rstatd ${DEBDIR}$(DEST)/rpc.rstatd

rstatd:$(OBJS)
	$(CC) -o $@ $(OBJS) $(RPCLIB)

rstat.h: rstat.x
	rpcgen -h rstat.x -o $@

rstat_clnt.c : rstat.x
	rpcgen -l rstat.x -o $@

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

rstat_xdr.c: rstat.x
	rpcgen -c rstat.x -o $@


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