ef00418817d3e9165b240f016d376472871afbe1
[dragonfly.git] / gnu / usr.bin / groff / tmac / Makefile
1 # $FreeBSD: src/gnu/usr.bin/groff/tmac/Makefile,v 1.42 2003/09/08 17:46:33 ru Exp $
2 # $DragonFly: src/gnu/usr.bin/groff/tmac/Makefile,v 1.4 2005/09/09 14:11:04 asmodai Exp $
3
4 .include "../Makefile.inc"
5
6 TMACOWN?=       ${BINOWN}
7 TMACGRP?=       ${BINGRP}
8 TMACMODE?=      ${NOBINMODE}
9 TMACDIR?=       ${SHAREDIR}/tmac
10 MDOCDIR?=       ${TMACDIR}/mdoc
11
12 MAN=            groff_ms.7 groff_man.7 groff_me.7 groff_mdoc.7
13 MAN+=           groff_trace.7 groff_www.7
14 MLINKS=         groff_ms.7 ms.7
15 MLINKS+=        groff_man.7 man.7
16 MLINKS+=        groff_me.7 me.7
17 MLINKS+=        groff_mdoc.7 mdoc.7 groff_mdoc.7 mdoc.samples.7
18
19 PATCHES!=       echo ${.CURDIR}/patches/*.patch
20 CONTRIBDIR=     ${DIST_DIR}
21
22 SRCS=           ${PATCHES}
23 CLEANFILES=     ${MAN} ${MDOCFILES:S/$/-s/} ${STRIPFILES:S/$/-s/} ${SPECIALFILES:S/$/-s/} ${NORMALFILES:S/$/-s/}
24
25 NORMALFILES=    mandoc.tmac andoc.tmac an-old.tmac \
26                 me.tmac \
27                 mdoc.tmac \
28                 pic.tmac \
29                 a4.tmac \
30                 papersize.tmac \
31                 ec.tmac \
32                 safer.tmac \
33                 trace.tmac \
34                 ps.tmac psold.tmac pspic.tmac psatk.tmac \
35                 dvi.tmac \
36                 tty.tmac tty-char.tmac \
37                 latin1.tmac latin2.tmac latin5.tmac latin9.tmac cp1047.tmac \
38                 unicode.tmac \
39                 X.tmac Xps.tmac \
40                 lj4.tmac \
41                 lbp.tmac \
42                 html.tmac html-end.tmac \
43                 devtag.tmac \
44                 europs.tmac \
45                 composite.tmac \
46                 eqnrc \
47                 troffrc troffrc-end \
48                 hyphen.us hyphenex.us
49 SPECIALFILES=   an.tmac man.tmac s.tmac ms.tmac www.tmac
50 STRIPFILES=     e.tmac doc.tmac mdoc.local
51 MDOCFILES=      doc-common doc-ditroff doc-nroff doc-syms \
52                 fr.ISO8859-1 ru.KOI8-R
53
54 all: ${MDOCFILES:S/$/-s/} ${STRIPFILES:S/$/-s/} ${SPECIALFILES:S/$/-s/} ${NORMALFILES:S/$/-s/}
55
56 .for f in ${MDOCFILES} ${STRIPFILES}
57 $f-s: $f
58         sed -f ${DIST_DIR}/strip.sed ${.ALLSRC} > ${.TARGET}
59 .endfor
60
61 .for f in ${SPECIALFILES}
62 $f-s: $f
63         sed -e "s;@TMAC_AN_PREFIX@;${tmac_an_prefix};g" \
64             -e "s;@TMAC_S_PREFIX@;${tmac_s_prefix};g" \
65             -e "s;@PNMTOPS_NOSETPAGE@;pnmtops;g" \
66                 ${.ALLSRC} > ${.TARGET}
67 .endfor
68
69 .for f in ${NORMALFILES}
70 $f-s: $f
71         cp ${.ALLSRC} ${.TARGET}
72 .endfor
73
74 beforeinstall:
75         cd ${.CURDIR}; \
76             ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
77             koi8-r.tmac hyphen.ru ${DESTDIR}${TMACDIR}
78         cd ${.OBJDIR}
79 .for f in ${STRIPFILES} ${SPECIALFILES} ${NORMALFILES}
80         ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
81             $f-s ${DESTDIR}${TMACDIR}/$f
82 .endfor
83 .for f in ${MDOCFILES}
84         ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
85             $f-s ${DESTDIR}${MDOCDIR}/$f
86 .endfor
87 .if !exists(${DESTDIR}${TMACDIR}/man.local)
88         ${INSTALL} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
89             ${DIST_DIR}/man.local ${DESTDIR}${TMACDIR}
90 .endif
91
92 .include <bsd.prog.mk>