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