#	BSDI $Id: Makefile,v 1.4 1993/02/24 06:21:41 polk Exp $

.include "../Makefile.inc"

DOC= ${.CURDIR}/../etc/obj/DOC
TEMACS=	${.CURDIR}/../epoch-src/obj/temacs
LISPFILES= \
	button.el button.elc convert-buttons.el convert-buttons.elc \
	copy.el cute-wins.el dot.emacs epoch-util.el epoch-util.elc \
	epoch.el epoch.elc event.el event.elc files.el files.elc inc-vers.el \
	loaddefs.el loadup.el message.el message.elc mini-cl.el mini-cl.elc \
	motion.el motion.elc mouse.el mouse.elc property.el property.elc \
	save-zones.el scr-pool.el selection.el selection.elc startup.el \
	startup.elc thing.el uglify.el version.el wrapper.el wrapper.elc \
	zone.el zone.elc

CLEANFILES+=epoch
MAN1=	epoch.0

all: 	doc epoch

epoch:	${TEMACS} doc
	(cd ${.CURDIR}; ${TEMACS} -batch -l ${.CURDIR}/loadup.el dump)

doc:	make-docfile ${DOC}
	(cd ${.CURDIR}; ../etc/make-docfile/obj/make-docfile -a ${DOC} *.el)

make-docfile:
	(cd ${.CURDIR}/../etc/make-docfile; make make-docfile)

beforeinstall:
	-@mkdir ${DESTDIR}${BINDIR}
	install -c -s -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		    epoch ${DESTDIR}${BINDIR}
	-@mkdir ${DESTDIR}${ELISPDIR}
	-for i in ${LISPFILES}; do \
		cmp -s ${.CURDIR}/$$i ${DESTDIR}${ELISPDIR}/$$i || \
		install -c -o ${BINOWN} -g ${BINGRP} -m 0444 \
			${.CURDIR}/$$i ${DESTDIR}${ELISPDIR}/$$i; \
	done

.include <bsd.prog.mk>
