# This file is the Makefile for the zmail system, which consists of
# two programs, zsend.c and zrecv.c.
#
# Written by Barry Jaspan (bjaspan@athena.mit.edu), MIT Project Athena
# and MIT Student Information Processing Boards

CC		= cc
CFLAGS		= -O
SRCDIR		= /mit/sipbsrc/src/zmail
DESTDIR		=
BINDIR		= /usr/sipb/${MACHINE}bin
MANDIR		= /usr/sipb/man
MANSECT		= 1

SENDLIBS	= -lzephyr -lcom_err -lkrb -ldes
RECVLIBS	= 
SENDDEST	= zsend
RECVDEST	= zrecv

all: ${SENDDEST} ${RECVDEST}

${SENDDEST}: zsend.o
	${CC} ${CFLAGS} -o ${SENDDEST} zsend.o ${SENDLIBS}

${RECVDEST}: zrecv.o
	${CC} ${CFLAGS} -o ${RECVDEST} zrecv.o ${RECVLIBS}

install: bin-install man-install
bin-install: send-install recv-install

send-install: ${SENDDEST}
	-mv ${DESTDIR}${BINDIR}/${SENDDEST} \
		${DESTDIR}${BINDIR}/${SENDDEST}.old
	install -c -s ${SENDDEST} ${DESTDIR}${BINDIR}

recv-install: ${RECVDEST}
	-mv ${DESTDIR}${BINDIR}/${RECVDEST} \
		${DESTDIR}${BINDIR}/${RECVDEST}.old
	install -c -s ${RECVDEST} ${DESTDIR}${BINDIR}

man-install:
	-cp zmail.man ${DESTDIR}${MANDIR}/man${MANSECT}/zmail.${MANSECT}
	-cp ${SENDDEST}.man \
		${DESTDIR}${MANDIR}/man${MANSECT}/${SENDDEST}.${MANSECT}
	-cp ${RECVDEST}.man \
		${DESTDIR}${MANDIR}/man${MANSECT}/${RECVDEST}.${MANSECT}

# This system is so simple that right now, no explicit depencies are
# needed.  Makes you wonder why the makefile is so long...  :-)

