#
# Makefile for talk, stoptalk, and the talkdemon
#
# AUTHOR
#	Edward C. Bennett (edward@ukecc)
#
# Copyright 1985 by Edward C. Bennett
#
# Permission is given to alter this code as needed to adapt it to forign
# systems provided that this header is included and that the original
# author's name is preserved.
#

BIN=/usr/bin
DEMONDIR=/etc
#
# /usr/bin/talk needs to run setuid. It doesn't have to be root so make
# this something harmless.
#
OWNER=edward

#
# Use whatever libraries you need to make curses work.
#
LIBS=-lcurses # -lterminfo -ltermcap -ltermlib

all: talk talkdemon infotalk stoptalk

talk: talk.o talk.c
	cc -s talk.o -o talk ${LIBS}

tester: ntalk.c
	cc -DSCHIZO ntalk.c -o tester ${LIBS}

talkdemon: talkd.o talkd.c
	 cc -s talkd.o -o talkdemon

infotalk: infotalk.o infotalk.c
	 cc -s infotalk.o -o infotalk

stoptalk: stoptalk.o stoptalk.c
	 cc -s stoptalk.o -o stoptalk

talk.o: talk.h
	cc -c -O talk.c

talkd.o: talk.h
	cc -c -O talkd.c

infotalk.o: talk.h
	cc -c -O infotalk.c

stoptalk.o: talk.h
	cc -c -O stoptalk.c

install: all
	/etc/install -f ${BIN} talk
	/etc/install -f ${DEMONDIR} talkdemon
	/etc/install -f ${DEMONDIR} stoptalk
	chown ${OWNER} ${BIN}/talk
	chmod 4755 ${BIN}/talk
	chmod 750 ${DEMONDIR}/talkdemon ${DEMONDIR}/stoptalk

clean:
	rm -f *.o talk talkd talkdemon stoptalk

shar:
	shar -v README talk.1 Makefile talk.h talk.c talkd.c infotalk.c stoptalk.c > talk.shar
