.if exists(${.CURDIR}/obj)
MAN1=  ${.CURDIR}/obj/jmakewhatis.1
TARG=  ${.CURDIR}/obj/jmakewhatis
.else
MAN1=  ${.CURDIR}/jmakewhatis.1
TARG=  ${.CURDIR}/jmakewhatis
.endif

MANDEPEND=	${MAN1}

CLEANFILES+=	${TARG} ${MAN1}

all:	${TARG} ${MAN1}

depend rcsfreeze tags all:
	@echo -n

${TARG}: ${.CURDIR}/makewhatis.perl
	sed -e 's,#zcat#,${zcat},' \
	${.CURDIR}/makewhatis.perl > ${.TARGET}
	chmod 755 ${.TARGET}

install: ${TARG} maninstall
	install -c -o bin -g bin -m 555 ${TARG} ${DESTDIR}/usr/local/bin

.include "../Makefile.inc"

.if make(maninstall) || make(install)
.if !defined(NOMAN)
.include <bsd.man.mk>
.elif !target(maninstall)
maninstall:
.endif
.endif

.include <bsd.prog.mk>
