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