#      $Id: Makefile,v 1.25 1999/07/05 02:46:20 hoek Exp $
#
# Japanized by
# Copyright (c) KUMANO, Tadashi <kumano@jp.freebsd.org>, 1996-1999,
# Copyright (c) FreeBSD jp-man project <man-jp@jp.freebsd.org>, 1996-1998,
# which is a study toward the multilingual enhancement.
# (version 1.1h 1999/09/03)

PROG=	jman
SRCS=	man.c manpath.c glob.c
MAN1=	jman.1
EMAN1=	jman.1.eng.gz
BINOWN= man
BINMODE=4555
.if !defined(NOFSCHG)
INSTALLFLAGS+= -fschg
.endif

CFLAGS+= -I${LIBDESTDIR}
DPADD=	${LIBMAN}
LDADD=	${LIBMAN}
LDADD+= -L/usr/lib -lxpg4

DPADD+=  ${MAN1} ${EMAN1}

CFLAGS+= -I${.CURDIR}/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF
CFLAGS+= -DDO_COMPRESS -DALT_SYSTEMS -DSETREUID -DCATMODE=0644
CFLAGS+= -DLOCALE
CLEANFILES+=	${MAN1} ${EMAN1} ${EMAN1}${compext}
MANDEPEND+=	${MAN1}

.PATH: ${.CURDIR}/../manpath

${MAN1}: ${.CURDIR}/jman.man
	@${ECHO} echo Making ${.TARGET:T} from ${.ALLSRC:T}; \
	sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
	    -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
	    -e 's,%manpath_config_file%,${manpath_config_file},' \
	    -e 's,%compress%,${compress},' \
	${.CURDIR}/jman.man > ${MAN1}

${EMAN1}: ${.CURDIR}/jman.man.eng
	@${ECHO} echo Making ${.TARGET:T} from ${.ALLSRC:T}; \
	sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
	    -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
	    -e 's,%manpath_config_file%,${manpath_config_file},' \
	    -e 's,%compress%,${compress},' \
	${.CURDIR}/jman.man.eng | \
	${compress} > ${EMAN1}

.if !defined(NOMAN)
afterinstall: ${EMAN1}
	${INSTALL} -c -o bin -g bin -m 444 ${EMAN1} \
	    ${DESTDIR}${EMANDIR}1/jman.1.gz
.else
afterinstall:
.endif

.include "../Makefile.inc"

.include <bsd.prog.mk>
