xref: /freebsd/share/doc/usd/13.viref/Makefile (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1
2VOLUME=		usd/13.viref
3EXTRA=		ex.cmd.roff ref.so set.opt.roff vi.cmd.roff
4MACROS=		-me
5CLEANFILES=	vi.ref-patched index
6TRFLAGS=	-U		# this is to hide warnings only
7USE_SOELIM=
8USE_TBL=
9
10vi.ref-patched: vi.ref
11	sed -e 's:^\.so index.so$$:&.\\*[.T]:' ${.ALLSRC} > ${.TARGET}
12
13PRINTERDEVICE?=	ascii
14.for _dev in ${PRINTERDEVICE}
15SRCS+=		vi.ref-${_dev}
16EXTRA+=		index.so.${_dev}
17CLEANFILES+=	index.so.${_dev} vi.ref-${_dev}
18
19vi.ref-${_dev}: index.so.${_dev}
20	sed -e 's:^\.so index\.so\.\\\*\[\.T\]$$:${_dev}:' vi.ref-patched > ${.TARGET}
21
22# Build index.so as a side-effect of building the paper.
23index.so.${_dev}: vi.ref-patched ${EXTRA:Nindex.so.${_dev}}
24	sed -e 's:^\.so index\.so\.\\\*\[\.T\]$$::' vi.ref-patched | \
25	    ${ROFF.${_dev}} -U -z
26	sed -e 's/MINUSSIGN/-/' \
27	    -e 's/DOUBLEQUOTE/""/' \
28	    -e "s/SQUOTE/'/" \
29	    -e 's/ /__SPACE/g' < index | \
30	sort -u '-t	' -k 1,1 -k 2n | awk -f ${.CURDIR}/merge.awk | \
31	sed -e 's/__SPACE/ /g' \
32	    -e "s/^\\(['\\.]\\)/\\\\\&\\1/" > ${.TARGET}
33.endfor
34
35.include <bsd.doc.mk>
36