No empty .Rs/.Re
[netbsd-mini2440.git] / share / man / man0 / Makefile
blobfcfa9333a45e8d692de87cc289aafa5c900baf76
1 # from: @(#)Makefile 5.9 (Berkeley) 7/1/91
2 # $NetBSD: Makefile,v 1.15 2006/08/29 14:32:45 hubertf Exp $
4 NOOBJ= # defined
6 .include <bsd.own.mk>
8 .if ${MKSHARE} != "no"
9 FILES= makewhatis.sed
10 FILESDIR= /usr/share/man
11 .endif
13 CLEANFILES+= man?
14 CLEANFILES+= man?pages.tmp
15 CLEANFILES+= man?pages.ps
16 CLEANFILES+= man?pages.pdf
17 CLEANFILES+= toc? tocx?
19 SECTIONS?= 1 2 3 4 5 6 7 8 9
21 # Takes out some fluff from the PostScript files created by
22 # grops which does some VM saving/restoring that bloats the
23 # PDF file pdf2ps generates. By uwe@NetBSD.org.
24 OPTIMIZE_PDF?= \
25 -e '/^\/level0 0 def/d' \
26 -e '/^\/level0 save/d' \
27 -e '/^level0 restore/d'
29 all: man man.ps man.pdf
31 man:
32 ${HOST_SH} mkman
34 man.ps:
35 for i in ${SECTIONS} ; \
36 do \
37 for f in `grep "$${i}\$$" intros` `cat man$${i}` ; \
38 do \
39 if [ ! -f $${f} ]; then \
40 continue ; \
41 fi ; \
42 if grep -q ^\\.TS back ; \
43 then \
44 echo >&2 $${f} ; \
45 cat $${f} | tbl | troff -msafer -man -Tps ; \
46 else \
47 echo >&2 $${f} "(tbl)" ; \
48 cat $${f} | troff -msafer -man -Tps ; \
49 fi ; \
50 done >man$${i}pages.tmp ; \
51 cat man$${i}pages.tmp \
52 | grep -v '^x stop' \
53 | grops >man$${i}pages.ps ; \
54 rm man$${i}pages.tmp ; \
55 done
57 man.pdf:
58 for i in ${SECTIONS} ; \
59 do \
60 echo Chewing on man$${i}pages.pdf ; \
61 ${TOOL_SED} \
62 ${OPTIMIZE_PDF} \
63 <man$${i}pages.ps >man$${i}pages.ps.tmp ; \
64 ps2pdf man$${i}pages.ps.tmp man$${i}pages.pdf ; \
65 rm man$${i}pages.ps.tmp ; \
66 done
68 man.tgz:
69 tar plzvcf manpages-ps.tgz man?pages.ps
70 tar plzvcf manpages-pdf.tgz man?pages.pdf
72 .include <bsd.prog.mk>