srcdir = @srcdir@
VPATH = @srcdir@
@SET_MAKE@

#prefix=		@prefix@
MANDIR=		$(prefix)@MANDIR@
TOPDIR=		..
S=		$(TOPDIR)/$(srcdir)/man
INSTALL=	@INSTALL@

MAN1=	mailq.1 mailrm.1 newaliases.1 rmail.1 ssl.1 vacation.1 zmailer.1 zmsh.1 mboxpath.1
MAN3=	zmailer.3
MAN5=	aliases.5
MAN8=	errormail.8 hold.8 router.8 scheduler.8 sendmail.8 sm.8 smtp.8 smtpserver.8 manual-expirer.8 expirer.8 mprobe.8 mailbox.8

MAN1ps=	mailq.1.ps mailrm.1.ps newaliases.1.ps rmail.1.ps ssl.1.ps vacation.1.ps zmailer.1.ps zmsh.1.ps mboxpath.1.ps
MAN3ps=	zmailer.3.ps
MAN5ps= aliases.5.ps
MAN8ps=	errormail.8.ps hold.8.ps router.8.ps scheduler.8.ps sendmail.8.ps sm.8.ps smtp.8.ps smtpserver.8.ps manual-expirer.8.ps expirer.8.ps mprobe.8.ps mailbox.8.ps

FRC:
	@echo "make install MANDIR=/usr/man"
	@echo "make groff"
	@echo "make clean"

clean:
	rm -rf *~

distclean:
	rm -rf *~ vacation.1

install:
	$(INSTALL) -m 644 $S/aliases.5	${MANDIR}/man5
	$(INSTALL) -m 644 $S/errormail.8 ${MANDIR}/man8
	$(INSTALL) -m 644 $S/hold.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/mailbox.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/mailq.1	${MANDIR}/man1
	$(INSTALL) -m 644 $S/mboxpath.1	${MANDIR}/man1
	$(INSTALL) -m 644 $S/mailrm.1	${MANDIR}/man1
	$(INSTALL) -m 644 $S/newaliases.1 ${MANDIR}/man1
	$(INSTALL) -m 644 $S/rmail.1	${MANDIR}/man1
	$(INSTALL) -m 644 $S/router.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/scheduler.8 ${MANDIR}/man8
	$(INSTALL) -m 644 $S/sendmail.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/sm.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/smtp.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/smtpserver.8 ${MANDIR}/man8
	$(INSTALL) -m 644 $S/mprobe.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/ssl.1	${MANDIR}/man1
	$(INSTALL) -m 644 $S/zmailer.1	${MANDIR}/man1
	$(INSTALL) -m 644 $S/zmailer.3	${MANDIR}/man3
	$(INSTALL) -m 644 $S/manual-expirer.8 ${MANDIR}/man8
	$(INSTALL) -m 644 $S/expirer.8	${MANDIR}/man8
	$(INSTALL) -m 644 $S/zmsh.1	${MANDIR}/man1
	$(INSTALL) -m 644 vacation.1	${MANDIR}/man1

groff: $(MAN1ps) $(MAN3ps) $(MAN5ps) $(MAN8ps)

aliases.5.ps: aliases.5
	groff -man aliases.5 > aliases.5.ps
mailq.1.ps: mailq.1
	groff -man mailq.1 > mailq.1.ps
mailrm.1.ps: mailrm.1
	groff -man mailrm.1 > mailrm.1.ps
newaliases.1.ps: newaliases.1
	groff -man newaliases.1 > newaliases.1.ps
rmail.1.ps: rmail.1
	groff -man rmail.1 > rmail.1.ps
ssl.1.ps: ssl.1
	groff -man ssl.1 > ssl.1.ps
vacation.1.ps: vacation.1
	groff -man vacation.1 > vacation.1.ps
zmailer.1.ps: zmailer.1
	groff -man zmailer.1 > zmailer.1.ps
zmsh.1.ps: zmsh.1
	groff -man zmsh.1 > zmsh.1.ps
zmailer.3.ps: zmailer.3
	groff -man zmailer.3 > zmailer.3.ps
errormail.8.ps: errormail.8
	groff -man errormail.8 > errormail.8.ps
hold.8.ps: hold.8
	groff -man hold.8 > hold.8.ps
router.8.ps: router.8
	groff -man router.8 > router.8.ps
scheduler.8.ps: scheduler.8
	groff -man scheduler.8 > scheduler.8.ps
sendmail.8.ps: sendmail.8
	groff -man sendmail.8 > sendmail.8.ps
sm.8.ps: sm.8
	groff -man sm.8 > sm.8.ps
smtp.8.ps: smtp.8
	groff -man smtp.8 > smtp.8.ps
smtpserver.8.ps: smtpserver.8
	groff -man smtpserver.8 > smtpserver.8.ps
manual-expirer.8.ps: manual-expirer.8
	groff -man manual-expirer.8 > manual-expirer.8.ps
expirer.8.ps: expirer.8
	groff -man expirer.8 > expirer.8.ps
mprobe.8.ps: mprobe.8
	groff -man mprobe.8 > mprobe.8.ps
mailbox.8.ps: mailbox.8
	groff -man mailbox.8 > mailbox.8.ps
mboxpath.1.ps: mboxpath.1
	groff -man mboxpath.1 > mboxpath.1.ps
