head	1.19;
access;
symbols
	netbsd-11-0-RC4:1.19
	netbsd-11-0-RC3:1.19
	netbsd-11-0-RC2:1.19
	netbsd-11-0-RC1:1.19
	perseant-exfatfs-base-20250801:1.19
	netbsd-11:1.19.0.4
	netbsd-11-base:1.19
	netbsd-10-1-RELEASE:1.17
	perseant-exfatfs-base-20240630:1.19
	perseant-exfatfs:1.19.0.2
	perseant-exfatfs-base:1.19
	netbsd-8-3-RELEASE:1.17
	netbsd-9-4-RELEASE:1.17
	netbsd-10-0-RELEASE:1.17
	netbsd-10-0-RC6:1.17
	netbsd-10-0-RC5:1.17
	netbsd-10-0-RC4:1.17
	netbsd-10-0-RC3:1.17
	netbsd-10-0-RC2:1.17
	netbsd-10-0-RC1:1.17
	netbsd-10:1.17.0.50
	netbsd-10-base:1.17
	netbsd-9-3-RELEASE:1.17
	cjep_sun2x-base1:1.17
	cjep_sun2x:1.17.0.48
	cjep_sun2x-base:1.17
	cjep_staticlib_x-base1:1.17
	netbsd-9-2-RELEASE:1.17
	cjep_staticlib_x:1.17.0.46
	cjep_staticlib_x-base:1.17
	netbsd-9-1-RELEASE:1.17
	phil-wifi-20200421:1.17
	phil-wifi-20200411:1.17
	is-mlppp:1.17.0.44
	is-mlppp-base:1.17
	phil-wifi-20200406:1.17
	netbsd-8-2-RELEASE:1.17
	netbsd-9-0-RELEASE:1.17
	netbsd-9-0-RC2:1.17
	netbsd-9-0-RC1:1.17
	phil-wifi-20191119:1.17
	netbsd-9:1.17.0.42
	netbsd-9-base:1.17
	phil-wifi-20190609:1.17
	netbsd-8-1-RELEASE:1.17
	netbsd-8-1-RC1:1.17
	pgoyette-compat-merge-20190127:1.17
	pgoyette-compat-20190127:1.17
	pgoyette-compat-20190118:1.17
	pgoyette-compat-1226:1.17
	pgoyette-compat-1126:1.17
	pgoyette-compat-1020:1.17
	pgoyette-compat-0930:1.17
	pgoyette-compat-0906:1.17
	netbsd-7-2-RELEASE:1.17
	pgoyette-compat-0728:1.17
	netbsd-8-0-RELEASE:1.17
	phil-wifi:1.17.0.40
	phil-wifi-base:1.17
	pgoyette-compat-0625:1.17
	netbsd-8-0-RC2:1.17
	pgoyette-compat-0521:1.17
	pgoyette-compat-0502:1.17
	pgoyette-compat-0422:1.17
	netbsd-8-0-RC1:1.17
	pgoyette-compat-0415:1.17
	pgoyette-compat-0407:1.17
	pgoyette-compat-0330:1.17
	pgoyette-compat-0322:1.17
	pgoyette-compat-0315:1.17
	netbsd-7-1-2-RELEASE:1.17
	pgoyette-compat:1.17.0.38
	pgoyette-compat-base:1.17
	netbsd-7-1-1-RELEASE:1.17
	matt-nb8-mediatek:1.17.0.36
	matt-nb8-mediatek-base:1.17
	perseant-stdc-iso10646:1.17.0.34
	perseant-stdc-iso10646-base:1.17
	netbsd-8:1.17.0.32
	netbsd-8-base:1.17
	prg-localcount2-base3:1.17
	prg-localcount2-base2:1.17
	prg-localcount2-base1:1.17
	prg-localcount2:1.17.0.30
	prg-localcount2-base:1.17
	pgoyette-localcount-20170426:1.17
	bouyer-socketcan-base1:1.17
	pgoyette-localcount-20170320:1.17
	netbsd-7-1:1.17.0.28
	netbsd-7-1-RELEASE:1.17
	netbsd-7-1-RC2:1.17
	netbsd-7-nhusb-base-20170116:1.17
	bouyer-socketcan:1.17.0.26
	bouyer-socketcan-base:1.17
	pgoyette-localcount-20170107:1.17
	netbsd-7-1-RC1:1.17
	pgoyette-localcount-20161104:1.17
	netbsd-7-0-2-RELEASE:1.17
	localcount-20160914:1.17
	netbsd-7-nhusb:1.17.0.24
	netbsd-7-nhusb-base:1.17
	pgoyette-localcount-20160806:1.17
	pgoyette-localcount-20160726:1.17
	pgoyette-localcount:1.17.0.22
	pgoyette-localcount-base:1.17
	netbsd-7-0-1-RELEASE:1.17
	netbsd-7-0:1.17.0.20
	netbsd-7-0-RELEASE:1.17
	netbsd-7-0-RC3:1.17
	netbsd-7-0-RC2:1.17
	netbsd-7-0-RC1:1.17
	netbsd-5-2-3-RELEASE:1.16
	netbsd-5-1-5-RELEASE:1.16
	netbsd-6-0-6-RELEASE:1.17
	netbsd-6-1-5-RELEASE:1.17
	netbsd-7:1.17.0.18
	netbsd-7-base:1.17
	yamt-pagecache-base9:1.17
	yamt-pagecache-tag8:1.16.18.1
	netbsd-6-1-4-RELEASE:1.17
	netbsd-6-0-5-RELEASE:1.17
	tls-earlyentropy:1.17.0.16
	tls-earlyentropy-base:1.17
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.17
	riastradh-drm2-base3:1.17
	netbsd-6-1-3-RELEASE:1.17
	netbsd-6-0-4-RELEASE:1.17
	netbsd-5-2-2-RELEASE:1.16
	netbsd-5-1-4-RELEASE:1.16
	netbsd-6-1-2-RELEASE:1.17
	netbsd-6-0-3-RELEASE:1.17
	netbsd-5-2-1-RELEASE:1.16
	netbsd-5-1-3-RELEASE:1.16
	netbsd-6-1-1-RELEASE:1.17
	riastradh-drm2-base2:1.17
	riastradh-drm2-base1:1.17
	riastradh-drm2:1.17.0.10
	riastradh-drm2-base:1.17
	netbsd-6-1:1.17.0.14
	netbsd-6-0-2-RELEASE:1.17
	netbsd-6-1-RELEASE:1.17
	netbsd-6-1-RC4:1.17
	netbsd-6-1-RC3:1.17
	agc-symver:1.17.0.12
	agc-symver-base:1.17
	netbsd-6-1-RC2:1.17
	netbsd-6-1-RC1:1.17
	yamt-pagecache-base8:1.17
	netbsd-5-2:1.16.0.20
	netbsd-6-0-1-RELEASE:1.17
	yamt-pagecache-base7:1.17
	netbsd-5-2-RELEASE:1.16
	netbsd-5-2-RC1:1.16
	matt-nb6-plus-nbase:1.17
	yamt-pagecache-base6:1.17
	netbsd-6-0:1.17.0.8
	netbsd-6-0-RELEASE:1.17
	netbsd-6-0-RC2:1.17
	tls-maxphys:1.17.0.6
	tls-maxphys-base:1.17
	matt-nb6-plus:1.17.0.4
	matt-nb6-plus-base:1.17
	netbsd-6-0-RC1:1.17
	yamt-pagecache-base5:1.17
	yamt-pagecache-base4:1.17
	netbsd-6:1.17.0.2
	netbsd-6-base:1.17
	netbsd-5-1-2-RELEASE:1.16
	netbsd-5-1-1-RELEASE:1.16
	yamt-pagecache-base3:1.16
	yamt-pagecache-base2:1.16
	yamt-pagecache:1.16.0.18
	yamt-pagecache-base:1.16
	cherry-xenmp:1.16.0.16
	cherry-xenmp-base:1.16
	bouyer-quota2-nbase:1.16
	bouyer-quota2:1.16.0.14
	bouyer-quota2-base:1.16
	matt-mips64-premerge-20101231:1.16
	matt-nb5-mips64-premerge-20101231:1.16
	matt-nb5-pq3:1.16.0.12
	matt-nb5-pq3-base:1.16
	netbsd-5-1:1.16.0.10
	netbsd-5-1-RELEASE:1.16
	netbsd-5-1-RC4:1.16
	matt-nb5-mips64-k15:1.16
	netbsd-5-1-RC3:1.16
	netbsd-5-1-RC2:1.16
	netbsd-5-1-RC1:1.16
	netbsd-5-0-2-RELEASE:1.16
	matt-nb5-mips64-premerge-20091211:1.16
	matt-premerge-20091211:1.16
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.16
	matt-nb4-mips64-k7-u2a-k9b:1.16
	matt-nb5-mips64-u1-k1-k5:1.16
	matt-nb5-mips64:1.16.0.8
	netbsd-5-0-1-RELEASE:1.16
	jym-xensuspend-nbase:1.16
	netbsd-5-0:1.16.0.6
	netbsd-5-0-RELEASE:1.16
	netbsd-5-0-RC4:1.16
	netbsd-5-0-RC3:1.16
	netbsd-5-0-RC2:1.16
	jym-xensuspend:1.16.0.4
	jym-xensuspend-base:1.16
	netbsd-5-0-RC1:1.16
	netbsd-5:1.16.0.2
	netbsd-5-base:1.16
	matt-mips64-base2:1.15
	matt-mips64:1.15.0.22
	netbsd-4-0-1-RELEASE:1.15
	wrstuden-revivesa-base-3:1.15
	wrstuden-revivesa-base-2:1.15
	wrstuden-fixsa-newbase:1.15
	wrstuden-revivesa-base-1:1.15
	yamt-pf42-base4:1.15
	yamt-pf42-base3:1.15
	hpcarm-cleanup-nbase:1.15
	yamt-pf42-baseX:1.15
	yamt-pf42-base2:1.15
	wrstuden-revivesa:1.15.0.20
	wrstuden-revivesa-base:1.15
	yamt-pf42:1.15.0.18
	yamt-pf42-base:1.15
	mjf-devfs2:1.15.0.16
	mjf-devfs2-base:1.15
	keiichi-mipv6-nbase:1.15
	keiichi-mipv6:1.15.0.14
	keiichi-mipv6-base:1.15
	matt-armv6-nbase:1.15
	matt-armv6-prevmlocking:1.15
	wrstuden-fixsa-base-1:1.15
	netbsd-4-0:1.15.0.12
	netbsd-4-0-RELEASE:1.15
	cube-autoconf:1.15.0.10
	cube-autoconf-base:1.15
	netbsd-4-0-RC5:1.15
	netbsd-4-0-RC4:1.15
	netbsd-4-0-RC3:1.15
	netbsd-4-0-RC2:1.15
	netbsd-4-0-RC1:1.15
	matt-armv6:1.15.0.8
	matt-armv6-base:1.15
	matt-mips64-base:1.15
	hpcarm-cleanup:1.15.0.6
	hpcarm-cleanup-base:1.15
	netbsd-3-1-1-RELEASE:1.13
	netbsd-3-0-3-RELEASE:1.13
	wrstuden-fixsa:1.15.0.4
	wrstuden-fixsa-base:1.15
	abandoned-netbsd-4-base:1.14
	abandoned-netbsd-4:1.14.0.4
	netbsd-3-1:1.13.0.6
	netbsd-3-1-RELEASE:1.13
	netbsd-3-0-2-RELEASE:1.13
	netbsd-3-1-RC4:1.13
	netbsd-3-1-RC3:1.13
	netbsd-3-1-RC2:1.13
	netbsd-3-1-RC1:1.13
	netbsd-4:1.15.0.2
	netbsd-4-base:1.15
	chap-midi-nbase:1.14
	netbsd-3-0-1-RELEASE:1.13
	chap-midi:1.14.0.2
	chap-midi-base:1.14
	netbsd-3-0:1.13.0.4
	netbsd-3-0-RELEASE:1.13
	netbsd-3-0-RC6:1.13
	netbsd-3-0-RC5:1.13
	netbsd-3-0-RC4:1.13
	netbsd-3-0-RC3:1.13
	netbsd-3-0-RC2:1.13
	netbsd-3-0-RC1:1.13
	netbsd-2-0-3-RELEASE:1.12
	netbsd-2-1:1.12.0.6
	netbsd-2-1-RELEASE:1.12
	netbsd-2-1-RC6:1.12
	netbsd-2-1-RC5:1.12
	netbsd-2-1-RC4:1.12
	netbsd-2-1-RC3:1.12
	netbsd-2-1-RC2:1.12
	netbsd-2-1-RC1:1.12
	netbsd-2-0-2-RELEASE:1.12
	netbsd-3:1.13.0.2
	netbsd-3-base:1.13
	netbsd-2-0-1-RELEASE:1.12
	netbsd-2:1.12.0.4
	netbsd-2-base:1.12
	netbsd-2-0-RELEASE:1.12
	netbsd-2-0-RC5:1.12
	netbsd-2-0-RC4:1.12
	netbsd-2-0-RC3:1.12
	netbsd-2-0-RC2:1.12
	netbsd-2-0-RC1:1.12
	netbsd-2-0:1.12.0.2
	netbsd-2-0-base:1.12
	netbsd-1-6-PATCH002-RELEASE:1.10
	netbsd-1-6-PATCH002:1.10
	netbsd-1-6-PATCH002-RC4:1.10
	netbsd-1-6-PATCH002-RC3:1.10
	netbsd-1-6-PATCH002-RC2:1.10
	netbsd-1-6-PATCH002-RC1:1.10
	netbsd-1-6-PATCH001:1.10
	netbsd-1-6-PATCH001-RELEASE:1.10
	netbsd-1-6-PATCH001-RC3:1.10
	netbsd-1-6-PATCH001-RC2:1.10
	netbsd-1-6-PATCH001-RC1:1.10
	fvdl_fs64_base:1.10
	netbsd-1-6-RELEASE:1.10
	netbsd-1-6-RC3:1.10
	netbsd-1-6-RC2:1.10
	netbsd-1-6-RC1:1.10
	netbsd-1-6:1.10.0.2
	netbsd-1-6-base:1.10
	netbsd-1-5-PATCH003:1.4
	netbsd-1-5-PATCH002:1.4
	netbsd-1-5-PATCH001:1.4
	netbsd-1-5-RELEASE:1.4
	netbsd-1-5-BETA2:1.4
	netbsd-1-5-BETA:1.4
	netbsd-1-4-PATCH003:1.4
	netbsd-1-5-ALPHA2:1.4
	netbsd-1-5:1.4.0.10
	netbsd-1-5-base:1.4
	minoura-xpg4dl:1.4.0.8
	minoura-xpg4dl-base:1.4
	netbsd-1-4-PATCH002:1.4
	wrstuden-devbsize-19991221:1.4
	wrstuden-devbsize:1.4.0.6
	wrstuden-devbsize-base:1.4
	comdex-fall-1999:1.4.0.4
	comdex-fall-1999-base:1.4
	netbsd-1-4-PATCH001:1.4
	netbsd-1-4-RELEASE:1.4
	netbsd-1-4:1.4.0.2
	netbsd-1-4-base:1.4
	netbsd-1-3-PATCH003:1.2
	netbsd-1-3-PATCH003-CANDIDATE2:1.2
	netbsd-1-3-PATCH003-CANDIDATE1:1.2
	netbsd-1-3-PATCH003-CANDIDATE0:1.2
	netbsd-1-3-PATCH002:1.2
	netbsd-1-3-PATCH001:1.2
	netbsd-1-3-RELEASE:1.2
	netbsd-1-3-BETA:1.2
	netbsd-1-3:1.2.0.2
	netbsd-1-3-base:1.2
	lite-2:1.1.1.1
	CSRG:1.1.1;
