xref: /freebsd/release/Makefile (revision 6daa108fd111b0654f6278a85abf7a7d8dbb9ba9)
197d92980SPeter Wemm# $FreeBSD$
20202c140SRodney W. Grimes#
3dba36bb9SRuslan Ermilov# make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \
4faec9c80SJeroen Ruigrok van der Werven#     [RELEASETAG=tag]
5bd668f6fSPoul-Henning Kamp#
6faec9c80SJeroen Ruigrok van der Werven# Where "/some/dir" is the pathname of a directory on a some filesystem with
7faec9c80SJeroen Ruigrok van der Werven# at least 1000MB of free space, "somename" is what you want the release to
8faec9c80SJeroen Ruigrok van der Werven# call itself, "/cvs/dir" is where our source repo resides and, optionally,
9faec9c80SJeroen Ruigrok van der Werven# which CVS "tag" name should be used when checking out the sources to build
10faec9c80SJeroen Ruigrok van der Werven# the release (default is HEAD).
11bd668f6fSPoul-Henning Kamp#
12dba36bb9SRuslan Ermilov# Please note: the md(4) driver must be present in the kernel
13919b0026SDavid E. O'Brien# (either by being compiled in or available as a kld(4) module),
14ff85b6e3SRuslan Ermilov# otherwise the target 'release.9' and possibly others will fail.
15f1a03fb6SAndreas Klemm#
160874402dSMurray Stokely# Note: If you add options to this file, please keep release(7) updated!
170874402dSMurray Stokely#
18aeb6d603SJordan K. Hubbard# Set these, release builder!
19d013a27bSJoerg Wunsch#
20d013a27bSJoerg Wunsch# Fixed version:
2101b19809SRuslan Ermilov#BUILDNAME=5.1-RELEASE
22d013a27bSJoerg Wunsch#
23d013a27bSJoerg Wunsch# Automatic SNAP versioning:
24fcab936bSDag-Erling SmørgravDATE != date +%Y%m%d
2501b19809SRuslan ErmilovBASE = 5.1
2664938abfSJordan K. HubbardBUILDNAME?=${BASE}-${DATE}-SNAP
27d013a27bSJoerg Wunsch#
28fe85fe95SJordan K. Hubbard#CHROOTDIR=/junk/release
293da2229cSBrian Somers# If this is a -stable snapshot, then set
3016cca1b2SAlexander Langer#RELEASETAG=RELENG_4
31d751ad7fSJohn W. De Boskey#
3298b2ae09SMark Murray# To test a release with a source tree containing patches and
3398b2ae09SMark Murray# other work. This tree will get copied instead of getting the
3498b2ae09SMark Murray# src/ tree from a CVS checkout. For "rerelease", this will NOT
3598b2ae09SMark Murray# be copied; cvs update will be used instead.
3698b2ae09SMark Murray#EXTSRCDIR=/usr/src
3798b2ae09SMark Murray#
38d751ad7fSJohn W. De Boskey# To add other options to the CVS subcommands (co,up), set
392b3f8b22SMakoto Matsushita#CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
403f17d264SSatoshi Asami#
41d751ad7fSJohn W. De Boskey# To add other options to the CVS command, set
42d751ad7fSJohn W. De Boskey#CVSARGS="-lfq"
43d751ad7fSJohn W. De Boskey#
44d751ad7fSJohn W. De Boskey# To prefix the cvs command
45d751ad7fSJohn W. De Boskey#CVSPREFIX="/usr/bin/time"
46d751ad7fSJohn W. De Boskey#
4798b2ae09SMark Murray# Where the CVS repository is
4898b2ae09SMark Murray#CVSROOT="/home/ncvs"
4998b2ae09SMark Murray#
503f17d264SSatoshi Asami# Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
513f17d264SSatoshi Asami# are building an official release.  Otherwise, we are building for
523f17d264SSatoshi Asami# a branch.
533f17d264SSatoshi Asami.if defined(RELEASETAG)
54be1234f2SPoul-Henning KampISRELEASE!=	expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true
553f17d264SSatoshi Asami.if ${ISRELEASE} != 0
563f17d264SSatoshi Asami# Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
573f17d264SSatoshi AsamiAUXRELEASETAG!=	echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
585be3b5d9SJordan K. HubbardDOCRELEASETAG?=		${AUXRELEASETAG}
595be3b5d9SJordan K. HubbardPORTSRELEASETAG?=	${AUXRELEASETAG}
603f17d264SSatoshi Asami.endif
613f17d264SSatoshi Asami.endif
62ab0e9cdcSPoul-Henning Kamp
63fff8eb57SJohn Baldwin# If you want to pass flags to the world build such as -j X, use
64fff8eb57SJohn Baldwin# WORLD_FLAGS.  Similarly, you can specify make flags for kernel
65fff8eb57SJohn Baldwin# builds via KERNEL_FLAGS.
66437077b0SDavid E. O'Brien# Similarly, you can specify make flags for make readmes via PORTREADMES_FLAGS.
672272d4a4SScott Long#WORLD_FLAGS=-j4
682272d4a4SScott Long#KERNEL_FLAGS=-j4
69437077b0SDavid E. O'Brien#PORTREADMES_FLAGS=-j4
70fff8eb57SJohn Baldwin
718f1f55e9SRuslan ErmilovTARGET_ARCH?=	${MACHINE_ARCH}
728f1f55e9SRuslan Ermilov.if ${TARGET_ARCH} == ${MACHINE_ARCH}
738f1f55e9SRuslan ErmilovTARGET?=	${MACHINE}
748f1f55e9SRuslan Ermilov.else
758f1f55e9SRuslan ErmilovTARGET?=	${TARGET_ARCH}
768f1f55e9SRuslan Ermilov.endif
775dc63117SRuslan ErmilovCROSSENV=	TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
785dc63117SRuslan ErmilovCROSSMAKE=	${MAKE} ${CROSSENV}
7961c2d47aSRuslan ErmilovNATIVEMAKE=	${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
808f1f55e9SRuslan Ermilov
810c9cba52SMike Smith# If you are using a local CVS repository with components stored in
820c9cba52SMike Smith# non-standard modules, override these on the make commandline or
830c9cba52SMike Smith# in the environment.
840c9cba52SMike SmithRELEASESRCMODULE?=	src
850c9cba52SMike SmithRELEASEDOCMODULE?=	doc
860c9cba52SMike SmithRELEASEPORTSMODULE?=	ports
870c9cba52SMike Smith
88dd1a1b3dSJoerg Wunsch# Uncomment this to disable the doc.1 target.  Docs normally require
89dd1a1b3dSJoerg Wunsch# the ports tree, so NOPORTS can be set together with NODOC in order
90dd1a1b3dSJoerg Wunsch# to have neither ports or docs.  If only NOPORTS is set to YES, but
91dd1a1b3dSJoerg Wunsch# docs are still desired, the DOMINIMALDOCPORTS logic below will only
92dd1a1b3dSJoerg Wunsch# install the ports that are minimally required for the docs.  This is
93dd1a1b3dSJoerg Wunsch# intended as a compromise, less disk space is required than for using
9423ef6da7STom Rhodes# the entire ports collection (and much less time due to the huge number
95dd1a1b3dSJoerg Wunsch# of directories it would create), but still quite a bit as well as some
96dd1a1b3dSJoerg Wunsch# CPU cycles (some of the programs are C++, and things like ghostscript
97dd1a1b3dSJoerg Wunsch# belong to the required ports nevertheless).
98dd1a1b3dSJoerg Wunsch#
9921203b38SBruce A. Mah# Setting this also disables building of release note documentation
10021203b38SBruce A. Mah# (RELNOTESng).
10185486998SJordan K. Hubbard#NODOC=  YES
102d6c7028cSJohn Hay#NOPORTS=  YES
1038ed3802bSBruce A. Mah
1047a7a00adSRuslan Ermilov# Modify this definition if you want the release notes
10539ab86fdSBruce A. Mah# and other release documentation in a language other than English.
1067a7a00adSRuslan ErmilovRELNOTES_LANG?=	en_US.ISO8859-1
1078ed3802bSBruce A. Mah
108dd1a1b3dSJoerg Wunsch# As an alternative to installing the entire ports collection (which
109dd1a1b3dSJoerg Wunsch# can take a huge amount of time, in particular on slower disks),
110dd1a1b3dSJoerg Wunsch# setting ${MINIMALDOCPORTS} allows to install and build just those
111dd1a1b3dSJoerg Wunsch# ports that are really required for getting the docs up & running.
112dd1a1b3dSJoerg Wunsch.if defined(NOPORTS) && !defined(NODOC)
113dd1a1b3dSJoerg WunschDOMINIMALDOCPORTS=	YES
114dd1a1b3dSJoerg Wunsch.include "Makefile.inc.docports"
115d9d84e07SJohn BaldwinRELEASEPORTSMODULE=	${MINIMALDOCPORTS}
116dd1a1b3dSJoerg Wunsch.endif
117dd1a1b3dSJoerg Wunsch
118dd1a1b3dSJoerg Wunsch# Helper variable
119dd1a1b3dSJoerg Wunsch.if defined(NOPORTS)
120dd1a1b3dSJoerg Wunsch.if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
121dd1a1b3dSJoerg WunschNOPORTSATALL=	YES
122dd1a1b3dSJoerg Wunsch.endif
123dd1a1b3dSJoerg Wunsch.endif
124dd1a1b3dSJoerg Wunsch
125a7042915SRuslan Ermilov# By default, documentation (Handbook, FAQ, etc.) is built for all
126a7042915SRuslan Ermilov# the languages.  To speed up building, set the DOC_LANG to just
127a7042915SRuslan Ermilov# the languages you need.  (The language for the release notes is
128a7042915SRuslan Ermilov# controlled by the RELNOTES_LANG variable above.)
129a7042915SRuslan Ermilov#DOC_LANG=	en_US.ISO8859-1
1302f332092SJordan K. HubbardDOCPORTS=	textproc/docproj
13140227c90SMakoto Matsushita# Set this to wherever the distfiles required by release procedures.
13240227c90SMakoto Matsushita.if defined(DOCDISTFILES)
13340227c90SMakoto Matsushita# Respect DOCDISTFILES which is used before.
13440227c90SMakoto MatsushitaRELEASEDISTFILES?=	${DOCDISTFILES}
13540227c90SMakoto Matsushita.else
13640227c90SMakoto MatsushitaRELEASEDISTFILES?=	${.CURDIR}/../../ports/distfiles
13740227c90SMakoto Matsushita.endif
138ce51a9fcSJordan K. Hubbard# Set this to 1 if you want -P to be used for automatic keyboard detection
139ce51a9fcSJordan K. Hubbard# on the boot floppy.  WARNING: Breaks on some Athlon (K7) motherboards.
140ce51a9fcSJordan K. HubbardAUTO_KEYBOARD_DETECT?= 0
141ce51a9fcSJordan K. Hubbard
14221203b38SBruce A. Mah.if !defined(NODOC)
143ce294350SBruce A. MahDIST_DOCS_ARCH_INDEP=	readme errata early-adopter
1448ed3802bSBruce A. MahDIST_DOCS_ARCH_DEP=	installation relnotes hardware
1458ed3802bSBruce A. Mah.endif
146ed517874SJordan K. Hubbard
147bd668f6fSPoul-Henning Kamp# Things which without too much trouble can be considered variables
14801df2ec3SDavid E. O'Brien# BASE_DISTS are special in that they get full /etc installation sets.
1497284556fSJordan K. Hubbard#
1508f1f55e9SRuslan Ermilov.if ${TARGET_ARCH} == "i386"
1519f7604aeSMurray StokelyCOMPAT_DISTS?=	compat1x compat20 compat21 compat22 compat3x compat4x
152710d4ca3SMarcel Moolenaar.elif ${TARGET_ARCH} != "ia64"
153b72008f1SJordan K. HubbardCOMPAT_DISTS?=	compat4x
154b72008f1SJordan K. Hubbard.endif
155de9a18ceSRuslan ErmilovOTHER_DISTS?=	catpages manpages games proflibs dict info doc
156bb7f32f0SMark MurrayCRYPTO_DISTS?=	crypto
15701df2ec3SDavid E. O'BrienBASE_DISTS?=	base
15801df2ec3SDavid E. O'BrienDISTRIBUTIONS?=	${BASE_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
159785bd4b4SPoul-Henning Kamp
1607c474103SPoul-Henning Kamp# mountpoint for filesystems.
1617c474103SPoul-Henning KampMNT=			/mnt
162518a1d34SPoul-Henning Kamp
163a5ddb8cfSJordan K. Hubbard# Various floppy image parameters.
164a5ddb8cfSJordan K. Hubbard#
165b98c5f70STatsumi Hosokawa
1668f1f55e9SRuslan Ermilov.if ${TARGET_ARCH} == "i386"
1678f1f55e9SRuslan Ermilov.if ${TARGET} == "pc98"
1687920b17fSYoshihiro TakahashiSMALLBOOTSIZE=		1200
1697920b17fSYoshihiro TakahashiBOOTSIZE=		1440
170c2bed627SYoshihiro TakahashiSMALLFIXITSIZE=		1200
171a40915d7SYoshihiro TakahashiFIXITSIZE=		1440
1721d91a770SYoshihiro TakahashiMFSSIZE=		4320
173a40915d7SYoshihiro TakahashiBOOTINODE=		80000
174203f3bd4SMakoto MatsushitaFIXITINODE=		40000
175a40915d7SYoshihiro TakahashiMFSINODE=		8000
1767920b17fSYoshihiro TakahashiSMALLBOOTLABEL=		fd1200
1777920b17fSYoshihiro TakahashiBOOTLABEL=		fd1440
178c2bed627SYoshihiro TakahashiSMALLFIXITLABEL=	fd1200
179a40915d7SYoshihiro TakahashiFIXITLABEL=		fd1440
1801d91a770SYoshihiro TakahashiMFSLABEL=		minimum3
181a40915d7SYoshihiro Takahashi.else
1826ceb41c2SSam LefflerDRIVERSIZE=		1440
183a5ddb8cfSJordan K. HubbardBOOTSIZE=		1440
184a5ddb8cfSJordan K. HubbardFIXITSIZE=		1440
185b98c5f70STatsumi HosokawaMFSSIZE=		4320
186b5d01310SJordan K. HubbardBIGBOOTSIZE=		2880
1876ceb41c2SSam LefflerDRIVERINODE=		40000
18883e16716SJordan K. HubbardBOOTINODE=		80000
189203f3bd4SMakoto MatsushitaFIXITINODE=		40000
190a40915d7SYoshihiro TakahashiMFSINODE=		8000
1916ceb41c2SSam LefflerDRIVERLABEL=		fd1440
192a5ddb8cfSJordan K. HubbardBOOTLABEL=		fd1440
1937385073dSJordan K. HubbardFIXITLABEL=		fd1440
194b98c5f70STatsumi HosokawaMFSLABEL=		minimum3
195a40915d7SYoshihiro TakahashiBIGBOOTLABEL=		minimum2
196a40915d7SYoshihiro Takahashi.endif
1978f1f55e9SRuslan Ermilov.elif ${TARGET_ARCH} == "alpha"
198ac95fa50SMurray StokelyMFSSIZE=		4320
199b98c5f70STatsumi HosokawaMFSINODE=		8000
200114de50eSJohn BaldwinMFSLABEL=		auto
2016d44eb56SRuslan ErmilovNO_FLOPPIES=
202c26d9e5aSJake Burkholder.elif ${TARGET_ARCH} == "sparc64"
203c9030dc8SRuslan ErmilovDISKLABEL=		sunlabel
204c26d9e5aSJake BurkholderBIGBOOTSIZE=		4096
205c26d9e5aSJake BurkholderMFSSIZE=		4096
206c26d9e5aSJake BurkholderBOOTINODE=		8192
207c26d9e5aSJake BurkholderMFSINODE=		8192
208c26d9e5aSJake BurkholderBIGBOOTLABEL=		auto
209c26d9e5aSJake BurkholderMFSLABEL=		auto
210710d4ca3SMarcel Moolenaar.elif ${TARGET_ARCH} == "ia64"
211710d4ca3SMarcel MoolenaarMFSINODE=		8192
212710d4ca3SMarcel MoolenaarMFSLABEL=		auto
213710d4ca3SMarcel MoolenaarMFSSIZE=		8192
2140902bdbeSRuslan ErmilovNO_FLOPPIES=
2152d7d81e9SPeter Wemm.elif ${TARGET_ARCH} == "amd64"
2162d7d81e9SPeter WemmMFSSIZE=		4096
2172d7d81e9SPeter WemmMFSINODE=		8192
2182d7d81e9SPeter WemmMFSLABEL=		auto
2191dae6ea9SRuslan ErmilovNO_FLOPPIES=
2207f047619SJoerg Wunsch.endif
2210202c140SRodney W. Grimes
2225795760cSRuslan Ermilov.if exists(/sbin/bsdlabel)
2235795760cSRuslan ErmilovDISKLABEL?=		bsdlabel
2245795760cSRuslan Ermilov.else
225c9030dc8SRuslan ErmilovDISKLABEL?=		disklabel
2265795760cSRuslan Ermilov.endif
227c9030dc8SRuslan Ermilov
228a3929677SWarner LoshZIPNSPLIT=		gzip --no-name -9 -c | split -b 1423k -
22900063f88SPoul-Henning Kamp
230d067d730SJordan K. Hubbard# Things that need to be compiled without crypto support in releases
2319b72ad91SRuslan Ermilov.if !defined(FIXCRYPTO) && !make(release) && !make(rerelease)
23298b2ae09SMark MurrayFIXCRYPTO!=	cd ${.CURDIR}/../kerberos5; ${MAKE} -V KPROGS; \
23398b2ae09SMark Murray		cd ${.CURDIR}/../secure; ${MAKE} -V SPROGS
234d067d730SJordan K. Hubbard.endif
235d5cf6f60SAndrey A. Chernov
2367284556fSJordan K. Hubbard# Things which may get you into trouble if you change them
23748327bc9SPoul-Henning KampMTREEFILES=		${.CURDIR}/../etc/mtree
23872995602SDavid E. O'Brien_R?=			/R
239335d64e6SJordan K. HubbardRD=			${_R}/stage
240febbbc67SBruce A. MahRND=			${RD}/release.doc
241335d64e6SJordan K. HubbardFD=			${_R}/ftp
242335d64e6SJordan K. HubbardCD=			${_R}/cdrom
2436daa108fSRuslan Ermilov.if ${TARGET} != "pc98"
2446daa108fSRuslan ErmilovCD_BOOT=		${CD}/bootonly
2456daa108fSRuslan Ermilov.endif
2461bac119bSJordan K. HubbardCD_DISC1=		${CD}/disc1
2471bac119bSJordan K. HubbardCD_DISC2=		${CD}/disc2
24848327bc9SPoul-Henning Kamp
2490c5b292cSJordan K. Hubbard# Where the bootstrap ports (see DOCPORTS) get installed.
2500c5b292cSJordan K. HubbardLOCALDIR=		/usr/local/bin
2510c5b292cSJordan K. Hubbard
252c9030dc8SRuslan Ermilov.if exists(${.CURDIR}/${TARGET_ARCH}/doFS.sh)
253c9030dc8SRuslan ErmilovDOFS_SH=	${.CURDIR}/${TARGET_ARCH}/doFS.sh
254e3940ce7SRuslan Ermilov.elif ${TARGET} != ${MACHINE}
255c9030dc8SRuslan ErmilovDOFS_SH=	${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
256f3fb0a6cSMarcel Moolenaar.else
257c9030dc8SRuslan ErmilovDOFS_SH=	${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
258f3fb0a6cSMarcel Moolenaar.endif
259f3fb0a6cSMarcel Moolenaar
260c26d9e5aSJake Burkholder.if ${TARGET_ARCH} == "sparc64"
261c26d9e5aSJake BurkholderCRUNCH_TARGETS= boot
262710d4ca3SMarcel Moolenaar.elif ${TARGET_ARCH} == "ia64"
263710d4ca3SMarcel MoolenaarCRUNCH_TARGETS= boot
264c2bed627SYoshihiro Takahashi.elif ${TARGET} == "pc98"
265c2bed627SYoshihiro TakahashiCRUNCH_TARGETS=	boot fixit fixit-small
2662d7d81e9SPeter Wemm.elif ${TARGET_ARCH} == "amd64"
2672d7d81e9SPeter WemmCRUNCH_TARGETS= boot
268c26d9e5aSJake Burkholder.endif
269c26d9e5aSJake Burkholder
270d2ae1309SRuslan ErmilovCRUNCH_TARGETS?=boot fixit
2713525074dSPoul-Henning Kamp
2720e25a727SJohn BaldwinEXTRAS= ftp.1
2730e25a727SJohn Baldwin.if !defined(NOCDROM)
2740e25a727SJohn BaldwinEXTRAS+= cdrom.1
2752ef74d22SJordan K. Hubbard.if defined(MAKE_ISOS)
2762ef74d22SJordan K. HubbardEXTRAS+= iso.1
27798f15514SMurray Stokely.endif
2786ebe9601SRuslan Ermilov.if ${TARGET} == "i386" && defined(EMUL_BOOT)
2796ebe9601SRuslan ErmilovBOOTABLE="-eb"
2806ebe9601SRuslan Ermilov.elif ${TARGET} == "pc98"
2816ebe9601SRuslan ErmilovBOOTABLE=
2826ebe9601SRuslan Ermilov.else
28329921a60SYoshihiro TakahashiBOOTABLE="-b"
28429921a60SYoshihiro Takahashi.endif
2852ef74d22SJordan K. Hubbard.endif
286793e8c6fSJordan K. Hubbard
287793e8c6fSJordan K. Hubbard.if !defined(NODOC)
28821203b38SBruce A. MahDOCREL= doc.1 doc.2
289793e8c6fSJordan K. Hubbard.endif
290793e8c6fSJordan K. Hubbard
2919b72ad91SRuslan Ermilov.if !make(release) && !make(rerelease)
2925dc63117SRuslan ErmilovBINMAKE!=	cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
2935dc63117SRuslan ErmilovWMAKEENV!=	cd ${.CURDIR}/..; \
2945dc63117SRuslan Ermilov		${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
2955dc63117SRuslan ErmilovWMAKE=		${WMAKEENV} ${BINMAKE}
2969b72ad91SRuslan Ermilov.endif
2976bde859fSRuslan Ermilov
298d9d84e07SJohn BaldwinCVS_SRCARGS=	-P
299d9d84e07SJohn Baldwin.if defined(RELEASETAG)
300d9d84e07SJohn BaldwinCVS_SRCARGS+=	-r ${RELEASETAG}
301d9d84e07SJohn Baldwin.endif
302d9d84e07SJohn Baldwin
303d9d84e07SJohn BaldwinCVS_DOCARGS=	-P
304d9d84e07SJohn Baldwin.if defined(DOCRELEASETAG)
305d9d84e07SJohn BaldwinCVS_DOCARGS+=	-r ${DOCRELEASETAG}
306d9d84e07SJohn Baldwin.endif
307d9d84e07SJohn Baldwin
308d9d84e07SJohn BaldwinCVS_PORTSARGS=	-P
309d9d84e07SJohn Baldwin.if defined(PORTSRELEASETAG)
310d9d84e07SJohn BaldwinCVS_PORTSARGS+=	-r ${PORTSRELEASETAG}
311d9d84e07SJohn Baldwin.endif
312d9d84e07SJohn Baldwin
31300a7eeebSRuslan ErmilovWORLDDIR?=	${.CURDIR}/..
31400a7eeebSRuslan Ermilov
315dba36bb9SRuslan Ermilovrelease rerelease:
316574c2247SJordan K. Hubbard.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
317574c2247SJordan K. Hubbard	@echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
3187eb11201SPoul-Henning Kamp.endif
319dd1a1b3dSJoerg Wunsch.if defined(NOPORTSATALL) && !defined(NODOC)
320d191a99cSJohn Baldwin	@echo "Ports are required for building the docs.  Either set NODOC or"
321dd1a1b3dSJoerg Wunsch	@echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
322d191a99cSJohn Baldwin	@exit 1
323d191a99cSJohn Baldwin.endif
324288fe4dbSPoul-Henning Kamp.if make(release)
325682078bdSRodney W. Grimes.if exists(${CHROOTDIR})
32672ac7e4dSJohn Polstra# The first command will fail on a handful of files that have their schg
32772ac7e4dSJohn Polstra# flags set.  But it greatly speeds up the next two commands.
3286ceb41c2SSam Leffler	# NB: clear any vestigal devfs mount, just in case
3296ceb41c2SSam Leffler	-umount ${CHROOTDIR}/dev > /dev/null 2>&1
33027b5e4fdSJordan K. Hubbard	-rm -rf ${CHROOTDIR} 2>/dev/null
331492cf9a4SJohn Polstra	-chflags -R noschg ${CHROOTDIR}/.
332b7738481SJoerg Wunsch	-rm -rf ${CHROOTDIR}
333682078bdSRodney W. Grimes.endif
334335d64e6SJordan K. Hubbard	mkdir -p ${CHROOTDIR}
335b1a8a181SRuslan Ermilov	@echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
33600a7eeebSRuslan Ermilov	cd ${WORLDDIR} && ${NATIVEMAKE} -DNOGAMES -DNOHTML -DNOINFO -DNOMAN \
3376bde859fSRuslan Ermilov	    -DNOPROFILE installworld DESTDIR=${CHROOTDIR}
33800a7eeebSRuslan Ermilov	cd ${WORLDDIR}/etc && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
3398e8d540fSSADA Kenji	if [ -f /etc/resolv.conf ]; then \
3408e8d540fSSADA Kenji		cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
3418e8d540fSSADA Kenji	fi
342d101bd64SYoshihiro Takahashi.if defined(EXTLOCALDIR)
343d101bd64SYoshihiro Takahashi	rm -rf ${CHROOTDIR}/usr/local
344a4b4ec99SJuli Mallett	cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
345d101bd64SYoshihiro Takahashi.endif
346d9d84e07SJohn Baldwin	rm -rf ${CHROOTDIR}/usr/src
347d9d84e07SJohn Baldwin.if defined(EXTSRCDIR)
348d9d84e07SJohn Baldwin	cd ${CHROOTDIR}/usr && \
349a4b4ec99SJuli Mallett		cp -R -H ${EXTSRCDIR} src
350bd668f6fSPoul-Henning Kamp.else
351d9d84e07SJohn Baldwin	cd ${CHROOTDIR}/usr && \
352d9d84e07SJohn Baldwin		${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
353288fe4dbSPoul-Henning Kamp.endif
35462bb2153SPaul Traina.if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES})
35575f462f4SJordan K. Hubbard	cd ${CHROOTDIR}/usr/src && patch ${PATCH_FLAGS} < ${LOCAL_PATCHES}
35662bb2153SPaul Traina.endif
35748f1b394SJordan K. Hubbard.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
35848f1b394SJordan K. Hubbard	cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
35948f1b394SJordan K. Hubbard.endif
360d9d84e07SJohn Baldwin	rm -rf ${CHROOTDIR}/usr/ports
361d9d84e07SJohn Baldwin.if !defined(NOPORTSATALL)
362d9d84e07SJohn Baldwin	cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
363d9d84e07SJohn Baldwin.endif
364aeb6d603SJordan K. Hubbard.if !defined(NODOC)
365d9d84e07SJohn Baldwin	rm -rf ${CHROOTDIR}/usr/doc
366d9d84e07SJohn Baldwin.if defined(EXTDOCDIR)
367a4b4ec99SJuli Mallett	cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
3683f17d264SSatoshi Asami.else
369d9d84e07SJohn Baldwin	cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
3703f17d264SSatoshi Asami.endif
37140227c90SMakoto Matsushita	if [ -d ${RELEASEDISTFILES}/ ]; then \
37240227c90SMakoto Matsushita		cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
373b389e7aaSMakoto Matsushita	else \
374d7c4abbfSMakoto Matsushita		mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
3758e8d540fSSADA Kenji	fi
3763ea0ca53SDavid E. O'Brien.if !defined(NO_PREFETCHDISTFILES)
3773ea0ca53SDavid E. O'Brien	@cd ${.CURDIR} && ${MAKE} fetch-distfiles
378bb5e8f3fSJohn Baldwin.endif
379aeb6d603SJordan K. Hubbard.endif
380288fe4dbSPoul-Henning Kamp.endif
381288fe4dbSPoul-Henning Kamp.if make(rerelease)
382288fe4dbSPoul-Henning Kamp.if !defined(RELEASENOUPDATE)
383288fe4dbSPoul-Henning Kamp.if !defined(RELEASETAG)
384d751ad7fSJohn W. De Boskey	cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d -A
385288fe4dbSPoul-Henning Kamp.else
386d751ad7fSJohn W. De Boskey	cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
387288fe4dbSPoul-Henning Kamp.endif
388b4f72168SRuslan Ermilov	rm -f ${CHROOTDIR}/tmp/.world_done
38997febce7SJoerg Wunsch.if !defined(NOPORTS)
390d751ad7fSJohn W. De Boskey	cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d
3916e5cd2d2SJordan K. Hubbard.endif
392dd1a1b3dSJoerg Wunsch.if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
393dd1a1b3dSJoerg Wunsch	for i in ${MINIMALDOCPORTS}; do \
394d751ad7fSJohn W. De Boskey		( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d ) ; \
395dd1a1b3dSJoerg Wunsch	done
396dd1a1b3dSJoerg Wunsch.endif
397aeb6d603SJordan K. Hubbard.if !defined(NODOC)
398d751ad7fSJohn W. De Boskey	cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d
399aeb6d603SJordan K. Hubbard.endif
400288fe4dbSPoul-Henning Kamp.endif
401bd668f6fSPoul-Henning Kamp.endif
4027284556fSJordan K. Hubbard	# Add version information to those things that need it.
403b4f72168SRuslan Ermilov	if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
404b4f72168SRuslan Ermilov		cd ${CHROOTDIR}/usr/src/sys/conf && \
405288fe4dbSPoul-Henning Kamp		mv newvers.sh foo && \
406b4f72168SRuslan Ermilov		sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
407b4f72168SRuslan Ermilov		rm foo; \
408b4f72168SRuslan Ermilov	fi
409d4983966SPaul Traina	-test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
41020e5d523SJordan K. Hubbard	echo "#!/bin/sh"			> ${CHROOTDIR}/mk
41120e5d523SJordan K. Hubbard	echo "set -ex"				>> ${CHROOTDIR}/mk
4126ceb41c2SSam Leffler	echo "trap 'umount /dev || true' 0"	>> ${CHROOTDIR}/mk
4130276d282SJordan K. Hubbard	echo "_RELTARGET=\$${1:-doRELEASE}"	>> ${CHROOTDIR}/mk
4147a7a00adSRuslan Ermilov.for var in \
4153e4ac74dSRuslan Ermilov	AUTO_KEYBOARD_DETECT \
4163e4ac74dSRuslan Ermilov	BOOT_CONFIG \
4173e4ac74dSRuslan Ermilov	BUILDNAME \
4183e4ac74dSRuslan Ermilov	CD_EXTRA_BITS \
4193e4ac74dSRuslan Ermilov	DISTRIBUTIONS \
4203e4ac74dSRuslan Ermilov	DOC_LANG \
4213e4ac74dSRuslan Ermilov	DOMINIMALDOCPORTS \
4223e4ac74dSRuslan Ermilov	EXTRA_SRC \
4233e4ac74dSRuslan Ermilov	FIXCRYPTO \
42477d79f0cSMakoto Matsushita	FTP_PASSIVE_MODE \
42577d79f0cSMakoto Matsushita	FTP_PROXY \
42677d79f0cSMakoto Matsushita	HTTP_PROXY \
4273e4ac74dSRuslan Ermilov	KERNELS \
4283e4ac74dSRuslan Ermilov	KERNEL_FLAGS \
4293e4ac74dSRuslan Ermilov	MAKE_ISOS \
4303e4ac74dSRuslan Ermilov	NOCDROM \
4313e4ac74dSRuslan Ermilov	NODOC \
4323e4ac74dSRuslan Ermilov	NOPORTS \
4333e4ac74dSRuslan Ermilov	NOSHARED \
4343e4ac74dSRuslan Ermilov	NOSRC \
4353e4ac74dSRuslan Ermilov	NO_CPU_CFLAGS \
4363e4ac74dSRuslan Ermilov	NO_CPU_COPTFLAGS \
4373e4ac74dSRuslan Ermilov	NO_FLOPPIES \
4383e4ac74dSRuslan Ermilov	NO_SENDMAIL \
4393e4ac74dSRuslan Ermilov	RELEASETAG \
4403e4ac74dSRuslan Ermilov	RELNOTES_LANG \
4413e4ac74dSRuslan Ermilov	TARGET \
4423e4ac74dSRuslan Ermilov	TARGET_ARCH \
4433e4ac74dSRuslan Ermilov	WORLD_FLAGS
4447a7a00adSRuslan Ermilov.if defined(${var})
4457a7a00adSRuslan Ermilov	echo "export ${var}=\"${${var}}\""	>> ${CHROOTDIR}/mk
44646e90709SJoerg Wunsch.endif
4477a7a00adSRuslan Ermilov.endfor
44843276d06SJoerg Wunsch	# Don't remove this, or the build will fall over!
449335d64e6SJordan K. Hubbard	echo "export RELEASEDIR=${_R}"		>> ${CHROOTDIR}/mk
450dafdb1b4SMakoto Matsushita	echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}"	>> ${CHROOTDIR}/mk
451b6ea96d1SRuslan Ermilov	echo "export MANBUILDCAT=YES"		>> ${CHROOTDIR}/mk
4526ceb41c2SSam Leffler	# NB: these may fail if the host is running w/o devfs
4536ceb41c2SSam Leffler	echo "umount /dev >/dev/null 2>&1 || true" >> ${CHROOTDIR}/mk
4546ceb41c2SSam Leffler	echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true" \
4556ceb41c2SSam Leffler						>> ${CHROOTDIR}/mk
4563e5ef0fdSJordan K. Hubbard	echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk
45720e5d523SJordan K. Hubbard	echo "	cd /usr/src"			>> ${CHROOTDIR}/mk
4588f1f55e9SRuslan Ermilov	echo "	${CROSSMAKE} ${WORLD_FLAGS} -DNOCLEAN buildworld && \\" >> ${CHROOTDIR}/mk
4593e5ef0fdSJordan K. Hubbard	echo "	touch /tmp/.world_done"		>> ${CHROOTDIR}/mk
4603e5ef0fdSJordan K. Hubbard	echo "fi"				>> ${CHROOTDIR}/mk
461d422eae9SMarcel Moolenaar	echo "if [ ! -f /tmp/.skip_ports ]; then" >> ${CHROOTDIR}/mk
462cd9568c7SMarcel Moolenaar	echo "	echo \">>> make readmes started on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
463cd9568c7SMarcel Moolenaar	echo "	cd /usr/ports"			>> ${CHROOTDIR}/mk
464437077b0SDavid E. O'Brien	echo "	make ${PORTREADMES_FLAGS} readmes" >> ${CHROOTDIR}/mk
465d422eae9SMarcel Moolenaar	echo "	touch /tmp/.skip_ports"		>> ${CHROOTDIR}/mk
466cd9568c7SMarcel Moolenaar	echo "	echo \">>> make readmes finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
467cd9568c7SMarcel Moolenaar	echo "fi"				>> ${CHROOTDIR}/mk
468a3e12198SJordan K. Hubbard	echo "cd /usr/src/release"		>> ${CHROOTDIR}/mk
469da813eaeSDavid E. O'Brien	echo "make obj"				>> ${CHROOTDIR}/mk
4700276d282SJordan K. Hubbard	echo "make \$${_RELTARGET}"		>> ${CHROOTDIR}/mk
471b1a8a181SRuslan Ermilov	echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
47220e5d523SJordan K. Hubbard	chmod 755 ${CHROOTDIR}/mk
473d422eae9SMarcel Moolenaar.if defined(NOPORTS) || defined(NOPORTREADMES)
474d422eae9SMarcel Moolenaar	touch ${CHROOTDIR}/tmp/.skip_ports
475d422eae9SMarcel Moolenaar.endif
4765262ab24SDavid E. O'Brien	# Ensure md.ko is loaded if md(4) is not statically compiled into the kernel
4775262ab24SDavid E. O'Brien	-mdconfig 2>/dev/null
478dafdb1b4SMakoto Matsushita	env -i /usr/sbin/chroot ${CHROOTDIR} /mk
47920e5d523SJordan K. Hubbard
480bd668f6fSPoul-Henning Kampclean:
4813d610ec8SRuslan Ermilov	rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-9] release.10 \
4826fa3a9ddSJohn Baldwin	    ${EXTRAS}
483bd668f6fSPoul-Henning Kamp
4843ea0ca53SDavid E. O'Brienfetch-distfiles:
4853ea0ca53SDavid E. O'Brien	@for i in ${DOCPORTS}; do \
4863ea0ca53SDavid E. O'Brien		cd ${CHROOTDIR}/usr/ports/$$i && \
4873ea0ca53SDavid E. O'Brien			make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
4883ea0ca53SDavid E. O'Brien			WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
4893ea0ca53SDavid E. O'Brien			checksum-recursive ; \
4903ea0ca53SDavid E. O'Brien	done
4913ea0ca53SDavid E. O'Brien
492335d64e6SJordan K. Hubbard# Clean out ${_R} and make the directory structure.
493bd668f6fSPoul-Henning Kamprelease.1:
494335d64e6SJordan K. Hubbard	mkdir -p ${_R}
495cd8d8dacSJordan K. Hubbard	-rm -rf ${_R}/* 2> /dev/null
496335d64e6SJordan K. Hubbard	-chflags -R noschg ${_R}/.
497335d64e6SJordan K. Hubbard	rm -rf ${_R}/*
498bd668f6fSPoul-Henning Kamp	mkdir ${RD}
4991dae6ea9SRuslan Ermilov.if !defined(NO_FLOPPIES)
500bd668f6fSPoul-Henning Kamp	mkdir ${RD}/floppies
5011dae6ea9SRuslan Ermilov.endif
502e12c4355SPoul-Henning Kamp	mkdir ${RD}/trees
503bb91094aSPoul-Henning Kamp	mkdir ${RD}/kernels
5047284556fSJordan K. Hubbard	for i in ${DISTRIBUTIONS} ; do \
505288fe4dbSPoul-Henning Kamp		mkdir ${RD}/trees/$$i && \
50611017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.root.dist \
507288fe4dbSPoul-Henning Kamp		    -p ${RD}/trees/$$i > /dev/null && \
50811017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
509288fe4dbSPoul-Henning Kamp		    -p ${RD}/trees/$$i/usr > /dev/null && \
51011017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.include.dist \
511288fe4dbSPoul-Henning Kamp		    -p ${RD}/trees/$$i/usr/include > /dev/null && \
51211017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.var.dist \
513e12c4355SPoul-Henning Kamp		    -p ${RD}/trees/$$i/var > /dev/null ; \
51448327bc9SPoul-Henning Kamp	done
515d3c93cefSRuslan Ermilov	touch ${.TARGET}
5167f986648SPoul-Henning Kamp
517bd668f6fSPoul-Henning Kamp# Install the system into the various distributions.
518bd668f6fSPoul-Henning Kamprelease.2:
51901df2ec3SDavid E. O'Brien	cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/base
5208f1f55e9SRuslan Ermilov	cd ${.CURDIR}/.. && ${CROSSMAKE} distributeworld DISTDIR=${RD}/trees
521d3c93cefSRuslan Ermilov	touch ${.TARGET}
522ff85b6e3SRuslan Ermilov
523bb7f32f0SMark Murray# Build and install crypto distributions.
524ff85b6e3SRuslan Ermilovrelease.3:
5256bde859fSRuslan Ermilov	# Handle some grief caused by the munition braindeadness.
5266bde859fSRuslan Ermilov	cd ${.CURDIR}/..; \
5278f1f55e9SRuslan Ermilov	${CROSSMAKE} ${WORLD_FLAGS} -DNO_MAKEDB_RUN -DNOCRYPT \
5286bde859fSRuslan Ermilov	    SUBDIR_OVERRIDE="${FIXCRYPTO}" \
5298f1f55e9SRuslan Ermilov	    buildworld distributeworld DISTDIR=${RD}/trees
5305966cedcSJoerg Wunsch	-chflags -R noschg ${RD}/trees
531d3c93cefSRuslan Ermilov	touch ${.TARGET}
53297febce7SJoerg Wunsch
53397febce7SJoerg Wunsch# Make and install the generic kernel(s).
534ff85b6e3SRuslan Ermilovrelease.4:
53516c61233SJordan K. Hubbard.for kernel in ${KERNELS}
5366bde859fSRuslan Ermilov	cd ${.CURDIR}/..; \
53774064f9fSRuslan Ermilov	${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
5386bde859fSRuslan Ermilov	    KERNCONF=${kernel} INSTKERNNAME=${kernel} kernel \
5396bde859fSRuslan Ermilov	    DESTDIR=${RD}/trees/base
54016c61233SJordan K. Hubbard.endfor
5416bde859fSRuslan Ermilov	# Install a standard boot kernel+modules.
5426bde859fSRuslan Ermilov	cd ${.CURDIR}/..; \
54374064f9fSRuslan Ermilov	${CROSSMAKE} ${KERNEL_FLAGS} \
5446bde859fSRuslan Ermilov	    kernel \
5456bde859fSRuslan Ermilov	    DESTDIR=${RD}/trees/base; \
5466bde859fSRuslan Ermilov	cd ${.CURDIR}/..; \
5478f1f55e9SRuslan Ermilov	${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
5486bde859fSRuslan Ermilov	    reinstallkernel -DINSTALL_DEBUG \
5496bde859fSRuslan Ermilov	    DESTDIR=${RD}/trees/base
550d3c93cefSRuslan Ermilov	touch ${.TARGET}
551bd668f6fSPoul-Henning Kamp
55201feef2cSPoul-Henning Kamp# Make and install the three crunched binaries which live on the floppies.
553bd668f6fSPoul-Henning Kamp# You are not supposed to like this :-)
554ff85b6e3SRuslan Ermilovrelease.5:
555518a1d34SPoul-Henning Kamp	rm -rf ${RD}/crunch
556518a1d34SPoul-Henning Kamp	mkdir -p ${RD}/crunch
55758888af3SRuslan Ermilov.for j in ${CRUNCH_TARGETS}
55858888af3SRuslan Ermilov	rm -rf ${j}_crunch
55958888af3SRuslan Ermilov	mkdir ${j}_crunch
5608f1f55e9SRuslan Ermilov.if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
56106b76511SRuslan Ermilov	cd ${j}_crunch; ${WMAKEENV} crunchgen -o ${.CURDIR}/${TARGET}/${j}_crunch.conf
56258888af3SRuslan Ermilov.else
56306b76511SRuslan Ermilov	cd ${j}_crunch; ${WMAKEENV} crunchgen -o ${.CURDIR}/${j}_crunch.conf
56458888af3SRuslan Ermilov.endif
56558888af3SRuslan Ermilov	cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
566eedbbe40SRuslan Ermilov	cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
567407ac59aSJohn Hay	cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk \
568407ac59aSJohn Hay	    CFLAGS="-Os -pipe" -DNO_CPU_CFLAGS all
56955ee3f14SRuslan Ermilov	${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
57058888af3SRuslan Ermilov	mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
57158888af3SRuslan Ermilov.endfor
572d3c93cefSRuslan Ermilov	touch ${.TARGET}
573bd668f6fSPoul-Henning Kamp
57430e8b491SPoul-Henning Kamp#
57530e8b491SPoul-Henning Kamp# --==## Fix up the distributions. ##==--
57630e8b491SPoul-Henning Kamp#
577ff85b6e3SRuslan Ermilovrelease.6:
5787284556fSJordan K. Hubbard	# Create any "synthetic dists" now.
5797284556fSJordan K. Hubbard	@for i in ${DISTRIBUTIONS}; do \
5807284556fSJordan K. Hubbard		if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
5817284556fSJordan K. Hubbard			echo -n "Running $$i dist creation script... "; \
58266422f5bSPeter Wemm			env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
58358183fc7SJordan K. Hubbard			echo "Done."; \
5847284556fSJordan K. Hubbard		fi \
5857284556fSJordan K. Hubbard	done \
5867284556fSJordan K. Hubbard
58730e8b491SPoul-Henning Kamp	# Remove all the directories we don't need.
58827d44115SPoul-Henning Kamp	-cd ${RD}/trees && \
5890a9e93bfSJordan K. Hubbard		find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
590d3c93cefSRuslan Ermilov	touch ${.TARGET}
591f14786ddSJordan K. Hubbard
59230e8b491SPoul-Henning Kamp#
5937284556fSJordan K. Hubbard# --==## Package up the tarballs from assembled trees ##==--
59430e8b491SPoul-Henning Kamp#
595ff85b6e3SRuslan Ermilovrelease.7:
59695e34bfcSJordan K. Hubbard	rm -rf ${RD}/dists
59795e34bfcSJordan K. Hubbard	mkdir -p ${RD}/dists
59895e34bfcSJordan K. Hubbard	@for i in ${DISTRIBUTIONS} ; \
59995e34bfcSJordan K. Hubbard	do \
60095e34bfcSJordan K. Hubbard		if [ -d ${RD}/trees/$${i} ] ; then \
60130e8b491SPoul-Henning Kamp			cd ${.CURDIR} && $(MAKE) doTARBALL \
60230e8b491SPoul-Henning Kamp				SD=${RD}/trees/$${i} \
603288fe4dbSPoul-Henning Kamp				TN=$$i TD=$$i ARG="." && \
60495e34bfcSJordan K. Hubbard			echo "$${i} distribution is finished."; \
60595e34bfcSJordan K. Hubbard		fi ; \
60695e34bfcSJordan K. Hubbard	done
6076daa108fSRuslan Ermilov.if !defined(NOPORTS)
6086daa108fSRuslan Ermilov	# XXX: Inline stripped version of doTARBALL
6096daa108fSRuslan Ermilov	@rm -rf ${RD}/dists/ports/ports*
6106daa108fSRuslan Ermilov	@mkdir -p ${RD}/dists/ports
6116daa108fSRuslan Ermilov	@echo rolling ports/ports tarball
6126daa108fSRuslan Ermilov	@tar --exclude CVS --exclude 'ports/distfiles/*' -czf \
6136daa108fSRuslan Ermilov	  ${RD}/dists/ports/ports.tgz -C /usr ports
6146daa108fSRuslan Ermilov	@cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
6156daa108fSRuslan Ermilov	@(cd ${RD}/dists/ports; \
6166daa108fSRuslan Ermilov	  rm -f CHECKSUM.MD5; \
6176daa108fSRuslan Ermilov	  md5 * > CHECKSUM.MD5)
6186daa108fSRuslan Ermilov	@echo "ports distribution is finished."
6196daa108fSRuslan Ermilov.endif
620d3c93cefSRuslan Ermilov	touch ${.TARGET}
62195e34bfcSJordan K. Hubbard
62295e34bfcSJordan K. Hubbard
62330e8b491SPoul-Henning Kamp#
62430e8b491SPoul-Henning Kamp# --==## Make source dists ##==--
62530e8b491SPoul-Henning Kamp#
626ff85b6e3SRuslan Ermilovrelease.8:
6274731faa3SJordan K. Hubbard.if !defined(NOSRC)
628288fe4dbSPoul-Henning Kamp	@cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
62995e34bfcSJordan K. Hubbard		TD=src TN=sbase ARG="[A-Z]*"
630fb29e2cfSJordan K. Hubbard	@for i in `cd /usr/src && echo [a-z]*` ; do \
63130e8b491SPoul-Henning Kamp		if [ -d /usr/src/$$i ] ; then \
63230e8b491SPoul-Henning Kamp			cd ${.CURDIR} && $(MAKE) doTARBALL \
633470f825fSJordan K. Hubbard				TN=`echo s$$i | tr -d '.' | \
634470f825fSJordan K. Hubbard				    sed -e 's/usr/u/' \
635470f825fSJordan K. Hubbard					-e 's/kerberos5/krb5/'` \
63630e8b491SPoul-Henning Kamp				SD=/usr/src TD=src ARG="$$i" ; \
63795e34bfcSJordan K. Hubbard		fi ; \
63895e34bfcSJordan K. Hubbard	done
63940b0c0d9SPeter Wemm.if defined(EXTRA_SRC)
640288fe4dbSPoul-Henning Kamp	@set ${EXTRA_SRC} && \
64140b0c0d9SPeter Wemm	while [ $$# -ge 2 ] ; do \
64230e8b491SPoul-Henning Kamp		if [ -d /usr/src/$$1 ] ; then \
64330e8b491SPoul-Henning Kamp			cd ${.CURDIR} && $(MAKE) doTARBALL \
64430e8b491SPoul-Henning Kamp				SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
64530e8b491SPoul-Henning Kamp		fi && shift && shift ; \
64640b0c0d9SPeter Wemm	done
64740b0c0d9SPeter Wemm.endif
648470f825fSJordan K. Hubbard	if [ -d ${RD}/dists/crypto ] ; then ( cd ${RD}/dists/src && \
649470f825fSJordan K. Hubbard		if [ -f ssecure.aa ] ; then mv ssecure.* ../crypto ; fi && \
650470f825fSJordan K. Hubbard		if [ -f scrypto.aa ] ; then mv scrypto.* ../crypto ; fi && \
651f9c18558SJordan K. Hubbard		if [ -f skrb5.aa ] ; then mv skrb5.* ../crypto ; fi ; \
652f9c18558SJordan K. Hubbard		cd ${RD}/dists/crypto; rm -f CHECKSUM.MD5; \
653f9c18558SJordan K. Hubbard		md5 * > CHECKSUM.MD5 ) ; fi
654f9c18558SJordan K. Hubbard	(cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5)
65595e34bfcSJordan K. Hubbard	@echo "src distribution is finished."
6564731faa3SJordan K. Hubbard.endif
657d3c93cefSRuslan Ermilov	touch ${.TARGET}
65895e34bfcSJordan K. Hubbard
65995e34bfcSJordan K. Hubbard# Complete the bootfd
660409f9329SJordan K. Hubbard#
661409f9329SJordan K. Hubbard# Now, just to get this picture down once and for all:
662409f9329SJordan K. Hubbard#
663409f9329SJordan K. Hubbard# +------------------------------------------------------------------------+
664409f9329SJordan K. Hubbard# |boot.flp                                                                |
665409f9329SJordan K. Hubbard# +-----+-----+------------------------------------------------------------+
666409f9329SJordan K. Hubbard# |boot1|boot2|floppy filesystem "bootfd"                                  |
667839dfafeSJohn Baldwin# +-----+-----+-+----------------------+---------------------------------+-+
668839dfafeSJohn Baldwin#               |kernel.gz             |mfsroot.gz                       |
669839dfafeSJohn Baldwin#               +----------------------+---------------------------------+
670409f9329SJordan K. Hubbard#
671409f9329SJordan K. Hubbard
672ff85b6e3SRuslan Ermilovrelease.9:
67355852204SRuslan Ermilov	cp ${RD}/trees/base/etc/disktab /etc
674409f9329SJordan K. Hubbard	rm -rf ${RD}/mfsfd
675409f9329SJordan K. Hubbard	mkdir ${RD}/mfsfd
676409f9329SJordan K. Hubbard	cd ${RD}/mfsfd && \
677d3b19355SRuslan Ermilov		mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help
6783df0e2afSPoul-Henning Kamp	@cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
679a91fd119SPoul-Henning Kamp		DIR=${RD}/mfsfd/stand ZIP=false
680dc2475c5SJohn Baldwin	( cd ${RD}/mfsfd && \
681dc2475c5SJohn Baldwin	  for dir in bin sbin ; do \
682dc2475c5SJohn Baldwin		ln -sf /stand $$dir; \
683dc2475c5SJohn Baldwin	  done )
6843cb04a4dSRuslan Ermilov	cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
685af09f57dSMakoto Matsushita.if ${TARGET} == "pc98"
686e8bbfc06SMitsuru IWASAKI	cp ${.CURDIR}/../etc/defaults/pccard.conf ${RD}/mfsfd/etc/defaults/pccard.conf
68737c973e3SMurray Stokely.endif
688fead5c44SJohn Baldwin	cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf
689d3b19355SRuslan Ermilov	( for F in defaults/rc.conf netconfig protocols ; do \
69064dc0a3eSDavid E. O'Brien		sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
69101df2ec3SDavid E. O'Brien		${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
69264dc0a3eSDavid E. O'Brien	  done )
693a191fd1bSAlfred Perlstein	grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
6946bde859fSRuslan Ermilov	    ${RD}/trees/base/etc/services | \
69564dc0a3eSDavid E. O'Brien	    sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
69664dc0a3eSDavid E. O'Brien	    > ${RD}/mfsfd/stand/etc/services
697a191fd1bSAlfred Perlstein	ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
698a191fd1bSAlfred Perlstein	ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
699407ac59aSJohn Hay	cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
70021203b38SBruce A. Mah.if !defined(NODOC)
7018ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_INDEP}; do \
702407ac59aSJohn Hay	  cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
7038ed3802bSBruce A. Mah	done
7048ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_DEP}; do \
705407ac59aSJohn Hay	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
7068ed3802bSBruce A. Mah	done
707407ac59aSJohn Hay	@mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT ${RD}/mfsfd/stand/help/INSTALL.TXT
708ce294350SBruce A. Mah	@mv ${RD}/mfsfd/stand/help/EARLY-ADOPTER.TXT ${RD}/mfsfd/stand/help/EARLY.TXT
7098ed3802bSBruce A. Mah.endif
710605ec649SJordan K. Hubbard	-test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
71171696ba3SJordan K. Hubbard	@mkdir -p ${RD}/mfsfd/boot
71273824f6bSRuslan Ermilov.if ${TARGET_ARCH} != "ia64"
7136bde859fSRuslan Ermilov	@cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
714710d4ca3SMarcel Moolenaar.endif
715c07665ebSPeter Wemm.if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
7166bde859fSRuslan Ermilov	@cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
717c06157d4SRuslan Ermilov.endif
7186bde859fSRuslan Ermilov	@tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
71992e86f99SJordan K. Hubbard		tar xf - -C ${RD}/mfsfd/stand
7203d610ec8SRuslan Ermilov.if defined(SMALLBOOTSIZE)
7216daa108fSRuslan Ermilov	@mkdir -p ${RD}/mfsroot-small
722d1d60923SYoshihiro Takahashi.if exists(${.CURDIR}/${TARGET}/drivers-small.conf)
72370accddfSJohn Baldwin	@mkdir -p ${RD}/mfsfd/modules
724d1d60923SYoshihiro Takahashi	@awk -f  ${.CURDIR}/scripts/driver-copy2.awk 2 \
725d1d60923SYoshihiro Takahashi	    ${.CURDIR}/${TARGET}/drivers-small.conf \
72670accddfSJohn Baldwin	    ${RD}/trees/base/boot/kernel ${RD}/mfsfd/modules
727d1d60923SYoshihiro Takahashi.endif
7283d610ec8SRuslan Ermilov	sh -e ${DOFS_SH} mfsroot-small ${RD} ${MNT} \
729d1d60923SYoshihiro Takahashi		${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
7306daa108fSRuslan Ermilov	@gzip -9cnv mfsroot-small > ${RD}/mfsroot-small/mfsroot.gz
7313d610ec8SRuslan Ermilov	@rm -rf ${RD}/mfsfd/modules
7324a2d414fSRuslan Ermilov.endif
733d1d60923SYoshihiro Takahashi.if exists(${.CURDIR}/${TARGET}/drivers.conf)
73470accddfSJohn Baldwin	@mkdir -p ${RD}/mfsfd/modules
735d1d60923SYoshihiro Takahashi	@awk -f  ${.CURDIR}/scripts/driver-copy2.awk 2 \
736d1d60923SYoshihiro Takahashi	    ${.CURDIR}/${TARGET}/drivers.conf \
73770accddfSJohn Baldwin	    ${RD}/trees/base/boot/kernel ${RD}/mfsfd/modules
7383d610ec8SRuslan Ermilov.endif
7396daa108fSRuslan Ermilov	@mkdir -p ${RD}/mfsroot
7403d610ec8SRuslan Ermilov	sh -e ${DOFS_SH} mfsroot ${RD} ${MNT} \
7413d610ec8SRuslan Ermilov		${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
7426daa108fSRuslan Ermilov	@gzip -9cnv mfsroot > ${RD}/mfsroot/mfsroot.gz
7431263297bSScott Long	@rm -f mfsroot mfsroot-small
7443d610ec8SRuslan Ermilov	touch ${.TARGET}
7453d610ec8SRuslan Ermilov
7463d610ec8SRuslan Ermilovrelease.10:
7471dae6ea9SRuslan Ermilov.if !defined(NO_FLOPPIES)
7483d610ec8SRuslan Ermilov.if exists(${.CURDIR}/${TARGET}/drivers.conf)
7493d610ec8SRuslan Ermilov	@echo "Making the drivers floppy."
750ec603460SJohn Hay	@rm -rf ${RD}/driversfd
751407ac59aSJohn Hay	@mkdir ${RD}/driversfd
752407ac59aSJohn Hay	@awk -f  ${.CURDIR}/scripts/driver-copy2.awk 3 \
753407ac59aSJohn Hay	    ${.CURDIR}/${TARGET}/drivers.conf \
754407ac59aSJohn Hay	    ${RD}/trees/base/boot/kernel ${RD}/driversfd
755407ac59aSJohn Hay	-@rmdir ${RD}/driversfd
75643142017SYoshihiro Takahashi	if [ -d ${RD}/driversfd ]; then \
757f3fb0a6cSMarcel Moolenaar	    sh -e ${DOFS_SH} \
7586ceb41c2SSam Leffler		${RD}/floppies/drivers.flp ${RD} ${MNT} ${DRIVERSIZE} \
7596ceb41c2SSam Leffler		${RD}/driversfd ${DRIVERINODE} ${DRIVERLABEL}; \
7608e414f48SMurray Stokely	    cd ${RD}/driversfd && awk -f  ${.CURDIR}/scripts/driver-desc.awk \
7618e414f48SMurray Stokely		*.dsc >> ${RD}/floppies/DRIVERS.TXT; \
76243142017SYoshihiro Takahashi	fi
763319f35a3SRuslan Ermilov.endif
7644a2d414fSRuslan Ermilov.if defined(BOOTSIZE)
7653d610ec8SRuslan Ermilov	@echo "Making the regular boot floppy."
7667920b17fSYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
767c26d9e5aSJake Burkholder.endif
7684a2d414fSRuslan Ermilov.if defined(SMALLBOOTSIZE)
7693d610ec8SRuslan Ermilov	@echo "Making the small boot floppy."
7704a2d414fSRuslan Ermilov	@cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern-small FDSIZE=SMALL
7714a2d414fSRuslan Ermilov.endif
7724a2d414fSRuslan Ermilov.if defined(BIGBOOTSIZE)
7733d610ec8SRuslan Ermilov	@echo "Making the big boot floppy."
7747920b17fSYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot FDSIZE=BIG
775a40915d7SYoshihiro Takahashi.endif
7763d610ec8SRuslan Ermilov.if defined(FIXITSIZE) || defined(SMALLFIXITSIZE)
77792e86f99SJordan K. Hubbard	@echo "Making fixit floppy."
77892e86f99SJordan K. Hubbard	@rm -rf ${RD}/fixitfd
77992e86f99SJordan K. Hubbard	@mkdir ${RD}/fixitfd
78092e86f99SJordan K. Hubbard	@cd ${RD}/fixitfd && \
781fbc6f9e0SJoerg Wunsch		mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
782d26a815bSJordan K. Hubbard		usr/share/misc
78301df2ec3SDavid E. O'Brien	@cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
784ef812d2fSJun Kuriyama		${RD}/fixitfd/etc
785ef812d2fSJun Kuriyama	@sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
786ef812d2fSJun Kuriyama		> ${RD}/fixitfd/etc/protocols
787ef812d2fSJun Kuriyama	@sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
788ef812d2fSJun Kuriyama		> ${RD}/fixitfd/usr/share/misc/scsi_modes
78992e86f99SJordan K. Hubbard	@cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
79092e86f99SJordan K. Hubbard	@cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
79192e86f99SJordan K. Hubbard	@cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
79292e86f99SJordan K. Hubbard	@chmod 555 ${RD}/fixitfd/stand/tar
793c2bed627SYoshihiro Takahashi.if defined(SMALLFIXITSIZE)
794c2bed627SYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
795c2bed627SYoshihiro Takahashi		DIR=${RD}/fixitfd/stand ZIP=false
796f3fb0a6cSMarcel Moolenaar	@sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp \
797c2bed627SYoshihiro Takahashi		${RD} ${MNT} ${SMALLFIXITSIZE} ${RD}/fixitfd ${FIXITINODE} \
798c2bed627SYoshihiro Takahashi		${SMALLFIXITLABEL}
799c2bed627SYoshihiro Takahashi	@rm -rf ${RD}/fixitfd/stand
800c2bed627SYoshihiro Takahashi	@mkdir ${RD}/fixitfd/stand
801c2bed627SYoshihiro Takahashi.endif
8023d610ec8SRuslan Ermilov.if defined(FIXITSIZE)
803c2bed627SYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
804c2bed627SYoshihiro Takahashi		DIR=${RD}/fixitfd/stand ZIP=false
805f3fb0a6cSMarcel Moolenaar	@sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} \
80692e86f99SJordan K. Hubbard		${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
8073d610ec8SRuslan Ermilov.endif
8083d610ec8SRuslan Ermilov.endif
8096e5cd2d2SJordan K. Hubbard# Do our last minute floppies directory setup in a convenient place.
81021203b38SBruce A. Mah.if !defined(NODOC)
8114ffc41abSYoshihiro Takahashi	@cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
81213fc8773SBruce A. Mah		${RD}/floppies/README.TXT
8134b861c74STatsumi Hosokawa	@(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
81413fc8773SBruce A. Mah.else
81513fc8773SBruce A. Mah	@(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
81613fc8773SBruce A. Mah.endif
817101b8e52SJohn Baldwin.endif
818d3c93cefSRuslan Ermilov	touch ${.TARGET}
8193bc93c76SPoul-Henning Kamp
82030e8b491SPoul-Henning Kamp#
82130e8b491SPoul-Henning Kamp# --==## Setup a suitable ftp-area ##==--
82230e8b491SPoul-Henning Kamp#
823e12c4355SPoul-Henning Kampftp.1:
82492e86f99SJordan K. Hubbard	@echo "Setting up FTP distribution area"
82592e86f99SJordan K. Hubbard	@mkdir -p ${FD}
82634594ab9SJordan K. Hubbard	-@ln -s . ${FD}/${BUILDNAME}
8271dae6ea9SRuslan Ermilov.if !defined(NO_FLOPPIES)
82892e86f99SJordan K. Hubbard	@cd ${RD} && find floppies -print | cpio -dumpl ${FD}
8291dae6ea9SRuslan Ermilov.endif
83092e86f99SJordan K. Hubbard	@cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
83121203b38SBruce A. Mah.if !defined(NODOC)
8328ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_INDEP}; do \
833febbbc67SBruce A. Mah	  cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
834febbbc67SBruce A. Mah	  cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
8358ed3802bSBruce A. Mah	done
8368ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_DEP}; do \
8374ffc41abSYoshihiro Takahashi	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
8384ffc41abSYoshihiro Takahashi	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
8398ed3802bSBruce A. Mah	done
840febbbc67SBruce A. Mah	@cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
8418ed3802bSBruce A. Mah	@mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
8428ed3802bSBruce A. Mah	@mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
843ce294350SBruce A. Mah	@mv ${FD}/EARLY-ADOPTER.TXT ${FD}/EARLY.TXT
844ce294350SBruce A. Mah	@mv ${FD}/EARLY-ADOPTER.HTM ${FD}/EARLY.HTM
8458ed3802bSBruce A. Mah.endif
84692e86f99SJordan K. Hubbard	@echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
847d3c93cefSRuslan Ermilov	touch ${.TARGET}
8483bc93c76SPoul-Henning Kamp
84930e8b491SPoul-Henning Kamp#
85030e8b491SPoul-Henning Kamp# --==## Setup a suitable cdrom-area ##==--
85130e8b491SPoul-Henning Kamp#
852c5b0a909SPoul-Henning Kampcdrom.1:
85392e86f99SJordan K. Hubbard	@echo "Setting up CDROM distribution area"
8546daa108fSRuslan Ermilov	@mkdir -p ${CD_BOOT} ${CD_DISC1} ${CD_DISC2}
855f54846c3SPoul-Henning Kamp	-@ln -s . ${CD_DISC1}/${BUILDNAME}
8561dae6ea9SRuslan Ermilov.if !defined(NO_FLOPPIES)
85792e86f99SJordan K. Hubbard	@cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
8581dae6ea9SRuslan Ermilov.endif
85992e86f99SJordan K. Hubbard	@cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
86092e86f99SJordan K. Hubbard	@for i in ${DISTRIBUTIONS} ; \
861c5b0a909SPoul-Henning Kamp	do \
862c5b0a909SPoul-Henning Kamp		if [ -d ${RD}/trees/$${i} ] ; then \
863ad5ebf3fSDag-Erling Smørgrav			chflags -R noschg ${RD}/trees/$${i} || true ; \
86401feef2cSPoul-Henning Kamp			( cd ${RD}/trees/$${i} && \
8651bac119bSJordan K. Hubbard			find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
866c5b0a909SPoul-Henning Kamp		fi \
867c5b0a909SPoul-Henning Kamp	done
86892e86f99SJordan K. Hubbard	@rm -f ${CD_DISC2}/.profile
86992e86f99SJordan K. Hubbard	@cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
87092e86f99SJordan K. Hubbard	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
87192e86f99SJordan K. Hubbard	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
87221203b38SBruce A. Mah.if !defined(NODOC)
8738ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_INDEP}; do \
874febbbc67SBruce A. Mah	  cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
875febbbc67SBruce A. Mah	  cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
8768ed3802bSBruce A. Mah	done
8778ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_DEP}; do \
8784ffc41abSYoshihiro Takahashi	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
8794ffc41abSYoshihiro Takahashi	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
8808ed3802bSBruce A. Mah	done
881febbbc67SBruce A. Mah	@cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
8828ed3802bSBruce A. Mah	@mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
8838ed3802bSBruce A. Mah	@mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
884ce294350SBruce A. Mah	@mv ${CD_DISC1}/EARLY-ADOPTER.TXT ${CD_DISC1}/EARLY.TXT
885ce294350SBruce A. Mah	@mv ${CD_DISC1}/EARLY-ADOPTER.HTM ${CD_DISC1}/EARLY.HTM
8868ed3802bSBruce A. Mah.endif
8878f1f55e9SRuslan Ermilov.if ${TARGET} != "pc98"
8886daa108fSRuslan Ermilov	@echo "Setting up boot area"
8896ceb41c2SSam Leffler	@rm -f ${CD_DISC2}/boot/loader.conf
890101b8e52SJohn Baldwin	@cp ${RD}/mfsroot/mfsroot.gz ${CD_DISC2}/boot/mfsroot.gz
891101b8e52SJohn Baldwin	@echo 'mfsroot_load="YES"' > ${CD_DISC2}/boot/loader.conf
892101b8e52SJohn Baldwin	@echo 'mfsroot_type="mfs_root"' >> ${CD_DISC2}/boot/loader.conf
893101b8e52SJohn Baldwin	@echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DISC2}/boot/loader.conf
8946daa108fSRuslan Ermilov.if defined(CD_BOOT)
8956daa108fSRuslan Ermilov	@cp -Rp ${CD_DISC2}/boot ${CD_BOOT}
896dfbc75ffSYoshihiro Takahashi.endif
8976daa108fSRuslan Ermilov	@cp -Rp ${CD_DISC2}/boot ${CD_DISC1}
8986ebe9601SRuslan Ermilov.if ${TARGET} == "i386" && defined(EMUL_BOOT) && !defined(NO_FLOPPIES)
899c7069275SRuslan Ermilov	# In case bootable ISO with floppy emulation is desired.
9006daa108fSRuslan Ermilov.if defined(CD_BOOT)
9016daa108fSRuslan Ermilov	@mkdir -p ${CD_BOOT}/floppies
9026daa108fSRuslan Ermilov	@cp ${CD_DISC1}/floppies/boot.flp ${CD_BOOT}/floppies
9036daa108fSRuslan Ermilov.endif
904c7069275SRuslan Ermilov	@mkdir -p ${CD_DISC2}/floppies
905c7069275SRuslan Ermilov	@cp ${CD_DISC1}/floppies/boot.flp ${CD_DISC2}/floppies
906c7069275SRuslan Ermilov.endif
907d219716cSJordan K. Hubbard.endif
908d3c93cefSRuslan Ermilov	touch ${.TARGET}
909c5b0a909SPoul-Henning Kamp
9102ef74d22SJordan K. Hubbardiso.1:
911c1fc2282SRuslan Ermilov.if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
91230fa4984SDavid E. O'Brien	@echo "Creating ISO images..."
9136daa108fSRuslan Ermilov.if defined(CD_BOOT)
9146daa108fSRuslan Ermilov	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
9156daa108fSRuslan Ermilov	    fbsd_bootonly \
9166daa108fSRuslan Ermilov	    ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
9176daa108fSRuslan Ermilov.endif
91830fa4984SDavid E. O'Brien	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
919bb6972abSDavid E. O'Brien	    fbsd_miniinst \
9209327e08bSJohn W. De Boskey	    ${CD}/${BUILDNAME}-${TARGET}-miniinst.iso ${CD_DISC1}
92130fa4984SDavid E. O'Brien	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
922bb6972abSDavid E. O'Brien	    fbsd_livefs \
923c1fc2282SRuslan Ermilov	    ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2}
92430fa4984SDavid E. O'Brien.if defined(CD_EXTRA_BITS)
92530fa4984SDavid E. O'Brien	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
926bb6972abSDavid E. O'Brien	    ${BOOTABLE} fbsd_boot \
927bb6972abSDavid E. O'Brien	    ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
928bb6972abSDavid E. O'Brien	    ${CD_EXTRA_BITS} \
92930fa4984SDavid E. O'Brien	    && false
93030fa4984SDavid E. O'Brien.endif
931d3c93cefSRuslan Ermilov	touch ${.TARGET}
93230fa4984SDavid E. O'Brien.else
933c1fc2282SRuslan Ermilov	@echo "Do not know how to create an ISO for ${TARGET_ARCH}."
93430fa4984SDavid E. O'Brien.endif
9352ef74d22SJordan K. Hubbard
9368ed3802bSBruce A. Mah#
9378ed3802bSBruce A. Mah# --==## Documentation Project files such as the Handbook and FAQ ##==--
9388ed3802bSBruce A. Mah#
939793e8c6fSJordan K. Hubbarddoc.1:
94092e86f99SJordan K. Hubbard	@echo "Making docs..."
94192e86f99SJordan K. Hubbard	@for i in ${DOCPORTS}; do \
942da037ed3SRuslan Ermilov	    cd /usr/ports/$$i && \
943cd9568c7SMarcel Moolenaar	    env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
944cd9568c7SMarcel Moolenaar		make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
945cd9568c7SMarcel Moolenaar		WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
946b59d8897SJordan K. Hubbard	done
94701df2ec3SDavid E. O'Brien	@cd /usr/doc && make all install 'FORMATS=html html-split txt' INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc
948d3c93cefSRuslan Ermilov	touch ${.TARGET}
949793e8c6fSJordan K. Hubbard
9508ed3802bSBruce A. Mah#
9518ed3802bSBruce A. Mah# --==## RELNOTESng:  Next-generation replacements for *.TXT files ##==--
9528ed3802bSBruce A. Mah#
9538ed3802bSBruce A. Mahdoc.2:
9548ed3802bSBruce A. Mah	@echo "Making release documentation..."
955febbbc67SBruce A. Mah	@cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' DOCDIR=${RND}
956d3c93cefSRuslan Ermilov	touch ${.TARGET}
9578ed3802bSBruce A. Mah
9587eb11201SPoul-Henning Kamp# Various "subroutine" and other supporting targets.
9597eb11201SPoul-Henning Kamp
960470f825fSJordan K. Hubbard# RD=
961470f825fSJordan K. Hubbard# SD=
962470f825fSJordan K. Hubbard# TD=
963470f825fSJordan K. Hubbard# ARG=
964bd668f6fSPoul-Henning KampdoTARBALL:
965bd668f6fSPoul-Henning Kamp.if !defined(SD)
966288fe4dbSPoul-Henning Kamp	@echo "SD undefined in doTARBALL" && exit 1
967bd668f6fSPoul-Henning Kamp.endif
968bd668f6fSPoul-Henning Kamp.if !defined(TD)
96919cc96f6SDavid E. O'Brien	@echo "TD undefined in doTARBALL" && exit 1
970bd668f6fSPoul-Henning Kamp.endif
971bd668f6fSPoul-Henning Kamp.if !defined(ARG)
972288fe4dbSPoul-Henning Kamp	@echo "ARG undefined in doTARBALL" && exit 1
973bd668f6fSPoul-Henning Kamp.endif
97492e86f99SJordan K. Hubbard	@rm -rf ${RD}/dists/${TD}/${TN}*
97592e86f99SJordan K. Hubbard	@mkdir -p ${RD}/dists/${TD}
97692e86f99SJordan K. Hubbard	@( cd ${SD} && \
977d2b98961SPoul-Henning Kamp		tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \
978d2b98961SPoul-Henning Kamp		echo rolling ${TD}/$$tn tarball &&\
9790ef3fb22SJoerg Wunsch		tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
98095e34bfcSJordan K. Hubbard		${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
98120ff6b88SJordan K. Hubbard		sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
982ac0a5268SJordan K. Hubbard		   ${RD}/dists/${TD}/$$tn.inf && \
9831e104a1eSJordan K. Hubbard		if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
9841e104a1eSJordan K. Hubbard		  cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
9851e104a1eSJordan K. Hubbard		fi && \
98616c61233SJordan K. Hubbard		if [ "${SD}" != "/usr/src" ]; then \
98711017a68SMarcel Moolenaar			mtree -c -i -p ${SD}/${ARG} \
98816c61233SJordan K. Hubbard			  -k gname,md5digest,mode,nlink,uname,size,link,type \
98991f2535eSJordan K. Hubbard			  > ${RD}/dists/${TD}/$$tn.mtree ; \
99091f2535eSJordan K. Hubbard		else \
99191f2535eSJordan K. Hubbard			true; \
99291f2535eSJordan K. Hubbard		fi; \
99391f2535eSJordan K. Hubbard		(cd ${RD}/dists/${TD}; \
99491f2535eSJordan K. Hubbard		   rm -f CHECKSUM.MD5; \
99591f2535eSJordan K. Hubbard		   md5 * > CHECKSUM.MD5) \
99691f2535eSJordan K. Hubbard	)
9977eb11201SPoul-Henning Kamp
998ff85b6e3SRuslan ErmilovdoRELEASE:  release.1 release.2 release.3 ${DOCREL} release.4 release.5 \
999a3a2d24eSRuslan Ermilov		release.6 release.7 release.8 release.9 release.10
100092e86f99SJordan K. Hubbard	@cd ${.CURDIR} && ${MAKE} ${EXTRAS}
10017eb11201SPoul-Henning Kamp	@echo "Release done"
10027eb11201SPoul-Henning Kamp
10030ead1f1dSJordan K. Hubbardfloppies:
10043d610ec8SRuslan Ermilov	@rm -f release.5 release.9 release.10
10053d610ec8SRuslan Ermilov	@cd ${.CURDIR} && ${MAKE} release.5 release.9 release.10
100692e86f99SJordan K. Hubbard	@cd ${RD} && find floppies -print | cpio -dumpl ${FD}
10070ead1f1dSJordan K. Hubbard
1008518a1d34SPoul-Henning KampinstallCRUNCH:
1009518a1d34SPoul-Henning Kamp.if !defined(CRUNCH)
1010288fe4dbSPoul-Henning Kamp	@echo "CRUNCH undefined in installCRUNCH" && exit 1
1011518a1d34SPoul-Henning Kamp.endif
1012518a1d34SPoul-Henning Kamp.if !defined(DIR)
1013288fe4dbSPoul-Henning Kamp	@echo "DIR undefined in installCRUNCH" && exit 1
1014518a1d34SPoul-Henning Kamp.endif
1015518a1d34SPoul-Henning Kamp.if !defined(ZIP)
1016288fe4dbSPoul-Henning Kamp	@echo "ZIP undefined in installCRUNCH" && exit 1
1017518a1d34SPoul-Henning Kamp.endif
101892e86f99SJordan K. Hubbard	@if ${ZIP} ; then \
1019518a1d34SPoul-Henning Kamp		gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1020518a1d34SPoul-Henning Kamp	else \
1021518a1d34SPoul-Henning Kamp		ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1022518a1d34SPoul-Henning Kamp	fi
102392e86f99SJordan K. Hubbard	@chmod 555 ${DIR}/${CRUNCH}_crunch
10248f1f55e9SRuslan Ermilov	@if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
10258f1f55e9SRuslan Ermilov		for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1026518a1d34SPoul-Henning Kamp			ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
10277ec62217SYoshihiro Takahashi		done \
10287ec62217SYoshihiro Takahashi	else \
10297ec62217SYoshihiro Takahashi		for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
10307ec62217SYoshihiro Takahashi			ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
10317ec62217SYoshihiro Takahashi		done \
10327ec62217SYoshihiro Takahashi	fi
1033288fe4dbSPoul-Henning Kamp
1034288fe4dbSPoul-Henning Kamp#
1035288fe4dbSPoul-Henning Kamp# --==## Put a filesystem into a BOOTMFS kernel ##==--
1036288fe4dbSPoul-Henning Kamp#
1037288fe4dbSPoul-Henning KampdoMFSKERN:
10386bde859fSRuslan Ermilov	@echo "Running ${.TARGET} for ${FSIMAGE}"
10396bde859fSRuslan Ermilov	@rm -f ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
1040f2eeb85dSRuslan Ermilov	@cd ${.CURDIR}/../sys/${TARGET}/conf; \
1041f2eeb85dSRuslan Ermilov	if [ -r ${.CURDIR}/${TARGET}/dokern.sh ]; then \
1042f2eeb85dSRuslan Ermilov	    sh ${.CURDIR}/${TARGET}/dokern.sh ${FDSIZE}; \
1043f2eeb85dSRuslan Ermilov	else \
1044f2eeb85dSRuslan Ermilov	    sed -e 's/ident.*GENERIC/ident		BOOTMFS/g'; \
1045f2eeb85dSRuslan Ermilov	fi < GENERIC > BOOTMFS; \
1046319f35a3SRuslan Ermilov	[ -r GENERIC.hints ] && cp GENERIC.hints BOOTMFS.hints
1047d1d60923SYoshihiro Takahashi.if defined(FDSIZE) && ${FDSIZE} == "SMALL" && \
1048d1d60923SYoshihiro Takahashi    exists(${.CURDIR}/${TARGET}/drivers-small.conf)
1049d1d60923SYoshihiro Takahashi	@awk -f ${.CURDIR}/scripts/driver-remove.awk \
1050d1d60923SYoshihiro Takahashi		${.CURDIR}/${TARGET}/drivers-small.conf \
1051d1d60923SYoshihiro Takahashi		${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
1052d1d60923SYoshihiro Takahashi.elif exists(${.CURDIR}/${TARGET}/drivers.conf)
1053319f35a3SRuslan Ermilov	@awk -f ${.CURDIR}/scripts/driver-remove.awk \
1054319f35a3SRuslan Ermilov		${.CURDIR}/${TARGET}/drivers.conf \
1055319f35a3SRuslan Ermilov		${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
1056319f35a3SRuslan Ermilov.endif
10576bde859fSRuslan Ermilov	cd ${.CURDIR}/..; \
10586bde859fSRuslan Ermilov	KERNEL_KO=BOOTMFS KODIR= \
105974064f9fSRuslan Ermilov	    ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES -DNO_KERNELCLEAN \
1060eed31dc9SRuslan Ermilov	    KERNCONF=BOOTMFS COPTFLAGS="-Os -pipe" -DNO_CPU_COPTFLAGS \
1061407ac59aSJohn Hay	    buildkernel reinstallkernel \
10626bde859fSRuslan Ermilov	    DESTDIR=${RD}/kernels
10632efba2d1SRuslan Ermilov	[ -r ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ] && \
10648f1f55e9SRuslan Ermilov	cp ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ${RD}/kernels
1065643f7da0SJordan K. Hubbard	@rm -rf ${RD}/image.${FSIMAGE}
1066643f7da0SJordan K. Hubbard	@mkdir ${RD}/image.${FSIMAGE}
1067fff8eb57SJohn Baldwin	@cd ${RD}/kernels && \
1068937d0d51SDon Lewis	  (chflags noschg BOOTMFS || true) && \
1069dbc9acf4SRuslan Ermilov	  ${WMAKEENV} strip -R .comment BOOTMFS && \
1070fff8eb57SJohn Baldwin	  cp BOOTMFS BOOTMFS.${FSIMAGE} && \
1071fff8eb57SJohn Baldwin	  [ -r BOOTMFS.hints ] && mv BOOTMFS.hints BOOTMFS.${FSIMAGE}.hints
107292e86f99SJordan K. Hubbard	mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
107392e86f99SJordan K. Hubbard	@echo "Setting up /boot directory for ${FSIMAGE} floppy"
1074643f7da0SJordan K. Hubbard	@mkdir -p ${RD}/image.${FSIMAGE}/boot
10758f1f55e9SRuslan Ermilov.if ${TARGET} == "i386"
1076c54fbe8dSRuslan Ermilov	@${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o \
1077c54fbe8dSRuslan Ermilov	    -o ${RD}/image.${FSIMAGE}/boot/loader ${RD}/trees/base/boot/loader
107873824f6bSRuslan Ermilov.elif ${TARGET_ARCH} == "ia64"
1079977a68ccSYoshihiro Takahashi	@cp ${RD}/trees/base/boot/loader.efi ${RD}/image.${FSIMAGE}/boot
10804b60693cSMakoto Matsushita.else
1081977a68ccSYoshihiro Takahashi	@cp ${RD}/trees/base/boot/loader ${RD}/image.${FSIMAGE}/boot
10824b60693cSMakoto Matsushita.endif
1083fff8eb57SJohn Baldwin	@[ -r ${RD}/kernels/BOOTMFS.${FSIMAGE}.hints ] && \
1084fff8eb57SJohn Baldwin	  sed -e '/^hint/s/^/set /' -e '/^#/d' \
1085fff8eb57SJohn Baldwin	    ${RD}/kernels/BOOTMFS.${FSIMAGE}.hints > \
1086fff8eb57SJohn Baldwin	    ${RD}/image.${FSIMAGE}/boot/device.hints && \
1087fff8eb57SJohn Baldwin	  echo "include /boot/device.hints" > ${RD}/image.${FSIMAGE}/boot/loader.rc
1088fff8eb57SJohn Baldwin	@echo "load /kernel" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
108904063000SJohn W. De Boskey.if !defined(FDSIZE) || ${FDSIZE} != "BIG"
1090f7a68483SMasafumi Max NAKANE	@echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1091c8fe5d2aSMike Smith	@echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1092c8fe5d2aSMike Smith	@echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
109396a3add7SMasafumi Max NAKANE.endif
1094839dfafeSJohn Baldwin	@echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
10959cdb5b17SMarcel Moolenaar.if ${TARGET_ARCH} != "ia64"
1096886ce72aSMakoto Matsushita	@echo "set hint.acpi.0.disabled=1" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
10979cdb5b17SMarcel Moolenaar.endif
1098f7ad577fSScott Long	@if [ -r ${RD}/floppies/drivers.flp ]; then \
1099f7ad577fSScott Long	    echo "set driver_floppy=YES" >> ${RD}/image.${FSIMAGE}/boot/loader.rc; \
1100f7ad577fSScott Long	fi
110170accddfSJohn Baldwin	@echo "set module_path=\"/modules;/dist\"" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
110296a3add7SMasafumi Max NAKANE	@echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
110378e52c11SMasafumi Max NAKANE	@echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
11048f1f55e9SRuslan Ermilov.if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
110596a3add7SMasafumi Max NAKANE	@echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config
11068198d9b0SJordan K. Hubbard.endif
11077953e823SJordan K. Hubbard	@gzip -9v ${RD}/image.${FSIMAGE}/kernel
1108643f7da0SJordan K. Hubbard	@rm -f ${RD}/floppies/${FSIMAGE}.flp
11097920b17fSYoshihiro Takahashi.if defined(FDSIZE) && ${FDSIZE} == "BIG"
11103d610ec8SRuslan Ermilov	@cp ${RD}/mfsroot/mfsroot.gz ${RD}/image.${FSIMAGE}
1111f3fb0a6cSMarcel Moolenaar	sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp \
1112b5d01310SJordan K. Hubbard		${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \
1113b5d01310SJordan K. Hubbard		${BOOTINODE} ${BIGBOOTLABEL}
11147920b17fSYoshihiro Takahashi.elif defined(FDSIZE) && ${FDSIZE} == "SMALL"
1115f8cc06beSRuslan Ermilov	sh -e ${DOFS_SH} ${RD}/floppies/mfsroot-small.flp \
11166daa108fSRuslan Ermilov		${RD} ${MNT} ${SMALLBOOTSIZE} ${RD}/mfsroot-small/mfsroot.gz \
1117f8cc06beSRuslan Ermilov		${BOOTINODE} ${SMALLBOOTLABEL}
1118f3fb0a6cSMarcel Moolenaar	sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp \
11197920b17fSYoshihiro Takahashi		${RD} ${MNT} ${SMALLBOOTSIZE} ${RD}/image.${FSIMAGE} \
11207920b17fSYoshihiro Takahashi		${BOOTINODE} ${SMALLBOOTLABEL}
112150895b89SJordan K. Hubbard.else
1122f8cc06beSRuslan Ermilov	sh -e ${DOFS_SH} ${RD}/floppies/mfsroot.flp \
1123f8cc06beSRuslan Ermilov		${RD} ${MNT} ${BOOTSIZE} ${RD}/mfsroot/mfsroot.gz \
1124f8cc06beSRuslan Ermilov		${BOOTINODE} ${BOOTLABEL}
1125f3fb0a6cSMarcel Moolenaar	sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp \
112692e86f99SJordan K. Hubbard		${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \
112792e86f99SJordan K. Hubbard		${BOOTINODE} ${BOOTLABEL}
112850895b89SJordan K. Hubbard.endif
112992e86f99SJordan K. Hubbard	@echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1130270ee878SJohn W. De Boskey
11318eb4e096SRuslan Ermilov.include <bsd.obj.mk>
1132