.include <postgres.global.mk>

.MAIN: all

.SUFFIXES: .cat .ps .me

# POSTDOCDIR from ../Makefile.global
PG_DOCDIR=${POSTDOCDIR}

DOCSRCS= manual.me postgres-setup.me release4.1.me

NROFF=nroff

GROFF=groff -spt

DOCOBJS= ${DOCSRCS:S/.me/.cat/g} ${DOCSRCS:S/.me/.ps/g}

.me.cat:
	${GROFF} -me -Tascii ${.IMPSRC} > ${.TARGET}

.me.ps:
	${GROFF} -me -Tps ${.IMPSRC} > ${.TARGET}

all: ${DOCOBJS}

CLEANFILES+= *.cat *.ps

install: ${DOCOBJS} all
	@-if [ ! -d ${PG_DOCDIR} ]; then \
		mkdir ${PG_DOCDIR}; \
	fi
	for i in ${DOCOBJS}; do \
		install -m 444 $$i ${PG_DOCDIR}/$$i; \
	done; \


.include <postgres.prog.mk>