locks; strict;
comment	@# @;


1.19
date	2024.04.05.23.05.53;	author christos;	state Exp;
branches;
next	1.18;
commitid	ZTidWnmCZQB6E05F;

1.18
date	2023.05.22.12.55.44;	author lukem;	state Exp;
branches;
next	1.17;
commitid	00ptYyptyJikwXpE;

1.17
date	2012.02.07.19.13.31;	author joerg;	state Exp;
branches;
next	1.16;

1.16
date	2008.10.25.22.27.36;	author apb;	state Exp;
branches
	1.16.18.1;
next	1.15;

1.15
date	2006.08.29.14.32.45;	author hubertf;	state Exp;
branches;
next	1.14;

1.14
date	2005.10.22.06.04.57;	author hubertf;	state Exp;
branches
	1.14.4.1;
next	1.13;

1.13
date	2004.11.10.16.32.39;	author wiz;	state Exp;
branches;
next	1.12;

1.12
date	2003.10.26.07.25.35;	author lukem;	state Exp;
branches;
next	1.11;

1.11
date	2003.02.14.15.20.17;	author grant;	state Exp;
branches;
next	1.10;

1.10
date	2001.12.12.12.24.23;	author lukem;	state Exp;
branches;
next	1.9;

1.9
date	2001.12.12.01.49.17;	author tv;	state Exp;
branches;
next	1.8;

