1 1.57 uwe # $NetBSD: Makefile.inc,v 1.57 2021/12/08 13:06:44 uwe Exp $ 2 1.14 lukem # 3 1.1 ross 4 1.34 salo # Ross Harvey <ross@NetBSD.org> 5 1.11 cjs 6 1.16 mycroft .include <bsd.own.mk> # So we get /etc/mk.conf vars. 7 1.26 lukem .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 8 1.1 ross 9 1.55 christos .if ${MKREPRO_TIMESTAMP:Uno} != "no" 10 1.55 christos GROFF_TIMESTAMP=--timestamp=${MKREPRO_TIMESTAMP} 11 1.55 christos DATE_TIMESTAMP=-r ${MKREPRO_TIMESTAMP} 12 1.55 christos .endif 13 1.55 christos 14 1.20 jhawk # Whether or not to regenerate tables of contents 15 1.30 lukem # 16 1.21 jhawk MKTOCS?=yes 17 1.20 jhawk 18 1.1 ross M?= ${.CURDIR:T} 19 1.31 lukem COMMON= ${.CURDIR}/../common 20 1.1 ross 21 1.50 uwe MAIN= ${COMMON}/main ${EXTRA} 22 1.1 ross TARG= INSTALL 23 1.2 kleink TARGS= ${TARG}.ps ${TARG}.txt ${TARG}.html ${TARG}.more 24 1.19 jhawk TOCS= ${TARG}.PostScript.toc ${TARG}.ASCII.toc ${TARG}.HTML.toc \ 25 1.19 jhawk ${TARG}.more.toc 26 1.50 uwe SRCS= ${MAIN} ${COMMON}/macros \ 27 1.50 uwe whatis ${COMMON}/contents hardware xfer prep \ 28 1.31 lukem ${.CURDIR}/install ${COMMON}/postinstall upgrade \ 29 1.43 snj ${COMMON}/legal.common ${COMMON}/netboot \ 30 1.40 jnemeth ${COMMON}/sysinst \ 31 1.29 lukem ${.CURDIR}/../Makefile.inc ${MERGED_SRCS} 32 1.1 ross 33 1.38 pavel whatis: .OPTIONAL 34 1.38 pavel 35 1.38 pavel PRESET= ${GFLAGS} -U -dM=${M} -dV=${DISTRIBVER} -d.CURDIR=${.CURDIR} -r${M}=1 36 1.45 martin PRESET+= -rmajor=${DISTRIBVER:C/\..*$//} 37 1.53 martin .if ${USE_XZ_SETS:Uno} == "yes" 38 1.44 martin PRESET+= -dsetsuffix=tar.xz 39 1.56 martin PRESET+= -dcompressor=xz 40 1.44 martin .else 41 1.44 martin PRESET+= -dsetsuffix=tgz 42 1.56 martin PRESET+= -dcompressor=gzip 43 1.44 martin .endif 44 1.45 martin .if ${NETBSD_OFFICIAL_RELEASE:Uno} == "yes" 45 1.45 martin PRESET+= -rFOR_RELEASE=1 46 1.45 martin .else 47 1.45 martin PRESET+= -rFOR_RELEASE=0 48 1.45 martin .endif 49 1.45 martin .if (${DISTRIBVER:M*.99.*}) 50 1.45 martin PRESET+= -rRELEASE_BRANCH=0 51 1.57 uwe # make .Nx \*V happy 52 1.57 uwe PRESET+= -doperating-system-NetBSD-${DISTRIBVER}=${DISTRIBVER} 53 1.45 martin .elif (${DISTRIBVER:M*.[0-9]*}) 54 1.45 martin PRESET+= -rRELEASE_BRANCH=1 55 1.45 martin PRESET+= -rminor=${DISTRIBVER:C/^[0-9]+\.([0-9])+.*$/\1/} 56 1.45 martin nextmin!= expr ${DISTRIBVER:C/^[0-9]+\.([0-9])+.*$/\1/} + 1 57 1.45 martin .if exists(${.CURDIR}/../../../doc/CHANGES-${DISTRIBVER:C/\..*$//}.${nextmin}) 58 1.45 martin PRESET+= -rnextminor=${nextmin} 59 1.45 martin .endif 60 1.45 martin .endif 61 1.45 martin .if defined(BUILDID) && "${BUILDID:M20*Z}" != "" 62 1.45 martin curdate!= env LANG="C" date -d "${BUILDID:C/[0-9][0-9][0-9][0-9]Z$//}" "+%b %d, %Y" 63 1.45 martin .else 64 1.46 martin .if ${NETBSD_OFFICIAL_RELEASE:Uno} == "yes" 65 1.46 martin .error "No release date could be derived from BUILDID" 66 1.46 martin .else 67 1.55 christos curdate!= env LANG="C" date ${DATE_TIMESTAMP} "+%b %d, %Y" 68 1.45 martin .endif 69 1.46 martin .endif 70 1.45 martin PRESET+= -dcur_date="${curdate}" 71 1.1 ross 72 1.8 soren POST_PLAIN= -P-b -P-u -P-o 73 1.1 ross 74 1.1 ross ARGS_PS= ${PRESET} -dformat=PostScript 75 1.12 enami ARGS_TXT= ${PRESET} -dformat=ASCII ${POST_PLAIN} -Tascii -mtty-char 76 1.8 soren ARGS_HTML= ${PRESET} -dformat=HTML ${POST_PLAIN} -Tlatin1 -ww 77 1.12 enami ARGS_MORE= ${PRESET} -dformat=more -P-h -Tascii -mtty-char 78 1.1 ross 79 1.1 ross # 80 1.1 ross # For example... 81 1.1 ross # 82 1.1 ross # .if ri386 ...stuff... 83 1.1 ross # .Ss "Install notes for NetBSD/\*[MACHINE]" 84 1.1 ross # 85 1.1 ross 86 1.18 mycroft all: ${TARGS} 87 1.1 ross 88 1.21 jhawk .if ${MKTOCS} != "no" 89 1.29 lukem TOC.ps= ${TOCS:M*.PostScript.*} 90 1.29 lukem TOC.txt= ${TOCS:M*.ASCII.*} 91 1.29 lukem TOC.html= ${TOCS:M*.HTML.*} 92 1.29 lukem TOC.more= ${TOCS:M*.more.*} 93 1.20 jhawk .endif 94 1.20 jhawk 95 1.42 apb REMOVE_CREATION_DATE= ${TOOL_SED} -e '/^%%CreationDate:/d' 96 1.30 lukem 97 1.35 he ${TARG}.ps: ${SRCS} ${TOC.ps} ${DISTRIBVERDEP} 98 1.55 christos ${TOOL_GROFF} ${ARGS_PS} ${GROFF_TIMESTAMP} -mdoc ${MAIN} \ 99 1.42 apb ${${MKREPRO:Uno} == "yes":? | ${REMOVE_CREATION_DATE} :} \ 100 1.42 apb > $@ 101 1.13 lukem 102 1.13 lukem ${TARG}.pdf: ${TARG}.ps 103 1.13 lukem ps2pdf ${TARG}.ps $@ 104 1.1 ross 105 1.35 he ${TARG}.txt: ${SRCS} ${TOC.txt} ${DISTRIBVERDEP} 106 1.55 christos ${TOOL_GROFF} ${ARGS_TXT} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > $@ 107 1.1 ross 108 1.35 he ${TARG}.html: ${SRCS} ${TOC.html} ${DISTRIBVERDEP} 109 1.55 christos ${TOOL_GROFF} ${ARGS_HTML} ${GROFF_TIMESTAMP} -mdoc2html ${MAIN} > $@ 110 1.1 ross 111 1.35 he ${TARG}.more: ${SRCS} ${TOC.more} ${DISTRIBVERDEP} 112 1.55 christos ${TOOL_GROFF} ${ARGS_MORE} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > $@ 113 1.1 ross 114 1.30 lukem 115 1.52 uwe # Rules to build the table of contents (.toc) files. For the 116 1.52 uwe # PostScript version it's generated twice to take into account the 117 1.52 uwe # space taken by the TOC itself. Other versions are not paginated. 118 1.30 lukem 119 1.20 jhawk ${TARG}.PostScript.toc: ${SRCS} 120 1.55 christos ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null 121 1.20 jhawk mv -f $@.tmp $@ 122 1.55 christos ${TOOL_GROFF} -dTOC=1 ${ARGS_PS} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null 123 1.19 jhawk mv -f $@.tmp $@ 124 1.19 jhawk 125 1.20 jhawk ${TARG}.ASCII.toc: ${SRCS} 126 1.55 christos ${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null 127 1.20 jhawk mv -f $@.tmp $@ 128 1.19 jhawk 129 1.20 jhawk ${TARG}.HTML.toc: ${SRCS} 130 1.55 christos ${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} ${GROFF_TIMESTAMP} -mdoc2html ${MAIN} > /dev/null 131 1.20 jhawk mv -f $@.tmp $@ 132 1.19 jhawk 133 1.20 jhawk ${TARG}.more.toc: ${SRCS} 134 1.55 christos ${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null 135 1.20 jhawk mv -f $@.tmp $@ 136 1.30 lukem 137 1.6 ross 138 1.26 lukem release: check_RELEASEDIR .WAIT ${TARGS} 139 1.36 uwe ${INSTALL} -d -m 755 ${RELEASEDIR}/${RELEASEMACHINEDIR} 140 1.36 uwe ${RELEASE_INSTALL} ${TARGS} ${RELEASEDIR}/${RELEASEMACHINEDIR} 141 1.17 mycroft 142 1.17 mycroft cleannotes: 143 1.29 lukem rm -f [Ee]rrs mklog core *.core ${TARGS} ${TOCS} \ 144 1.29 lukem ${TOCS:S/.toc$/.toc.tmp/g} 145 1.17 mycroft 146 1.17 mycroft clean cleandir distclean: cleannotes 147