#
# Makefile for the finger distribution.
# Written by Keith Gabryelski
# Released into public domain September 1, 1988.
# Please keep this header.
#

SHELL=/bin/sh
BINDIR=/u/local/bin
MANDIR=/usr/man/man.LOCAL
LIBDIR=/usr/lib/finger
DBASEDIR=/usr/lib/finger/dbase
NOVICEDIR=/usr/lib/finger/watson
CFLAGS= -g

all: finger ttyloc inquire bwiz

#
# finger - (linked to `whois').  Show users on system and some stats.
#
finger:	finger.o ttyrots.o rots.o inqrots.o
	cc $(CFLAGS) finger.o ttyrots.o rots.o inqrots.o -o finger

#
# ttyloc - Get or set a tty location.
#
ttyloc:	ttyloc.o ttyrots.o rots.o ttyloc.h defs.h
	cc $(CFLAGS) ttyloc.o ttyrots.o rots.o -o ttyloc

#
# inquire - get or set user information.
#
inquire:	inquire.o inqrots.o rots.o
	cc $(CFLAGS) inquire.o inqrots.o rots.o -o inquire

#
# bwiz - The birthday wizard.  Run once a night and wait for
#        the birthday card.
bwiz:	bwiz.o inqrots.o rots.o
	cc $(CFLAGS) bwiz.o inqrots.o rots.o -o bwiz

shar:
	shar README Makefile finger.c rots.c dbase.h bwiz.c  >finger.shar.1
	shar finger.h ttyloc.c ttyrots.c ttyloc.h doc novice >finger.shar.2
	shar watson birthday_card defs.h inquire.c inqrots.c >finger.shar.3

install:
	-mkdir $(LIBDIR)
	-mkdir $(DBASEDIR)
	chmod 777 $(DBASEDIR)
	cp finger ttyloc bwiz inquire $(BINDIR)
	cp birthday_card $(LIBDIR)
	chown root $(BINDIR)/finger
	chown bin $(BINDIR)/ttyloc
	chmod 4711 $(BINDIR)/finger $(BINDIR)/ttyloc
	-ln $(BINDIR)/finger $(BINDIR)/whois
	-mkdir $(NOVICEDIR)
	cp novice/* $(NOVICEDIR)
	chmod 755 $(NOVICEDIR)
	chmod 644 $(NOVICEDIR)/*

clean:
	rm -f *.o finger ttyloc bwiz inquire

finger.o:	finger.c
ttyloc.o:	ttyloc.c
ttyrots.o:	ttyrots.c
rots.o:	rots.c
inquire.o:	inquire.c
watrots.o:	watrots.c
bwiz.o:	bwiz.c
finger.c:	finger.h defs.h
ttyloc.c:	ttyloc.h defs.h
ttyrots.c:	ttyloc.h defs.h
bwiz.c:	defs.h finger.h
finger.h:	ttyloc.h dbase.h