1.8
date	2001.07.05.20.52.11;	author hubertf;	state Exp;
branches;
next	1.7;

1.7
date	2001.06.30.01.25.00;	author hubertf;	state Exp;
branches;
next	1.6;

1.6
date	2001.06.30.00.19.25;	author hubertf;	state Exp;
branches;
next	1.5;

1.5
date	2001.06.26.02.26.06;	author hubertf;	state Exp;
branches;
next	1.4;

1.4
date	99.02.13.02.54.36;	author lukem;	state Exp;
branches;
next	1.3;

1.3
date	98.09.27.17.22.10;	author lukem;	state Exp;
branches;
next	1.2;

1.2
date	97.10.13.11.21.23;	author lukem;	state Exp;
branches;
next	1.1;

1.1
date	97.05.09.14.31.26;	author mycroft;	state Exp;
branches
	1.1.1.1;
next	;

1.16.18.1
date	2012.04.17.00.05.45;	author yamt;	state Exp;
branches;
next	;

1.14.4.1
date	2006.09.02.23.49.44;	author riz;	state Exp;
branches;
next	;

1.1.1.1
date	97.10.17.10.36.25;	author mrg;	state Exp;
branches;
next	;


desc
@@


1.19
log
@specify the page size for PostScript
@
text
@#	from: @@(#)Makefile	5.9 (Berkeley) 7/1/91
#	$NetBSD: Makefile,v 1.18 2023/05/22 12:55:44 lukem Exp $

