Makefile revision 1.8
11.1Smycroft#	from: @(#)Makefile	5.9 (Berkeley) 7/1/91
21.8Shubertf#	$NetBSD: Makefile,v 1.8 2001/07/05 20:52:11 hubertf Exp $
31.1Smycroft
41.4Slukem.include <bsd.own.mk>
51.4Slukem
61.4Slukem.if ${MKSHARE} != "no"
71.1SmycroftFILES=		makewhatis.sed COPYRIGHT
81.1SmycroftFILESDIR=	/usr/share/man
91.3Slukem.endif
101.4SlukemMKOBJ=		no
111.5Shubertf
121.5ShubertfCLEANFILES+=	man?
131.5ShubertfCLEANFILES+=	man?pages.tmp
141.5ShubertfCLEANFILES+=	man?pages.ps
151.8ShubertfCLEANFILES+=	man?pages.pdf
161.5ShubertfCLEANFILES+=	toc? tocx?
171.5Shubertf
181.8ShubertfSECTIONS?=	1 2 3 4 5 6 7 8 9
191.8Shubertf
201.8Shubertf# Takes out some fluff from the PostScript files created bye
211.8Shubertf# grops which does some VM saving/restoring that bloats the
221.8Shubertf# PDF file pdf2ps generates.              By uwe@netbsd.org.
231.8ShubertfOPTIMIZE_PDF?=	\
241.8Shubertf			-e '/^\/level0 0 def/d' 		\
251.8Shubertf			-e '/^\/level0 save/d' 			\
261.8Shubertf			-e '/^level0 restore/d' 		
271.8Shubertf
281.5Shubertfman:
291.5Shubertf	sh mkman
301.5Shubertf
311.5Shubertfman.ps:
321.8Shubertf	for i in ${SECTIONS} ; 					\
331.5Shubertf	do							\
341.6Shubertf		for f in `grep "$${i}\$$" intros` `cat man$${i}` ; \
351.5Shubertf		do						\
361.6Shubertf			if [ ! -f $${f} ]; then 		\
371.6Shubertf				continue ; 			\
381.6Shubertf			fi ;					\
391.6Shubertf			if grep -q ^\\.TS back ;		\
401.6Shubertf			then					\
411.6Shubertf				echo >&2 $${f} ; 			\
421.6Shubertf				cat $${f} | tbl | troff -msafer -man -Tps $${f} ; \
431.6Shubertf			else 					\
441.6Shubertf				echo >&2 $${f} "(tbl)" ;	\
451.8Shubertf				cat $${f} | troff -msafer -man -Tps $${f} ; \
461.6Shubertf			fi ; 					\
471.5Shubertf		done >man$${i}pages.tmp ;			\
481.5Shubertf		grops <man$${i}pages.tmp >man$${i}pages.ps ;	\
491.8Shubertf		rm man$${i}pages.tmp ; 		\
501.7Shubertf	done
511.7Shubertf
521.7Shubertfman.pdf:
531.8Shubertf	for i in ${SECTIONS} ; 					\
541.7Shubertf	do							\
551.7Shubertf		echo Chewing on man$${i}pages.pdf ;		\
561.8Shubertf		sed 						\
571.8Shubertf			${OPTIMIZE_PDF} 			\
581.8Shubertf			<man$${i}pages.ps >man$${i}pages.ps.tmp ; \
591.8Shubertf		ps2pdf man$${i}pages.ps.tmp man$${i}pages.pdf ;	\
601.8Shubertf		rm man$${i}pages.ps.tmp ; 			\
611.5Shubertf	done
621.8Shubertf
631.8Shubertfman.tgz:
641.8Shubertf	tar plzvcf manpages-ps.tgz man?pages.ps
651.8Shubertf	tar plzvcf manpages-pdf.tgz man?pages.pdf
661.1Smycroft
671.1Smycroft.include <bsd.prog.mk>
68