freebsd-nq/gnu/usr.bin/groff/tmac/Makefile
Ruslan Ermilov 60f6f55742 If the world was built using either -DNOCLEAN or -DNOCLEANDIR, it was
possible to use old generated doc-* files as the source for new ones.
Wrong -mdoc files would then be installed, and man(1) failed with the
following diagnostics:

mdoc error: end-macro (.em) respecification is not allowed. (#41)
            Should this have been `.Em ...'?

Put helper stuff into `beforedepend' to cleanup old files.

Makefile first infected in rev 1.15.

Reported via:	-current
2001-04-23 13:27:35 +00:00

80 lines
2.2 KiB
Makefile

# $FreeBSD$
TMACOWN?= ${BINOWN}
TMACGRP?= ${BINGRP}
TMACMODE?= ${NOBINMODE}
TMACDIR?= ${SHAREDIR}/tmac
MDOCDIR?= ${TMACDIR}/mdoc
MAN= groff_tmac.5
MLINKS+= groff_tmac.5 tmac.5
MAN+= groff_ms.7 groff_man.7 groff_me.7 groff_mdoc.7 groff_mwww.7
MLINKS+= groff_ms.7 ms.7
MLINKS+= groff_man.7 man.7
MLINKS+= groff_me.7 me.7
MLINKS+= groff_mdoc.7 mdoc.7 groff_mdoc.7 mdoc.samples.7
MLINKS+= groff_mwww.7 mwww.7
CLEANFILES= ${MAN} ${MDOCFILES:S/$/-s/} ${STRIPFILES:S/$/-s/} ${SPECIALFILES:S/$/-s/}
NORMALFILES= mandoc.tmac andoc.tmac an-old.tmac \
me.tmac \
mdoc.tmac \
pic.tmac \
a4.tmac \
safer.tmac \
trace.tmac \
ps.tmac psold.tmac pspic.tmac psatk.tmac \
dvi.tmac \
tty.tmac tty-char.tmac latin1.tmac \
X.tmac Xps.tmac \
lj4.tmac \
html.tmac mwww.tmac www.tmac \
eqnrc \
troffrc troffrc-end \
hyphen.us
SPECIALFILES= an.tmac man.tmac s.tmac ms.tmac
STRIPFILES= e.tmac doc.tmac mdoc.local
MDOCFILES= doc-common doc-ditroff doc-nroff doc-syms koi8-r
all: ${MDOCFILES:S/$/-s/} ${STRIPFILES:S/$/-s/} ${SPECIALFILES:S/$/-s/}
.for f in ${MDOCFILES} ${STRIPFILES}
$f-s: $f
sed -f ${DIST_DIR}/strip.sed ${.ALLSRC} > ${.TARGET}
.endfor
.for f in ${SPECIALFILES}
$f-s: $f
sed -e "s;@TMAC_AN_PREFIX@;${tmac_an_prefix};g" \
-e "s;@TMAC_S_PREFIX@;${tmac_s_prefix};g" \
${.ALLSRC} > ${.TARGET}
.endfor
beforeinstall:
cd ${DIST_DIR}; \
${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
${NORMALFILES} ${DESTDIR}${TMACDIR}
cd ${.CURDIR}; \
${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
hyphen.us-ru ${DESTDIR}${TMACDIR}
cd ${.OBJDIR}
.for f in ${STRIPFILES} ${SPECIALFILES}
${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
$f-s ${DESTDIR}${TMACDIR}/$f
.endfor
.for f in ${MDOCFILES}
${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
$f-s ${DESTDIR}${MDOCDIR}/$f
.endfor
.if !exists(${DESTDIR}${TMACDIR}/man.local)
${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
${DIST_DIR}/man.local ${DESTDIR}${TMACDIR}
.endif
# XXX - Make sure we don't use old generated files as sources.
beforedepend:
rm -f doc-common doc-ditroff doc-nroff doc-syms
.include <bsd.prog.mk>