#
# Note: Needs ps2pdf to convert .ps to .pdf
#

.include <bsd.own.mk>

.if ${MKSHARE} != "no" && ${MKMAKEMANDB} == "no"
FILES=		makewhatis.sed
FILESDIR=	/usr/share/man
.endif

SECTIONS?=	1 2 3 4 5 6 7 8 9

MANSRCDIRS=	"${.CURDIR}/../../.." ../../..

# Takes out some fluff from the PostScript files created by
# grops which does some VM saving/restoring that bloats the
# PDF file pdf2ps generates.              By uwe@@NetBSD.org.
OPTIMIZE_PDF?=	\
			-e '/^\/level0 0 def/d'		\
			-e '/^\/level0 save/d'		\
			-e '/^level0 restore/d'

MAN0SRCS=
.if ${MKMAN} != "no"
MAN0SRCS+=	all.files
MAN0SRCS+=	${SECTIONS:@@S@@man${S}pages.files@@}
MAN0SRCS+=	${SECTIONS:@@S@@man${S}pages.ps @@}
MAN0SRCS+=	${SECTIONS:@@S@@man${S}pages.pdf@@}
.endif

CLEANFILES+=	${MAN0SRCS}
CLEANFILES+=	*.tmp
CLEANFILES+=	toc? tocx?

all: ${MAN0SRCS}

all.files:
	${_MKTARGET_CREATE}
	find ${MANSRCDIRS} -name '*.[1-9]' -print	\
	| xargs ${TOOL_MKMAGIC}				\
	| ${TOOL_GREP} troff				\
	| ${TOOL_SED} 's/:[ 	]*.*$$//'		\
	| ${TOOL_GREP} -F -v -f "${.CURDIR}/noman"	\
	| ${TOOL_GREP} -v '#'				\
	| ${TOOL_GREP} -v '/obj\.'			\
	| ${TOOL_GREP} -v '/destdir\.'			\
	| ${TOOL_GREP} -v '/tooldir\.'			\
	> ${.TARGET}.tmp				\
	&& ${MV} ${.TARGET}.tmp ${.TARGET} ;		\
	rm -f ${.TARGET}.tmp


.for _S in ${SECTIONS}

man${_S}pages.files: all.files
	${_MKTARGET_CREATE}
	cat ${.ALLSRC}					\
	| ${TOOL_GREP} "${_S}\$$"			\
	| ${TOOL_SED} 's,\(.*/\)\([^/]*\),\2 \1\2,'	\
	| sort						\
	| ${TOOL_SED} 's/^.* //'			\
	> ${.TARGET}.tmp				\
	&& ${MV} ${.TARGET}.tmp ${.TARGET} ;		\
	rm -f ${.TARGET}.tmp

man${_S}pages.ps: man${_S}pages.files
	${_MKTARGET_CREATE}
	for f in `${TOOL_GREP} "${_S}\$$" "${.CURDIR}/intros"` `cat ${.ALLSRC}` ; \
	do						\
		if [ ! -f $${f} ]; then			\
			continue ;			\
		fi ;					\
		if ${TOOL_GREP} -q ^\\.TS "${.CURDIR}/back" ; \
		then					\
			${_MKSHMSG_FORMAT} >&2 $${f} ;	\
			cat $${f} | ${TOOL_TBL} | ${TOOL_GROFF} -Z -msafer -man -Tps ${ROFF_PAGESIZE}; \
		else					\
			${_MKSHMSG_FORMAT} >&2 $${f} "(tbl)";	\
			cat $${f} | ${TOOL_GROFF} -Z -msafer -man -Tps ${ROFF_PAGESIZE}; \
		fi ;					\
	done > ${.TARGET}.troff.tmp			\
	&& cat ${.TARGET}.troff.tmp			\
	| ${TOOL_GREP} -v '^x stop'			\
	| ${TOOL_GROPS} 				\
	> ${.TARGET}.tmp				\
	&& ${MV} ${.TARGET}.tmp ${.TARGET} ;		\
	rm -f ${.TARGET}.tmp ${.TARGET}.troff.tmp

man${_S}pages.pdf: man${_S}pages.ps
	${_MKTARGET_CREATE}
	cat ${.ALLSRC}					\
	| ${TOOL_SED} ${OPTIMIZE_PDF} 			\
	| ps2pdf - -					\
	> ${.TARGET}.tmp				\
	&& ${MV} ${.TARGET}.tmp ${.TARGET} ;		\
	rm -f ${.TARGET}.tmp

.endfor

man.tgz:
	tar plzvcf manpages-ps.tgz man?pages.ps
	tar plzvcf manpages-pdf.tgz man?pages.pdf

.include <bsd.files.mk>
@


1.18
log
@man0: support objdirs, tools, parallel builds

man0 creates files, so write to the the OBJDIR instead of the
source directory.

Use TOOL_ appropriately.
Add MAKEVERBOSE support.

Add separate rules to generate:
- all.files: the list of all man files to process (based on mkman)
- manNpages.files: per-section files from all.files. (based on mkman)
- manNpages.ps: per-section .ps from manNpages.files, with
  per-file MAKEVERBOSE messages to stderr (as before, just prettier).
- manNpages.pdf: per-section .pdf from manNpages.ps.

Remove the now-obsolete mkman script.

Add TOOL_GROPS and _MKSHMSG_FORMAT to <bsd.own.mk>
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.17 2012/02/07 19:13:31 joerg Exp $
d80 1
a80 1
			cat $${f} | ${TOOL_TBL} | ${TOOL_GROFF} -Z -msafer -man -Tps ; \
d83 1
a83 1
			cat $${f} | ${TOOL_GROFF} -Z -msafer -man -Tps ; \
@


1.17
log
@Import the new apropos/whatis.

This code has been developed by Abhinav Upadhyay as part of Google's Summer
of Code 2011. It uses libmandoc to parse man pages and builds a Full
Text Index in a SQLite database. The combination of indexing the full
manual page, filtering out stop words and ranking individual matches
based on the section gives a much improved user experience.

The old makewhatis and friends are kept under MKMAKEMANDB=no for now.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.16 2008/10/25 22:27:36 apb Exp $
d4 3
a6 1
NOOBJ=		# defined
d15 1
a15 5
CLEANFILES+=	man?
CLEANFILES+=	man?pages.tmp
CLEANFILES+=	man?pages.ps
CLEANFILES+=	man?pages.pdf
CLEANFILES+=	toc? tocx?
d17 1
a17 1
SECTIONS?=	1 2 3 4 5 6 7 8 9
d23 80
a102 42
			-e '/^\/level0 0 def/d' 		\
			-e '/^\/level0 save/d' 			\
			-e '/^level0 restore/d' 		

all: man man.ps man.pdf

man: 
	${HOST_SH} mkman

man.ps: 
	for i in ${SECTIONS} ; 					\
	do							\
		for f in `grep "$${i}\$$" intros` `cat man$${i}` ; \
		do						\
			if [ ! -f $${f} ]; then 		\
				continue ; 			\
			fi ;					\
			if grep -q ^\\.TS back ;		\
			then					\
				echo >&2 $${f} ; 			\
				cat $${f} | tbl | troff -msafer -man -Tps ; \
			else 					\
				echo >&2 $${f} "(tbl)" ;	\
				cat $${f} | troff -msafer -man -Tps ; \
			fi ; 					\
		done >man$${i}pages.tmp ;			\
		cat man$${i}pages.tmp				\
		| grep -v '^x stop' 				\
		| grops >man$${i}pages.ps ;			\
		rm man$${i}pages.tmp ; 		\
	done

