# 
#   Makefile for phoned            20 December 1985
#


# What the flags mean:
#  INETD    - set this if the phoned is to run a a single-threaded service
#             under /etc/inetd. It expects for fd 0 to be a datagram socket
#             bound to the service address that it wil receive from.
#  FORK     - set this when *not* under inetd if you want to server to
#             fork upon startup, with the parent exiting. This is usually
#             set, and does nothing if INETD is also defined.
#  DPATH    - the full pathanme of the conversation daemon. If phoned
#             cannot find it here, it will try to find "convd" in 
#             /usr/local/lib, /usr/lib, and /etc.
#  SERVICES - set this if phone is listed as a datagram service in 
#             /etc/services. This has no effect under the inetd.
#  PORT     - if INETD and SERVICES are not defined, this is the port 
#             number to listen on (overriding the default in ../common.h)
#  NO_WHO	- Define this if you want your site to be "secure" and not allow
#             outside users to use the "who" command to see who's on ...

#CFLAGS = -O -DDPATH=\"/usr/local/lib/convd\"
CFLAGS  = -O -DINETD -DDPATH=\"/usr/local/lib/convd\"

LPR     = lpr -Pvax

HDRS	= defs.h ../common.h
SRCS	= child.c daemon.c dopage.c forward_program.c\
			inquire.c list.c main.c page.c pagetty.c\
			reinvite.c strsave.c utmp.c

OBJS	= child.o daemon.o dopage.o forward_program.c\
			inquire.o list.o main.o page.o pagetty.o\
			reinvite.o strsave.o utmp.o

DEST	= phoned
RDEST	= /etc/phoned


.DEFAULT:
	co $<

all:	${DEST}

${DEST}: ${OBJS}
	/bin/rm -f ${DEST}
	cc ${CFLAGS} -o ${DEST} ${OBJS}

${OBJS}: ${HDRS}

install:	${DEST}
	/bin/rm -f ${RDEST}
	cp ${DEST} ${RDEST}

clean:
	/bin/rm -f ${DEST} core *.o

print:	${HDRS} ${SRCS}
	pr -f ${HDRS} ${SRCS} | expand -4 | ${LPR}

tags: /dev/null
	ctags -w ${HDRS} ${SRCS}

lint: ${HDRS} ${SRCS}
	lint ${SRCS} > lint.out

shar:	Makefile ${HDRS} ${SRCS}
	shar -v Makefile ${HDRS} ${SRCS} > ../shar.master

dist:	${DEST}
	-rcp ${DEST} buddy:${RDEST}
	-rcp ${DEST} franny:${RDEST}
	-rcp ${DEST} holden:${RDEST}
	-rcp ${DEST} seymour:${RDEST}
	-rcp ${DEST} zooey:${RDEST}
	-rcp ${DEST} cory:${RDEST}
	-rcp ${DEST} miro:${RDEST}


depend: ${SRCS}
	mv Makefile makefile.old
	sed '/^# Dependencies follow/,$$d' makefile.old > Makefile
	echo '# Dependencies follow' >> Makefile
	includes -so ${SRCS} >> Makefile
	echo ' ' >> Makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	echo '# see depend: above' >> Makefile

# DO NOT DELETE THE FOLLOWING LINE
# Dependencies follow

utmp.o: /usr/include/utmp.h

utmp.o pagetty.o: /usr/include/sys/file.h

page.o main.o: /usr/include/netdb.h

main.o list.o: /usr/include/signal.h

pagetty.o page.o list.o: /usr/include/time.h

pagetty.o page.o list.o: /usr/include/sys/time.h

page.o forward_program.o: /usr/include/pwd.h

utmp.o dopage.o: /usr/include/sys/stat.h

pagetty.o main.o daemon.o: /usr/include/syslog.h

child.o: /usr/include/sys/wait.h

utmp.o reinvite.o pagetty.o page.o main.o list.o inquire.o forward_program.o \
dopage.o daemon.o child.o: /usr/include/errno.h

utmp.o reinvite.o pagetty.o pagetty.o page.o main.o main.o list.o list.o \
inquire.o forward_program.o dopage.o daemon.o daemon.o child.o: \
/usr/include/stdio.h

utmp.o reinvite.o pagetty.o page.o main.o list.o inquire.o forward_program.o \
dopage.o daemon.o child.o: /usr/include/netinet/in.h

utmp.o reinvite.o pagetty.o page.o main.o list.o inquire.o forward_program.o \
dopage.o daemon.o child.o: /usr/include/sys/socket.h

utmp.o reinvite.o pagetty.o page.o main.o list.o inquire.o forward_program.o \
dopage.o daemon.o child.o: /usr/include/sys/types.h

utmp.o reinvite.o pagetty.o page.o main.o list.o inquire.o forward_program.o \
dopage.o daemon.o child.o: ./defs.h

utmp.o reinvite.o pagetty.o page.o main.o list.o inquire.o dopage.o daemon.o \
child.o: ./../common.h
 
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see depend: above
