Home | History | Annotate | Line # | Download | only in notes
Makefile.inc revision 1.31
      1 #	$NetBSD: Makefile.inc,v 1.31 2002/07/21 08:14:46 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 COMMON=	${.CURDIR}/../common
     15 
     16 MAIN=	${COMMON}/main ${COMMON}/macros ${EXTRA}
     17 TARG=	INSTALL
     18 TARGS=	${TARG}.ps ${TARG}.txt ${TARG}.html ${TARG}.more
     19 TOCS=	${TARG}.PostScript.toc ${TARG}.ASCII.toc ${TARG}.HTML.toc \
     20 	${TARG}.more.toc
     21 SRCS=	${MAIN} whatis ${COMMON}/contents hardware xfer prep \
     22 	${.CURDIR}/install ${COMMON}/postinstall upgrade \
     23 	${COMMON}/donations ${COMMON}/legal.common legal \
     24 	${.CURDIR}/../Makefile.inc ${MERGED_SRCS}
     25 
     26 PRESET=	${GFLAGS} -dM=${M} -dV=${DISTRIBVER} -d.CURDIR=${.CURDIR} -r${M}=1
     27 
     28 POST_PLAIN= -P-b -P-u -P-o
     29 
     30 ARGS_PS=	${PRESET} -dformat=PostScript
     31 ARGS_TXT=	${PRESET} -dformat=ASCII ${POST_PLAIN} -Tascii -mtty-char
     32 ARGS_HTML=	${PRESET} -dformat=HTML ${POST_PLAIN} -Tlatin1 -ww
     33 ARGS_MORE=	${PRESET} -dformat=more -P-h -Tascii -mtty-char
     34 
     35 #
     36 # For example...
     37 #
     38 #	.if ri386 ...stuff...
     39 #	.Ss "Install notes for NetBSD/\*[MACHINE]"
     40 #
     41 
     42 all: ${TARGS}
     43 
     44 .if ${MKTOCS} != "no"
     45 TOC.ps=		${TOCS:M*.PostScript.*}
     46 TOC.txt=	${TOCS:M*.ASCII.*}
     47 TOC.html=	${TOCS:M*.HTML.*}
     48 TOC.more=	${TOCS:M*.more.*}
     49 .endif
     50 
     51 
     52 ${TARG}.ps: ${SRCS} ${TOC.ps}
     53 	${GROFF} ${ARGS_PS}   -mdoc      ${MAIN} > $@
     54 
     55 ${TARG}.pdf: ${TARG}.ps
     56 	ps2pdf ${TARG}.ps $@
     57 
     58 ${TARG}.txt: ${SRCS} ${TOC.txt}
     59 	${GROFF} ${ARGS_TXT}  -mdoc      ${MAIN} > $@
     60 
     61 ${TARG}.html: ${SRCS} ${TOC.html}
     62 	${GROFF} ${ARGS_HTML} -mdoc2html ${MAIN} > $@
     63 
     64 ${TARG}.more: ${SRCS} ${TOC.more}
     65 	${GROFF} ${ARGS_MORE} -mdoc      ${MAIN} > $@
     66 
     67 
     68 # Rules to build the table of contents (.toc) files.
     69 # They are generated twice to take into account the
     70 # space taken by the TOC itself.
     71 #
     72 
     73 TOCPROC=	   2>&1 >/dev/null |\
     74            sed -n '/^\.Ti/{s/ \([A-Za-z]\)/ "\1/; s/ *$$/"/; p; }'
     75 
     76 ${TARG}.PostScript.toc: ${SRCS}
     77 	${GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     78 	mv -f $@.tmp $@
     79 	${GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     80 	mv -f $@.tmp $@
     81 
     82 ${TARG}.ASCII.toc: ${SRCS}
     83 	${GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     84 	mv -f $@.tmp $@
     85 	${GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     86 	mv -f $@.tmp $@
     87 
     88 ${TARG}.HTML.toc: ${SRCS}
     89 	${GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     90 	mv -f $@.tmp $@
     91 	${GROFF} -dTOC=1 ${ARGS_HTML} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     92 	mv -f $@.tmp $@
     93 
     94 ${TARG}.more.toc: ${SRCS}
     95 	${GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     96 	mv -f $@.tmp $@
     97 	${GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} ${TOCPROC} > $@.tmp
     98 	mv -f $@.tmp $@
     99 
    100 
    101 release: check_RELEASEDIR .WAIT ${TARGS}
    102 	${RELEASE_INSTALL} ${TARGS} ${RELEASEDIR}/.
    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