1 # from: @(#)Makefile 5.9 (Berkeley) 7/1/91 2 # $NetBSD: Makefile,v 1.14 2005/10/22 06:04:57 hubertf Exp $ 3 4 NOOBJ= # defined 5 6 .include <bsd.own.mk> 7 8 .if ${MKSHARE} != "no" 9 FILES= makewhatis.sed 10 FILESDIR= /usr/share/man 11 .endif 12 13 CLEANFILES+= man? 14 CLEANFILES+= man?pages.tmp 15 CLEANFILES+= man?pages.ps 16 CLEANFILES+= man?pages.pdf 17 CLEANFILES+= toc? tocx? 18 19 SECTIONS?= 1 2 3 4 5 6 7 8 9 20 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 (at] NetBSD.org. 24 OPTIMIZE_PDF?= \ 25 -e '/^\/level0 0 def/d' \ 26 -e '/^\/level0 save/d' \ 27 -e '/^level0 restore/d' 28 29 man: 30 ${HOST_SH} mkman 31 32 man.ps: 33 for i in ${SECTIONS} ; \ 34 do \ 35 for f in `grep "$${i}\$$" intros` `cat man$${i}` ; \ 36 do \ 37 if [ ! -f $${f} ]; then \ 38 continue ; \ 39 fi ; \ 40 if grep -q ^\\.TS back ; \ 41 then \ 42 echo >&2 $${f} ; \ 43 cat $${f} | tbl | troff -msafer -man -Tps $${f} ; \ 44 else \ 45 echo >&2 $${f} "(tbl)" ; \ 46 cat $${f} | troff -msafer -man -Tps $${f} ; \ 47 fi ; \ 48 done >man$${i}pages.tmp ; \ 49 grops <man$${i}pages.tmp >man$${i}pages.ps ; \ 50 rm man$${i}pages.tmp ; \ 51 done 52 53 man.pdf: 54 for i in ${SECTIONS} ; \ 55 do \ 56 echo Chewing on man$${i}pages.pdf ; \ 57 sed \ 58 ${OPTIMIZE_PDF} \ 59 <man$${i}pages.ps >man$${i}pages.ps.tmp ; \ 60 ps2pdf man$${i}pages.ps.tmp man$${i}pages.pdf ; \ 61 rm man$${i}pages.ps.tmp ; \ 62 done 63 64 man.tgz: 65 tar plzvcf manpages-ps.tgz man?pages.ps 66 tar plzvcf manpages-pdf.tgz man?pages.pdf 67 68 .include <bsd.prog.mk> 69