1 # $NetBSD: Makefile.inc,v 1.30 2002/07/21 00:12:28 lukem Exp $ 2 # 3 4 # Ross Harvey <ross@netbsd.org> 5 6 .include <bsd.own.mk> # So we get /etc/mk.conf vars. 7 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 8 9 # Whether or not to regenerate tables of contents 10 # 11 MKTOCS?=yes 12 13 M?= ${.CURDIR:T} 14 15 MAIN= ${.CURDIR}/../common/main ${.CURDIR}/../common/macros ${EXTRA} 16 TARG= INSTALL 17 TARGS= ${TARG}.ps ${TARG}.txt ${TARG}.html ${TARG}.more 18 TOCS= ${TARG}.PostScript.toc ${TARG}.ASCII.toc ${TARG}.HTML.toc \ 19 ${TARG}.more.toc 20 SRCS= ${MAIN} whatis contents hardware xfer prep ${.CURDIR}/install \ 21 upgrade donations legal.common legal postinstall \ 22 ${.CURDIR}/../Makefile.inc ${MERGED_SRCS} 23 24 PRESET= ${GFLAGS} -dM=${M} -dV=${DISTRIBVER} -d.CURDIR=${.CURDIR} -r${M}=1 25 26 POST_PLAIN= -P-b -P-u -P-o 27 28 ARGS_PS= ${PRESET} -dformat=PostScript 29 ARGS_TXT= ${PRESET} -dformat=ASCII ${POST_PLAIN} -Tascii -mtty-char 30 ARGS_HTML= ${PRESET} -dformat=HTML ${POST_PLAIN} -Tlatin1 -ww 31 ARGS_MORE= ${PRESET} -dformat=more -P-h -Tascii -mtty-char 32 33 # 34 # For example... 35 # 36 # .if ri386 ...stuff... 37 # .Ss "Install notes for NetBSD/\*[MACHINE]" 38 # 39 40 all: ${TARGS} 41 42 .if ${MKTOCS} != "no" 43 TOC.ps= ${TOCS:M*.PostScript.*} 44 TOC.txt= ${TOCS:M*.ASCII.*} 45 TOC.html= ${TOCS:M*.HTML.*} 46 TOC.more= ${TOCS:M*.more.*} 47 .endif 48 49 50 ${TARG}.ps: ${SRCS} ${TOC.ps} 51 ${GROFF} ${ARGS_PS} -mdoc ${MAIN} > $@ 52 53 ${TARG}.pdf: ${TARG}.ps 54 ps2pdf ${TARG}.ps $@ 55 56 ${TARG}.txt: ${SRCS} ${TOC.txt} 57 ${GROFF} ${ARGS_TXT} -mdoc ${MAIN} > $@ 58 59 ${TARG}.html: ${SRCS} ${TOC.html} 60 ${GROFF} ${ARGS_HTML} -mdoc2html ${MAIN} > $@ 61 62 ${TARG}.more: ${SRCS} ${TOC.more} 63 ${GROFF} ${ARGS_MORE} -mdoc ${MAIN} > $@ 64 65 66 # Rules to build the table of contents (.toc) files. 67 # They are generated twice to take into account the 68 # space taken by the TOC itself. 69 # 70 71 TOCPROC= 2>&1 >/dev/null |\ 72 sed -n '/^\.Ti/{s/ \([A-Za-z]\)/ "\1/; s/ *$$/"/; p; }' 73 74 ${TARG}.PostScript.toc: ${SRCS} 75 ${GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 76 mv -f $@.tmp $@ 77 ${GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 78 mv -f $@.tmp $@ 79 80 ${TARG}.ASCII.toc: ${SRCS} 81 ${GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 82 mv -f $@.tmp $@ 83 ${GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 84 mv -f $@.tmp $@ 85 86 ${TARG}.HTML.toc: ${SRCS} 87 ${GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 88 mv -f $@.tmp $@ 89 ${GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 90 mv -f $@.tmp $@ 91 92 ${TARG}.more.toc: ${SRCS} 93 ${GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 94 mv -f $@.tmp $@ 95 ${GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp 96 mv -f $@.tmp $@ 97 98 99 release: check_RELEASEDIR .WAIT ${TARGS} 100 ${RELEASE_INSTALL} ${TARGS} ${RELEASEDIR}/. 101 102 .PATH: ${.CURDIR}/../common 103 104 cleannotes: 105 rm -f [Ee]rrs mklog core *.core ${TARGS} ${TOCS} \ 106 ${TOCS:S/.toc$/.toc.tmp/g} 107 108 clean cleandir distclean: cleannotes 109