man.pdf: 
	for i in ${SECTIONS} ; 					\
	do							\
		echo Chewing on man$${i}pages.pdf ;		\
		${TOOL_SED} 					\
			${OPTIMIZE_PDF} 			\
			<man$${i}pages.ps >man$${i}pages.ps.tmp ; \
		ps2pdf man$${i}pages.ps.tmp man$${i}pages.pdf ;	\
		rm man$${i}pages.ps.tmp ; 			\
	done
d108 1
a108 1
.include <bsd.prog.mk>
@


1.16
log
@Use ${TOOL_SED} instead if plain sed in Makefiles.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.15 2006/08/29 14:32:45 hubertf Exp $
d8 1
a8 1
.if ${MKSHARE} != "no"
@


1.16.18.1
log
@sync with head
@
text
@d2 1
a2 1
#	$NetBSD$
d8 1
a8 1
.if ${MKSHARE} != "no" && ${MKMAKEMANDB} == "no"
@


1.15
log
@ * Add an 'all' targets to get the order of things right
 * Remove extra file argument from a pipeline
 * keep grops from stopping after the first manpage.

This gives working PDFs for all manpage sections again - altogether
NetBSD-current has 8192 pages after formatting, in PDF.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.14 2005/10/22 06:04:57 hubertf Exp $
d61 1
a61 1
		sed 						\
@


1.14
log
@Per Christos (board):
 * move src/etc/COPYRIGHT to src/share/legal/COPYRIGHT and install that
   (in /usr/share/legal)
 * nuke src/share/man/man0/COPYRIGHT
 * mark /usr/share/man/COPYRIGHT as obsolete
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.13 2004/11/10 16:32:39 wiz Exp $
d29 3
a31 1
man:
d34 1
a34 1
man.ps:
d45 1
a45 1
				cat $${f} | tbl | troff -msafer -man -Tps $${f} ; \
d48 1
a48 1
				cat $${f} | troff -msafer -man -Tps $${f} ; \
d51 3
a53 1
		grops <man$${i}pages.tmp >man$${i}pages.ps ;	\
d57 1
a57 1
man.pdf:
@


