# 
#  Copyright (c) 1989 Brian Sturgill
#  All rights reserved.
# 
#  Redistribution and use in source and binary forms are permitted
#  provided that the above copyright notice and this paragraph are
#  duplicated in all such forms and that any documentation,
#  advertising materials, and other materials related to such
#  distribution and use acknowledge that the software was developed
#  by Brian Sturgill and Raphael Finkel at the University of Kentucky,
#  Department of Computer Science.  The names of the University or the
#  authors may not be used to endorse or promote products derived
#  from this software without specific prior written permission.
#  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
#  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#


all: rd
CC = gcc
DESTDIR = /usr/local/bin
MANDIR = /usr/local/man

rd: rd.sal 
	/bin/rm -f rrun
	cp /usr/local/etc/sat/salinclude/stdhostmachelper.c .
	$(CC) -c stdhostmachelper.c
	/bin/rm -f stdhostmachelper.c
	sal -n rd.sal stdhostmachelper.o -o rd
	ln rd rrun

install: $(DESTDIR)/rd

$(DESTDIR)/rd: rd
	install -c -o bin -g bin -m 755 rd $(DESTDIR)/rd
	/bin/rm -f $(DESTDIR)/rrun
	ln $(DESTDIR)/rd $(DESTDIR)/rrun

clean:
	rm -f rd rrun *.o a.out core stdhostmachelper.c

doc:
	cp rd.8 $(MANDIR)/man8/
	cp rrun.8 $(MANDIR)/man8/

lint:
