#
# makefile for Magic documentation
#

MAGICDIR = ../..

MANMACS= tmac.anc
TROFF=ditroff -h
TTROFF=ditroff -Ppsc -t
PSDIT=psdit
GRN=grn -Ppsc
TBL=tbl -Ppsc
EQN=eqn -Ppsc

include ${MAGICDIR}/defs.mak

MANDIRS = ${MANDIR} ${MANDIR}/man1 ${MANDIR}/man5

MANFILES = \
    ${MANDIR}/man1/ext2spice.1 \
    ${MANDIR}/man1/extcheck.1 \
    ${MANDIR}/man1/ext2sim.1 \
    ${MANDIR}/man5/cmap.5 \
    ${MANDIR}/man5/displays.5 \
    ${MANDIR}/man5/dlys.5 \
    ${MANDIR}/man5/sim.5 \
    ${MANDIR}/man5/dstyle.5 \
    ${MANDIR}/man5/ext.5 \
    ${MANDIR}/man5/glyphs.5 \
    ${MANDIR}/man5/magic.5 \
    ${MANDIR}/man5/net.5 \
    ${MANDIR}/man5/sim.5

install: ${MANDIRS} ${MANFILES}

${MANDIRS}: make-man-dirs

make-man-dirs:
	${SCRIPTS}/mkdirs ${MANDIRS}

${MANDIR}/man1/%: % ${MANDIRS}
	${CP} $* ${MANDIR}/man1/$*

${MANDIR}/man5/%: % ${MANDIRS}
	${CP} $* ${MANDIR}/man5/$*

mans:
	${SCRIPTS}/printmans "${TROFF} ${MANMACS} -" *.1 *.5