1.14.4.1
log
@Pull up following revision(s) (requested by hubertf in ticket #103):
	share/man/man0/Makefile: revision 1.15
  * Add an 'all' targets to get the order of things right
  * Remove extra file argument from a pipeline
  * keep grops from stopping after the first manpage.
This gives working PDFs for all manpage sections again - altogether
NetBSD-current has 8192 pages after formatting, in PDF.
@
text
@d2 1
a2 1
#	$NetBSD$
d29 1
a29 3
all: man man.ps man.pdf

man: 
d32 1
a32 1
man.ps: 
d43 1
a43 1
				cat $${f} | tbl | troff -msafer -man -Tps ; \
d46 1
a46 1
				cat $${f} | troff -msafer -man -Tps ; \
d49 1
a49 3
		cat man$${i}pages.tmp				\
		| grep -v '^x stop' 				\
		| grops >man$${i}pages.ps ;			\
d53 1
a53 1
man.pdf: 
@


1.13
log
@Fix typo found by Sergey Svishchev.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.12 2003/10/26 07:25:35 lukem Exp $
d9 1
a9 1
FILES=		makewhatis.sed COPYRIGHT
@


1.12
log
@Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.11 2003/02/14 15:20:17 grant Exp $
d21 1
a21 1
# Takes out some fluff from the PostScript files created bye
@


1.11
log
@The correct capitalisation of 'NetBSD.org' is (you
guessed it) 'NetBSD.org'.

some mdoc fixes.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.10 2001/12/12 12:24:23 lukem Exp $
d30 1
a30 1
	sh mkman
@


1.10
log
@Set  NOxxx=  before  <bsd.own.mk>  is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.9 2001/12/12 01:49:17 tv Exp $
d23 1
a23 1
# PDF file pdf2ps generates.              By uwe@@netbsd.org.
@


1.9
log
@MKfoo=no -> NOfoo
@
text
@d2 3
a4 1
#	$NetBSD: Makefile,v 1.8 2001/07/05 20:52:11 hubertf Exp $
a11 1
NOOBJ=		# defined
@


1.8
log
@add "man.pdf" and "man.tgz" targets
PDF optimisations thanks to Valeriy E. Ushakov
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.7 2001/06/30 01:25:00 hubertf Exp $
d10 1
a10 1
MKOBJ=		no
@


1.7
log
@All your manpages are belong to pdf
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.6 2001/06/30 00:19:25 hubertf Exp $
d15 1
d18 10
d32 1
a32 1
	for i in 1 2 3 4 5 6 7 8 9 ; 				\
d45 1
a45 1
				cat $${f} | troff -msafer -man -Tps $${f} ;	\
d49 1
a49 1
		rm man$${i}pages.tmp ; 				\
d53 1
a53 1
	for i in 1 2 3 4 5 6 7 8 9 ; 				\
d56 5
a60 1
		ps2pdf man$${i}pages.ps man$${i}pages.pdf  ;	\
d62 4
@


1.6
log
@ * Format "intro" page first (location from "intros" file)
 * If the manpage requires running tbl (-> .TS), do so
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.5 2001/06/26 02:26:06 hubertf Exp $
d39 7
@


1.5
log
@"make man man.ps" for some 5000 page book.
Needs more work (intro page, sorting, ...), but better than before.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.4 1999/02/13 02:54:36 lukem Exp $
d23 1
a23 1
		for f in `cat man$${i}` ; 			\
d25 11
a35 2
			echo >&2 $${f} ; 			\
			troff -msafer -man -Tps $${f} ;		\
@


1.4
log
@convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.3 1998/09/27 17:22:10 lukem Exp $
d11 20
@


1.3
log
@don't install in /usr/share if NOSHARE is defined
@
text
@d2 1
a2 1
#	$NetBSD: Makefile,v 1.2 1997/10/13 11:21:23 lukem Exp $
d4 3
a6 1
.if !defined(NOSHARE)
d10 1
a10 1
NOOBJ=
@


1.2
log
@rcsid fascism
@
text
@d2 1
a2 3
#	$NetBSD: Makefile,v 1.1 1997/05/09 14:31:26 mycroft Exp $

NOOBJ=
d4 1
d7 2
@


1.1
log
@Move makewhatis.sed into man0, and split the Makefile.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.10 1997/03/27 10:45:57 mycroft Exp $
@


1.1.1.1
log
@4.4BSD-Lite2
@
text
@d1 2
a2 7
#
# Copyright (c) 1986, 1993 Regents of the University of California.
# All rights reserved.
#
#	@@(#)Makefile	8.3 (Berkeley) 5/4/94
#
SRCS=	man1 man2 man3 man4 man5 man6 man7 man8
d4 1
a4 5
MACROS=	-ms
PRINTER=Pps
EQN=	eqn
TBL=	tbl
TROFF=	groff
d6 2
a7 1
all: title.urm.${PRINTER} title.prm.${PRINTER}
d9 1
a9 54
print: title.urm.${PRINTER} title.prm.${PRINTER}
	lpr -${PRINTER} title.urm.${PRINTER}
	lpr -${PRINTER} title.prm.${PRINTER}

title.urm.${PRINTER}: title.urm ptxx
	${EQN} title.urm | ${TBL} | ${TROFF} ${MACROS} >title.urm.${PRINTER}

title.prm.${PRINTER}: ${SRCS} title.prm ptxx
	${TROFF} title.prm >title.prm.${PRINTER}

ptxx:
	./tocrc

man1pages: man1
	rm -f man1.out
	for i in `cat man1`; do \
		sed -f groff.sed $$i | groff -man >>man1pages; \
	done;

man2pages: man2
	rm -f man2.out
	for i in `cat man2`; do groff -man $$i >>man2pages; done;

man3pages: man3
	rm -f man3.out
	for i in `cat man3`; do groff -man $$i >>man3pages; done;

man4pages: man4
	rm -f man4.out
	for i in `cat man4`; do groff -man $$i >>man4pages; done;

man5pages: man5
	rm -f man5.out
	for i in `cat man5`; do \
		sed -f groff.sed $$i | groff -man >>man5pages; \
	done;

man6pages: man6
	rm -f man6.out
	for i in `cat man6`; do groff -man $$i >>man6pages; done;

man7pages: man7
	rm -f man7.out
	for i in `cat man7`; do \
		sed -f groff.sed $$i | groff -man >>man7pages; \
	done;

man8pages: man8
	rm -f man8.out
	for i in `cat man8`; do groff -man $$i >>man8pages; done;

clean:
	rm -f title.urm.[PT]* title.prm.[PT]* toc? tocx? ptxx \
		*.spell errs Errs make.out
@
