Makefile revision 1.12
11.1Smycroft#	from: @(#)Makefile	5.9 (Berkeley) 7/1/91
21.12Slukem#	$NetBSD: Makefile,v 1.12 2003/10/26 07:25:35 lukem Exp $
31.10Slukem
41.10SlukemNOOBJ=		# defined
51.1Smycroft
61.4Slukem.include <bsd.own.mk>
71.4Slukem
81.4Slukem.if ${MKSHARE} != "no"
91.1SmycroftFILES=		makewhatis.sed COPYRIGHT
101.1SmycroftFILESDIR=	/usr/share/man
111.3Slukem.endif
121.5Shubertf
131.5ShubertfCLEANFILES+=	man?
141.5ShubertfCLEANFILES+=	man?pages.tmp
151.5ShubertfCLEANFILES+=	man?pages.ps
161.8ShubertfCLEANFILES+=	man?pages.pdf
171.5ShubertfCLEANFILES+=	toc? tocx?
181.5Shubertf
191.8ShubertfSECTIONS?=	1 2 3 4 5 6 7 8 9
201.8Shubertf
211.8Shubertf# Takes out some fluff from the PostScript files created bye
221.8Shubertf# grops which does some VM saving/restoring that bloats the
231.11Sgrant# PDF file pdf2ps generates.              By uwe@NetBSD.org.
241.8ShubertfOPTIMIZE_PDF?=	\
251.8Shubertf			-e '/^\/level0 0 def/d' 		\
261.8Shubertf			-e '/^\/level0 save/d' 			\
271.8Shubertf			-e '/^level0 restore/d' 		
281.8Shubertf
291.5Shubertfman:
301.12Slukem	${HOST_SH} mkman
311.5Shubertf
321.5Shubertfman.ps:
331.8Shubertf	for i in ${SECTIONS} ; 					\
341.5Shubertf	do							\
351.6Shubertf		for f in `grep "$${i}\$$" intros` `cat man$${i}` ; \
361.5Shubertf		do						\
371.6Shubertf			if [ ! -f $${f} ]; then 		\
381.6Shubertf				continue ; 			\
391.6Shubertf			fi ;					\
401.6Shubertf			if grep -q ^\\.TS back ;		\
411.6Shubertf			then					\
421.6Shubertf				echo >&2 $${f} ; 			\
431.6Shubertf				cat $${f} | tbl | troff -msafer -man -Tps $${f} ; \
441.6Shubertf			else 					\
451.6Shubertf				echo >&2 $${f} "(tbl)" ;	\
461.8Shubertf				cat $${f} | troff -msafer -man -Tps $${f} ; \
471.6Shubertf			fi ; 					\
481.5Shubertf		done >man$${i}pages.tmp ;			\
491.5Shubertf		grops <man$${i}pages.tmp >man$${i}pages.ps ;	\
501.8Shubertf		rm man$${i}pages.tmp ; 		\
511.7Shubertf	done
521.7Shubertf
531.7Shubertfman.pdf:
541.8Shubertf	for i in ${SECTIONS} ; 					\
551.7Shubertf	do							\
561.7Shubertf		echo Chewing on man$${i}pages.pdf ;		\
571.8Shubertf		sed 						\
581.8Shubertf			${OPTIMIZE_PDF} 			\
591.8Shubertf			<man$${i}pages.ps >man$${i}pages.ps.tmp ; \
601.8Shubertf		ps2pdf man$${i}pages.ps.tmp man$${i}pages.pdf ;	\
611.8Shubertf		rm man$${i}pages.ps.tmp ; 			\
621.5Shubertf	done
631.8Shubertf
641.8Shubertfman.tgz:
651.8Shubertf	tar plzvcf manpages-ps.tgz man?pages.ps
661.8Shubertf	tar plzvcf manpages-pdf.tgz man?pages.pdf
671.1Smycroft
681.1Smycroft.include <bsd.prog.mk>
69