#
# Makefile for spray RPC client and server.
# Copyright 1994, Olaf Kirch, <okir@monad.swb.de>
#
# HAVE_USLEEP		If you have the usleep() function. If
#			you don't, then usleep() is simulated using
#			select(2).
#
DEFINES	= -DHAVE_USLEEP
CFLAGS	= $(DEFINES) -Wall -O2

all: sprayd spray

sprayd:	sprayd.o spraystat.o spray_xdr.o
spray:	spray.o  spray_xdr.o

install: spray sprayd
	install -o bin -g bin -m 755 -s sprayd /usr/sbin/rpc.sprayd
	install -o bin -g bin -m 755 -s spray  /usr/sbin/spray
	@echo "To install the manpages, please run make install-man"

install-man:
	install -o bin -g bin -m 644 spray.8 sprayd.8 /usr/man/man8
	cd /usr/man/man8 && ln -sf sprayd.8 rpc.sprayd.8

clean realclean::
	rm -f core *.o

realclean::
	rm -f spray sprayd

spraystat.o:	spraystat.c spraystat.h spray.h
sprayd.o:	sprayd.c spraystat.h spray.h
spray_xdr.o:	spray_xdr.c spray.h
spray.o:	spray.c spray.h
