xref: /freebsd/release/Makefile (revision b03ddec95f14af316c897ca9be31fd80dbb31198)
197d92980SPeter Wemm# $FreeBSD$
20202c140SRodney W. Grimes#
3dba36bb9SRuslan Ermilov# make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \
4b03ddec9SJohn Baldwin#     [RELEASETAG=tag] [SVNROOT=svn://svn.freebsd.org/base] \
5b03ddec9SJohn Baldwin#     [SVNBRANCH=some/branch]
6bd668f6fSPoul-Henning Kamp#
7faec9c80SJeroen Ruigrok van der Werven# Where "/some/dir" is the pathname of a directory on a some filesystem with
8faec9c80SJeroen Ruigrok van der Werven# at least 1000MB of free space, "somename" is what you want the release to
9faec9c80SJeroen Ruigrok van der Werven# call itself, "/cvs/dir" is where our source repo resides and, optionally,
10faec9c80SJeroen Ruigrok van der Werven# which CVS "tag" name should be used when checking out the sources to build
11faec9c80SJeroen Ruigrok van der Werven# the release (default is HEAD).
12bd668f6fSPoul-Henning Kamp#
13b03ddec9SJohn Baldwin# Please note the support for building from SVN is preliminary and there
14b03ddec9SJohn Baldwin# are still questions about things like how to handle updates of
15b03ddec9SJohn Baldwin# /usr/src on production systems (csup(1) replacement).  It is a work
16b03ddec9SJohn Baldwin# in progress and may change as the other issues get worked out.
17b03ddec9SJohn Baldwin#
18dba36bb9SRuslan Ermilov# Please note: the md(4) driver must be present in the kernel
19919b0026SDavid E. O'Brien# (either by being compiled in or available as a kld(4) module),
205355286aSColin Percival# otherwise the target 'release.8' and possibly others will fail.
21f1a03fb6SAndreas Klemm#
220874402dSMurray Stokely# Note: If you add options to this file, please keep release(7) updated!
230874402dSMurray Stokely#
24aeb6d603SJordan K. Hubbard# Set these, release builder!
25d013a27bSJoerg Wunsch#
26d013a27bSJoerg Wunsch# Fixed version:
27c15e0967SKen Smith#BUILDNAME=8.0-CURRENT
28d013a27bSJoerg Wunsch#
29d013a27bSJoerg Wunsch# Automatic SNAP versioning:
30fcab936bSDag-Erling SmørgravDATE != date +%Y%m%d
31c15e0967SKen SmithBASE = 8.0
3264938abfSJordan K. HubbardBUILDNAME?=${BASE}-${DATE}-SNAP
33d013a27bSJoerg Wunsch#
34fe85fe95SJordan K. Hubbard#CHROOTDIR=/junk/release
353da2229cSBrian Somers# If this is a -stable snapshot, then set
36c15e0967SKen Smith#RELEASETAG=RELENG_7
37d751ad7fSJohn W. De Boskey#
3898b2ae09SMark Murray# To test a release with a source tree containing patches and
3998b2ae09SMark Murray# other work. This tree will get copied instead of getting the
4098b2ae09SMark Murray# src/ tree from a CVS checkout. For "rerelease", this will NOT
4198b2ae09SMark Murray# be copied; cvs update will be used instead.
4298b2ae09SMark Murray#EXTSRCDIR=/usr/src
4398b2ae09SMark Murray#
44fcb9ab1eSYoshihiro Takahashi# To use a checked-out ports collection directory instead of
45fcb9ab1eSYoshihiro Takahashi# checking out from a local CVS repository, set this option.
46fcb9ab1eSYoshihiro Takahashi#EXTPORTSDIR=/usr/ports
47fcb9ab1eSYoshihiro Takahashi#
48944bc81dSMarc Fonvieille# To use a checked-out doc/ directory instead of
49944bc81dSMarc Fonvieille# checking out from a local CVS repository, set this option.
50944bc81dSMarc Fonvieille#EXTDOCDIR=/usr/doc
51944bc81dSMarc Fonvieille#
52d751ad7fSJohn W. De Boskey# To add other options to the CVS subcommands (co,up), set
532b3f8b22SMakoto Matsushita#CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
543f17d264SSatoshi Asami#
55d751ad7fSJohn W. De Boskey# To add other options to the CVS command, set
56d751ad7fSJohn W. De Boskey#CVSARGS="-lfq"
57d751ad7fSJohn W. De Boskey#
58b03ddec9SJohn Baldwin# To prefix the CVS command
59d751ad7fSJohn W. De Boskey#CVSPREFIX="/usr/bin/time"
60d751ad7fSJohn W. De Boskey#
6198b2ae09SMark Murray# Where the CVS repository is
6298b2ae09SMark Murray#CVSROOT="/home/ncvs"
6398b2ae09SMark Murray#
64b03ddec9SJohn Baldwin# To add other options to the Subversion subcommands (co,up), set
65b03ddec9SJohn Baldwin#SVNCMDARGS="-r '{ 01/01/2002 00:00:00 UTC }'"
66b03ddec9SJohn Baldwin#
67b03ddec9SJohn Baldwin# To prefix the Subversion command
68b03ddec9SJohn Baldwin#SVNPREFIX="/usr/bin/time"
69b03ddec9SJohn Baldwin#
70b03ddec9SJohn Baldwin# Where the Subversion repository is
71b03ddec9SJohn Baldwin#SVNROOT=svn://svn.freebsd.org/base
72b03ddec9SJohn Baldwin#
73b03ddec9SJohn Baldwin# Subversion branch to build for src.  If this is not set then it is
74b03ddec9SJohn Baldwin# automatically computed from RELEASETAG.
75b03ddec9SJohn Baldwin#SVNBRANCH=stable/7
76b03ddec9SJohn Baldwin#
773f17d264SSatoshi Asami# Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
783f17d264SSatoshi Asami# are building an official release.  Otherwise, we are building for
793f17d264SSatoshi Asami# a branch.
803f17d264SSatoshi Asami.if defined(RELEASETAG)
81be1234f2SPoul-Henning KampISRELEASE!=	expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true
823f17d264SSatoshi Asami.if ${ISRELEASE} != 0
833f17d264SSatoshi Asami# Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
843f17d264SSatoshi AsamiAUXRELEASETAG!=	echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
855be3b5d9SJordan K. HubbardDOCRELEASETAG?=		${AUXRELEASETAG}
865be3b5d9SJordan K. HubbardPORTSRELEASETAG?=	${AUXRELEASETAG}
873f17d264SSatoshi Asami.endif
883f17d264SSatoshi Asami.endif
89ab0e9cdcSPoul-Henning Kamp
90b03ddec9SJohn Baldwin# Determine the Subversion source branch that corresponds to the requested
91b03ddec9SJohn Baldwin# RELEASETAG.
92b03ddec9SJohn Baldwin.if !defined(SVNBRANCH)
93b03ddec9SJohn Baldwin.if defined(RELEASETAG)
94b03ddec9SJohn BaldwinSVNBRANCH!=	echo "${RELEASETAG}" | awk -f ${.CURDIR}/svnbranch.awk
95b03ddec9SJohn Baldwin.else
96b03ddec9SJohn BaldwinSVNBRANCH=	head
97b03ddec9SJohn Baldwin.endif
98b03ddec9SJohn Baldwin.endif
99b03ddec9SJohn Baldwin
100fff8eb57SJohn Baldwin# If you want to pass flags to the world build such as -j X, use
101fff8eb57SJohn Baldwin# WORLD_FLAGS.  Similarly, you can specify make flags for kernel
102fff8eb57SJohn Baldwin# builds via KERNEL_FLAGS.
103fc944573SKen Smith#WORLD_FLAGS=-j4
104fc944573SKen Smith#KERNEL_FLAGS=-j4
105fff8eb57SJohn Baldwin
1068f1f55e9SRuslan ErmilovTARGET_ARCH?=	${MACHINE_ARCH}
1078f1f55e9SRuslan Ermilov.if ${TARGET_ARCH} == ${MACHINE_ARCH}
1088f1f55e9SRuslan ErmilovTARGET?=	${MACHINE}
1098f1f55e9SRuslan Ermilov.else
1108f1f55e9SRuslan ErmilovTARGET?=	${TARGET_ARCH}
1118f1f55e9SRuslan Ermilov.endif
1125dc63117SRuslan ErmilovCROSSENV=	TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
1135dc63117SRuslan ErmilovCROSSMAKE=	${MAKE} ${CROSSENV}
11461c2d47aSRuslan ErmilovNATIVEMAKE=	${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
1158f1f55e9SRuslan Ermilov
1160c9cba52SMike Smith# If you are using a local CVS repository with components stored in
1170c9cba52SMike Smith# non-standard modules, override these on the make commandline or
1180c9cba52SMike Smith# in the environment.
1190c9cba52SMike SmithRELEASESRCMODULE?=	src
1200c9cba52SMike SmithRELEASEDOCMODULE?=	doc
1210c9cba52SMike SmithRELEASEPORTSMODULE?=	ports
1220c9cba52SMike Smith
123dd1a1b3dSJoerg Wunsch# Uncomment this to disable the doc.1 target.  Docs normally require
124dd1a1b3dSJoerg Wunsch# the ports tree, so NOPORTS can be set together with NODOC in order
125dd1a1b3dSJoerg Wunsch# to have neither ports or docs.  If only NOPORTS is set to YES, but
126dd1a1b3dSJoerg Wunsch# docs are still desired, the DOMINIMALDOCPORTS logic below will only
127944bc81dSMarc Fonvieille# install the ports that are minimally required for the release note documentation.  This is
128dd1a1b3dSJoerg Wunsch# intended as a compromise, less disk space is required than for using
12923ef6da7STom Rhodes# the entire ports collection (and much less time due to the huge number
130dd1a1b3dSJoerg Wunsch# of directories it would create), but still quite a bit as well as some
131dd1a1b3dSJoerg Wunsch# CPU cycles (some of the programs are C++, and things like ghostscript
132dd1a1b3dSJoerg Wunsch# belong to the required ports nevertheless).
133dd1a1b3dSJoerg Wunsch#
13485486998SJordan K. Hubbard#NODOC=  YES
135d6c7028cSJohn Hay#NOPORTS=  YES
1368ed3802bSBruce A. Mah
137182d7632SRuslan Ermilov# When retrieving ports using the pkg_add -r method, set your proxies to these.
138182d7632SRuslan Ermilov# src/release/${arch}/mkisoimages.sh can use these.
139182d7632SRuslan Ermilov#HTTP_PROXY?=	www.example.com
140182d7632SRuslan Ermilov#FTP_PROXY?=	ftp.example.com
141182d7632SRuslan Ermilov
142b2200964SJohn Baldwin# When creating ISO images, point ${CD_PACKAGE_TREE} to a directory containing
143b2200964SJohn Baldwin# the package split by an earlier invocation of the 'package-split' target.
144b2200964SJohn Baldwin#CD_PACKAGE_TREE=	/path/to/pkg
145182d7632SRuslan Ermilov
146182d7632SRuslan Ermilov# Extra source tarballs; each argument is a pair of source dir and
147182d7632SRuslan Ermilov# distribution name.  The dist name should not exceed 7 characters
148182d7632SRuslan Ermilov# (another "s" for "source" will be prepended).
149182d7632SRuslan Ermilov#EXTRA_SRC=	games/fortune fortune
150182d7632SRuslan Ermilov
1517a7a00adSRuslan Ermilov# Modify this definition if you want the release notes
15239ab86fdSBruce A. Mah# and other release documentation in a language other than English.
1537a7a00adSRuslan ErmilovRELNOTES_LANG?=	en_US.ISO8859-1
1548ed3802bSBruce A. Mah
155dd1a1b3dSJoerg Wunsch# As an alternative to installing the entire ports collection (which
156dd1a1b3dSJoerg Wunsch# can take a huge amount of time, in particular on slower disks),
157dd1a1b3dSJoerg Wunsch# setting ${MINIMALDOCPORTS} allows to install and build just those
158dd1a1b3dSJoerg Wunsch# ports that are really required for getting the docs up & running.
159dd1a1b3dSJoerg Wunsch.if defined(NOPORTS) && !defined(NODOC)
160dd1a1b3dSJoerg WunschDOMINIMALDOCPORTS=	YES
161dd1a1b3dSJoerg Wunsch.include "Makefile.inc.docports"
162d8e78869SMarcel MoolenaarRELEASEPORTSMODULE=	${MINIMALDOCPORTS} ports/sysutils/cdrtools
163dd1a1b3dSJoerg Wunsch.endif
164dd1a1b3dSJoerg Wunsch
165dd1a1b3dSJoerg Wunsch# Helper variable
166dd1a1b3dSJoerg Wunsch.if defined(NOPORTS)
167dd1a1b3dSJoerg Wunsch.if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
168dd1a1b3dSJoerg WunschNOPORTSATALL=	YES
169dd1a1b3dSJoerg Wunsch.endif
170dd1a1b3dSJoerg Wunsch.endif
171dd1a1b3dSJoerg Wunsch
172485b9268SKen Smith#
173485b9268SKen Smith# Doing 'make index' in /usr/ports requires Perl.
174485b9268SKen SmithMAKEINDEXPORTS=	lang/perl5.8
1752f332092SJordan K. HubbardDOCPORTS=	textproc/docproj
17640227c90SMakoto Matsushita# Set this to wherever the distfiles required by release procedures.
17740227c90SMakoto Matsushita.if defined(DOCDISTFILES)
17840227c90SMakoto Matsushita# Respect DOCDISTFILES which is used before.
17940227c90SMakoto MatsushitaRELEASEDISTFILES?=	${DOCDISTFILES}
18040227c90SMakoto Matsushita.else
18140227c90SMakoto MatsushitaRELEASEDISTFILES?=	${.CURDIR}/../../ports/distfiles
18240227c90SMakoto Matsushita.endif
183ce51a9fcSJordan K. Hubbard# Set this to 1 if you want -P to be used for automatic keyboard detection
184ce51a9fcSJordan K. Hubbard# on the boot floppy.  WARNING: Breaks on some Athlon (K7) motherboards.
185ce51a9fcSJordan K. HubbardAUTO_KEYBOARD_DETECT?= 0
186ce51a9fcSJordan K. Hubbard
18721203b38SBruce A. Mah.if !defined(NODOC)
188e1ae210aSBruce A. MahDIST_DOCS_ARCH_INDEP=	hardware readme relnotes errata
189f08071c0SBruce A. MahDIST_DOCS_ARCH_DEP=
1908ed3802bSBruce A. Mah.endif
191ed517874SJordan K. Hubbard
192bd668f6fSPoul-Henning Kamp# Things which without too much trouble can be considered variables
19301df2ec3SDavid E. O'Brien# BASE_DISTS are special in that they get full /etc installation sets.
1947284556fSJordan K. Hubbard#
195ece6831dSRuslan ErmilovOTHER_DISTS?=	catpages manpages games proflibs dict info doc ${ARCH_DISTS}
19601df2ec3SDavid E. O'BrienBASE_DISTS?=	base
197ece6831dSRuslan Ermilov.if ${TARGET_ARCH} == "amd64"
198ece6831dSRuslan ErmilovARCH_DISTS?=	lib32
199ece6831dSRuslan Ermilov.endif
200c6d8b958SDavid E. O'BrienDISTRIBUTIONS?=	${BASE_DISTS} ${OTHER_DISTS}
201785bd4b4SPoul-Henning Kamp
2029fe7600bSSam Leffler#
2039fe7600bSSam Leffler# Build and package both GENERIC and SMP kernels if the target
2049fe7600bSSam Leffler# has both configuration files.  Otherwise only GENERIC is done.
2059fe7600bSSam Leffler#
206eb765a4dSRuslan Ermilov.if exists(${.CURDIR}/../sys/${TARGET}/conf/SMP)
207fdb71eeeSSam LefflerKERNELS_BASE?=	GENERIC SMP
208fdb71eeeSSam Leffler.else
209fdb71eeeSSam LefflerKERNELS_BASE?=	GENERIC
2109fe7600bSSam Leffler.endif
2119fe7600bSSam Leffler
2127c474103SPoul-Henning Kamp# mountpoint for filesystems.
2137c474103SPoul-Henning KampMNT=			/mnt
214518a1d34SPoul-Henning Kamp
215a5ddb8cfSJordan K. Hubbard# Various floppy image parameters.
216a5ddb8cfSJordan K. Hubbard#
217b98c5f70STatsumi Hosokawa
21894223a53SDavid E. O'Brien.undef MAKE_FLOPPIES
2198f1f55e9SRuslan Ermilov.if ${TARGET_ARCH} == "i386"
2202e3a1557SKen SmithMAKE_DVD=
2211bf7496cSKen SmithSEPARATE_LIVEFS=
2227404bf51SKen SmithSPLIT_MFSROOT=
2238f1f55e9SRuslan Ermilov.if ${TARGET} == "pc98"
224e4506c14SYoshihiro TakahashiMAKE_FLOPPIES=		true
225c0731f81SJohn BaldwinSMALLFLOPPYSIZE=	1200
226c0731f81SJohn BaldwinSMALLFLOPPYSPLITSIZE=	1152
227c0731f81SJohn BaldwinSMALLFLOPPYLABEL=	fd1200
22813ff581dSJohn BaldwinSPLIT_MFSROOT=
229a40915d7SYoshihiro Takahashi.endif
230c0731f81SJohn BaldwinFLOPPYSIZE=		1440
231c0731f81SJohn BaldwinFLOPPYSPLITSIZE=	1392
232c0731f81SJohn BaldwinFLOPPYINODE=		40000
233c0731f81SJohn BaldwinFLOPPYLABEL=		fd1440
234d943f83bSJohn BaldwinBOOTINODE=		80000
235d943f83bSJohn BaldwinMFSSIZE=		4320
236d943f83bSJohn BaldwinMFSINODE=		8000
237c0731f81SJohn BaldwinMFSLABEL=		minimum3
238c26d9e5aSJake Burkholder.elif ${TARGET_ARCH} == "sparc64"
239c9030dc8SRuslan ErmilovDISKLABEL=		sunlabel
2403dddceccSKen SmithMAKE_DVD=
241c26d9e5aSJake BurkholderMFSSIZE=		4096
242c26d9e5aSJake BurkholderMFSINODE=		8192
243c26d9e5aSJake BurkholderMFSLABEL=		auto
244a4f9e93cSRuslan ErmilovMINIROOT=
245710d4ca3SMarcel Moolenaar.elif ${TARGET_ARCH} == "ia64"
24670d8932fSMarcel MoolenaarDISKLABEL=		""
247ed9f3351SMarcel MoolenaarMAKE_DVD=
248d943f83bSJohn BaldwinMFSSIZE=		8192
249710d4ca3SMarcel MoolenaarMFSINODE=		8192
250710d4ca3SMarcel MoolenaarMFSLABEL=		auto
251f16d1c7cSJohn BaldwinSEPARATE_LIVEFS=
2522d7d81e9SPeter Wemm.elif ${TARGET_ARCH} == "amd64"
2532e3a1557SKen SmithMAKE_DVD=
254c5245e57SJohn BaldwinFLOPPYSIZE=		1440
255c5245e57SJohn BaldwinFLOPPYSPLITSIZE=	1392
256c5245e57SJohn BaldwinFLOPPYINODE=		40000
257c5245e57SJohn BaldwinFLOPPYLABEL=		fd1440
258c5245e57SJohn BaldwinBOOTINODE=		80000
2592d7d81e9SPeter WemmMFSSIZE=		4096
2602d7d81e9SPeter WemmMFSINODE=		8192
2612d7d81e9SPeter WemmMFSLABEL=		auto
262eb173edbSKen SmithSEPARATE_LIVEFS=
26365030cb8SKen SmithSPLIT_MFSROOT=
264fa7bd283SPeter Grehan.elif ${TARGET_ARCH} == "powerpc"
265fa7bd283SPeter GrehanDISKLABEL=		""
266fa7bd283SPeter GrehanMFSSIZE=		4096
267fa7bd283SPeter GrehanMFSINODE=		8192
268fa7bd283SPeter GrehanMFSLABEL=		auto
26924aade12SPeter GrehanSEPARATE_LIVEFS=
2707f047619SJoerg Wunsch.endif
271f0414231SDavid E. O'Brien.if defined(NO_FLOPPIES)
272f0414231SDavid E. O'Brien.undef MAKE_FLOPPIES
273f0414231SDavid E. O'Brien.endif
2740202c140SRodney W. Grimes
2755795760cSRuslan Ermilov.if exists(/sbin/bsdlabel)
2765795760cSRuslan ErmilovDISKLABEL?=		bsdlabel
2775795760cSRuslan Ermilov.else
278c9030dc8SRuslan ErmilovDISKLABEL?=		disklabel
2795795760cSRuslan Ermilov.endif
280c9030dc8SRuslan Ermilov
281569acadfSDavid E. O'BrienZIPPER=			gzip -9 --no-name
282569acadfSDavid E. O'BrienZIPNSPLIT=		${ZIPPER} -c | split -b 1392k -
28300063f88SPoul-Henning Kamp
2847284556fSJordan K. Hubbard# Things which may get you into trouble if you change them
28548327bc9SPoul-Henning KampMTREEFILES=		${.CURDIR}/../etc/mtree
28672995602SDavid E. O'Brien_R?=			/R
287335d64e6SJordan K. HubbardRD=			${_R}/stage
288febbbc67SBruce A. MahRND=			${RD}/release.doc
289335d64e6SJordan K. HubbardFD=			${_R}/ftp
290335d64e6SJordan K. HubbardCD=			${_R}/cdrom
2916daa108fSRuslan ErmilovCD_BOOT=		${CD}/bootonly
2921bac119bSJordan K. HubbardCD_DISC1=		${CD}/disc1
2931bac119bSJordan K. HubbardCD_DISC2=		${CD}/disc2
2942e3a1557SKen Smith.if defined(MAKE_DVD)
29589811440SKen SmithCD_DVD1=		${CD}/dvd1
2962e3a1557SKen Smith.endif
297639fe104SKen Smith.if !defined(NODOC)
298639fe104SKen SmithCD_DOCS=		${CD}/docs
299639fe104SKen Smith.endif
300b2200964SJohn Baldwin.if defined(SEPARATE_LIVEFS)
301b2200964SJohn BaldwinCD_LIVEFS=		${CD}/livefs
30292f6e2c8SJohn Baldwin.else
30392f6e2c8SJohn BaldwinCD_LIVEFS=		${CD_DISC1}
30488f69650SKen Smith.endif
30592f6e2c8SJohn Baldwin_MK?=			${CHROOTDIR}/mk
30688f69650SKen Smith
3070c5b292cSJordan K. Hubbard# Where the bootstrap ports (see DOCPORTS) get installed.
3080c5b292cSJordan K. HubbardLOCALDIR=		/usr/local/bin
3090c5b292cSJordan K. Hubbard
310a4f9e93cSRuslan Ermilov.if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
311c9030dc8SRuslan ErmilovDOFS_SH=	${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
312f3fb0a6cSMarcel Moolenaar.else
313c9030dc8SRuslan ErmilovDOFS_SH=	${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
314f3fb0a6cSMarcel Moolenaar.endif
315f3fb0a6cSMarcel Moolenaar
316c26d9e5aSJake BurkholderCRUNCH_TARGETS=	boot
3173cd22041SRuslan Ermilov.if ${TARGET_ARCH} == "i386"
3183cd22041SRuslan ErmilovCRUNCH_TARGETS+=fixit
3193cd22041SRuslan Ermilov.if ${TARGET} == "pc98"
3203cd22041SRuslan ErmilovCRUNCH_TARGETS+=fixit-small
321c26d9e5aSJake Burkholder.endif
3223cd22041SRuslan Ermilov.endif
3233525074dSPoul-Henning Kamp
32494223a53SDavid E. O'Brien.if defined(MAKE_FLOPPIES)
325aaf3e5b0SJohn BaldwinEXTRAS= floppies.1
326aaf3e5b0SJohn Baldwin.if ${TARGET_ARCH} == "i386"
327aaf3e5b0SJohn BaldwinEXTRAS+= floppies.2
328aaf3e5b0SJohn Baldwin.endif
329aaf3e5b0SJohn BaldwinEXTRAS+= floppies.3
330c0731f81SJohn Baldwin.endif
331c0731f81SJohn BaldwinEXTRAS+= ftp.1
3320e25a727SJohn Baldwin.if !defined(NOCDROM)
33392f6e2c8SJohn BaldwinEXTRAS+= cdrom.1 cdrom.2 cdrom.3
3342ef74d22SJordan K. Hubbard.if defined(MAKE_ISOS)
3352ef74d22SJordan K. HubbardEXTRAS+= iso.1
33698f15514SMurray Stokely.endif
337d943f83bSJohn Baldwin.if ${TARGET} == "pc98"
338ef6cf7f1SYoshihiro TakahashiBOOTABLE="-G"
3396ebe9601SRuslan Ermilov.else
34029921a60SYoshihiro TakahashiBOOTABLE="-b"
34129921a60SYoshihiro Takahashi.endif
3422ef74d22SJordan K. Hubbard.endif
343793e8c6fSJordan K. Hubbard
344793e8c6fSJordan K. Hubbard.if !defined(NODOC)
34521203b38SBruce A. MahDOCREL= doc.1 doc.2
346793e8c6fSJordan K. Hubbard.endif
347793e8c6fSJordan K. Hubbard
348e738d1eaSJohn Baldwin.if !make(release) && !make(rerelease) && !make(package-split)
3495dc63117SRuslan ErmilovBINMAKE!=	cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
3505dc63117SRuslan ErmilovWMAKEENV!=	cd ${.CURDIR}/..; \
3515dc63117SRuslan Ermilov		${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
3525dc63117SRuslan ErmilovWMAKE=		${WMAKEENV} ${BINMAKE}
3539b72ad91SRuslan Ermilov.endif
3546bde859fSRuslan Ermilov
355d9d84e07SJohn BaldwinCVS_SRCARGS=	-P
356d9d84e07SJohn Baldwin.if defined(RELEASETAG)
357d9d84e07SJohn BaldwinCVS_SRCARGS+=	-r ${RELEASETAG}
358d9d84e07SJohn Baldwin.endif
359d9d84e07SJohn Baldwin
360d9d84e07SJohn BaldwinCVS_DOCARGS=	-P
361d9d84e07SJohn Baldwin.if defined(DOCRELEASETAG)
362d9d84e07SJohn BaldwinCVS_DOCARGS+=	-r ${DOCRELEASETAG}
363d9d84e07SJohn Baldwin.endif
364d9d84e07SJohn Baldwin
365d9d84e07SJohn BaldwinCVS_PORTSARGS=	-P
366d9d84e07SJohn Baldwin.if defined(PORTSRELEASETAG)
367d9d84e07SJohn BaldwinCVS_PORTSARGS+=	-r ${PORTSRELEASETAG}
368d9d84e07SJohn Baldwin.endif
369d9d84e07SJohn Baldwin
37000a7eeebSRuslan ErmilovWORLDDIR?=	${.CURDIR}/..
37100a7eeebSRuslan Ermilov
372dba36bb9SRuslan Ermilovrelease rerelease:
373b03ddec9SJohn Baldwin.if !defined(CHROOTDIR) || !defined(BUILDNAME)
374b03ddec9SJohn Baldwin	@echo "To make a release you must set CHROOTDIR and BUILDNAME" && false
375b03ddec9SJohn Baldwin.endif
376b03ddec9SJohn Baldwin.if !defined(NOPORTSATALL) && !defined(EXTPORTSDIR) && !defined(CVSROOT)
377b03ddec9SJohn Baldwin	@echo "Building ports requires CVSROOT or EXTPORTSDIR" && false
378b03ddec9SJohn Baldwin.endif
379b03ddec9SJohn Baldwin.if !defined(NODOC) && !defined(EXTDOCDIR) && !defined(CVSROOT)
380b03ddec9SJohn Baldwin	@echo "Building docs requires CVSROOT or EXTDOCDIR" && false
381b03ddec9SJohn Baldwin.endif
382b03ddec9SJohn Baldwin.if !defined(EXTSRCDIR) && !defined(CVSROOT) && !defined(SVNROOT)
383b03ddec9SJohn Baldwin	@echo "The source tree requires SVNROOT, CVSROOT, or EXTSRCDIR" && false
3847eb11201SPoul-Henning Kamp.endif
385dd1a1b3dSJoerg Wunsch.if defined(NOPORTSATALL) && !defined(NODOC)
386944bc81dSMarc Fonvieille	@echo "Ports are required for building the release docs.  Either set NODOC or"
387dd1a1b3dSJoerg Wunsch	@echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
388d191a99cSJohn Baldwin	@exit 1
389d191a99cSJohn Baldwin.endif
390db8714afSJohn Baldwin.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
391db8714afSJohn Baldwin.for p in ${LOCAL_PATCHES}
392db8714afSJohn Baldwin.if !exists(${p})
393db8714afSJohn Baldwin	@echo "The patch file ${p} does not exist!"
394db8714afSJohn Baldwin	@exit 1
395db8714afSJohn Baldwin.endif
396db8714afSJohn Baldwin.endfor
397db8714afSJohn Baldwin.endif
398db8714afSJohn Baldwin.if defined(LOCAL_SCRIPT) && !exists(${LOCAL_SCRIPT})
399db8714afSJohn Baldwin	@echo "The local script ${LOCAL_SCRIPT} does not exist!"
400db8714afSJohn Baldwin	@exit 1
401db8714afSJohn Baldwin.endif
402288fe4dbSPoul-Henning Kamp.if make(release)
403682078bdSRodney W. Grimes.if exists(${CHROOTDIR})
40472ac7e4dSJohn Polstra# The first command will fail on a handful of files that have their schg
40572ac7e4dSJohn Polstra# flags set.  But it greatly speeds up the next two commands.
40637c38153SRuslan Ermilov	# NB: clear any vestigial devfs mount, just in case
4076ceb41c2SSam Leffler	-umount ${CHROOTDIR}/dev > /dev/null 2>&1
40827b5e4fdSJordan K. Hubbard	-rm -rf ${CHROOTDIR} 2>/dev/null
40937966461SRuslan Ermilov	-chflags -R 0 ${CHROOTDIR}/.
410b7738481SJoerg Wunsch	-rm -rf ${CHROOTDIR}
411682078bdSRodney W. Grimes.endif
412335d64e6SJordan K. Hubbard	mkdir -p ${CHROOTDIR}
413b1a8a181SRuslan Ermilov	@echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
4145740a2b6SRuslan Ermilov	cd ${WORLDDIR} && ${NATIVEMAKE} -DWITHOUT_GAMES -DWITHOUT_HTML -DWITHOUT_LIB32 \
4155740a2b6SRuslan Ermilov	    -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE installworld DESTDIR=${CHROOTDIR}
4163b090ef7SJohn Baldwin	cd ${WORLDDIR} && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
4178e8d540fSSADA Kenji	if [ -f /etc/resolv.conf ]; then \
4188e8d540fSSADA Kenji		cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
4198e8d540fSSADA Kenji	fi
420d101bd64SYoshihiro Takahashi.if defined(EXTLOCALDIR)
421d101bd64SYoshihiro Takahashi	rm -rf ${CHROOTDIR}/usr/local
422a4b4ec99SJuli Mallett	cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
423d101bd64SYoshihiro Takahashi.endif
424d9d84e07SJohn Baldwin	rm -rf ${CHROOTDIR}/usr/src
425d9d84e07SJohn Baldwin.if defined(EXTSRCDIR)
426d9d84e07SJohn Baldwin	cd ${CHROOTDIR}/usr && \
427a4b4ec99SJuli Mallett	    cp -R -H ${EXTSRCDIR} src
428b03ddec9SJohn Baldwin.elif defined(SVNROOT)
429b03ddec9SJohn Baldwin	cd ${CHROOTDIR}/usr && \
430b03ddec9SJohn Baldwin	    ${SVNPREFIX} svn co ${SVNCMDARGS} ${SVNROOT}/${SVNBRANCH} \
431b03ddec9SJohn Baldwin	    ${RELEASESRCMODULE}
432bd668f6fSPoul-Henning Kamp.else
433d9d84e07SJohn Baldwin	cd ${CHROOTDIR}/usr && \
434b34a415eSDavid E. O'Brien	    ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
435b34a415eSDavid E. O'Brien	    co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
436288fe4dbSPoul-Henning Kamp.endif
4379c758be2SRuslan Ermilov.if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
4389c758be2SRuslan Ermilov.for p in ${LOCAL_PATCHES}
4398a34b67aSJun Kuriyama	patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
4409c758be2SRuslan Ermilov.endfor
44162bb2153SPaul Traina.endif
442db8714afSJohn Baldwin.if defined(LOCAL_SCRIPT)
443b34a415eSDavid E. O'Brien	cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} \
444b34a415eSDavid E. O'Brien	    RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
44548f1b394SJordan K. Hubbard.endif
446d9d84e07SJohn Baldwin	rm -rf ${CHROOTDIR}/usr/ports
447d9d84e07SJohn Baldwin.if !defined(NOPORTSATALL)
448fcb9ab1eSYoshihiro Takahashi.if defined(EXTPORTSDIR)
449fcb9ab1eSYoshihiro Takahashi	cd ${CHROOTDIR}/usr && cp -R -H ${EXTPORTSDIR} ports
450fcb9ab1eSYoshihiro Takahashi	# If there are distfiles downloaded removing them
451fcb9ab1eSYoshihiro Takahashi	rm -rf ports/distfiles/*
452fcb9ab1eSYoshihiro Takahashi.else
453b34a415eSDavid E. O'Brien	cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
454b34a415eSDavid E. O'Brien	    co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
455d9d84e07SJohn Baldwin.endif
456fcb9ab1eSYoshihiro Takahashi.endif
457aeb6d603SJordan K. Hubbard.if !defined(NODOC)
458d9d84e07SJohn Baldwin	rm -rf ${CHROOTDIR}/usr/doc
459d9d84e07SJohn Baldwin.if defined(EXTDOCDIR)
460a4b4ec99SJuli Mallett	cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
4613f17d264SSatoshi Asami.else
462b34a415eSDavid E. O'Brien	cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} \
463b34a415eSDavid E. O'Brien	    co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
4643f17d264SSatoshi Asami.endif
46540227c90SMakoto Matsushita	if [ -d ${RELEASEDISTFILES}/ ]; then \
46640227c90SMakoto Matsushita		cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
467b389e7aaSMakoto Matsushita	else \
468d7c4abbfSMakoto Matsushita		mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
4698e8d540fSSADA Kenji	fi
4703ea0ca53SDavid E. O'Brien.if !defined(NO_PREFETCHDISTFILES)
4713ea0ca53SDavid E. O'Brien	@cd ${.CURDIR} && ${MAKE} fetch-distfiles
472bb5e8f3fSJohn Baldwin.endif
473aeb6d603SJordan K. Hubbard.endif
474288fe4dbSPoul-Henning Kamp.endif
475288fe4dbSPoul-Henning Kamp.if make(rerelease)
476e50a1ba2SRuslan Ermilov.if !defined(RELEASENOUPDATE) && !defined(EXTSRCDIR)
477b03ddec9SJohn Baldwin.if defined(SVNROOT)
478b03ddec9SJohn Baldwin	cd ${CHROOTDIR}/usr/src && ${SVNPREFIX} svn switch ${SVNCMDARGS} \
479b03ddec9SJohn Baldwin	    ${SVNROOT}/${SVNBRANCH}
480b03ddec9SJohn Baldwin.elif !defined(RELEASETAG)
481b34a415eSDavid E. O'Brien	cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
482b34a415eSDavid E. O'Brien	    update ${CVSCMDARGS} -P -d -A
483288fe4dbSPoul-Henning Kamp.else
484b34a415eSDavid E. O'Brien	cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
485b34a415eSDavid E. O'Brien	    update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
486288fe4dbSPoul-Henning Kamp.endif
487b4f72168SRuslan Ermilov	rm -f ${CHROOTDIR}/tmp/.world_done
488fcb9ab1eSYoshihiro Takahashi.if !defined(NOPORTS) && !defined(EXTPORTSDIR)
489b34a415eSDavid E. O'Brien	cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
490b34a415eSDavid E. O'Brien	    update ${CVSCMDARGS} -P -d
49192f6e2c8SJohn Baldwin	rm -f ${CHROOTDIR}/tmp/.skip_ports_index
4926e5cd2d2SJordan K. Hubbard.endif
493dd1a1b3dSJoerg Wunsch.if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
494dd1a1b3dSJoerg Wunsch	for i in ${MINIMALDOCPORTS}; do \
495b34a415eSDavid E. O'Brien	    ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
496b34a415eSDavid E. O'Brien		update ${CVSCMDARGS} -P -d ) ; \
497dd1a1b3dSJoerg Wunsch	done
498dd1a1b3dSJoerg Wunsch.endif
499aeb6d603SJordan K. Hubbard.if !defined(NODOC)
500b34a415eSDavid E. O'Brien	cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q \
501b34a415eSDavid E. O'Brien	    update ${CVSCMDARGS} -P -d
502aeb6d603SJordan K. Hubbard.endif
503288fe4dbSPoul-Henning Kamp.endif
504bd668f6fSPoul-Henning Kamp.endif
5057284556fSJordan K. Hubbard	# Add version information to those things that need it.
506b4f72168SRuslan Ermilov	if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
507b4f72168SRuslan Ermilov		cd ${CHROOTDIR}/usr/src/sys/conf && \
508288fe4dbSPoul-Henning Kamp		mv newvers.sh foo && \
509b4f72168SRuslan Ermilov		sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
510b4f72168SRuslan Ermilov		rm foo; \
511b4f72168SRuslan Ermilov	fi
512d4983966SPaul Traina	-test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
5130febff82SDavid E. O'Brien	echo "#!/bin/sh"			> ${_MK}
5140febff82SDavid E. O'Brien	echo "set -ex"				>> ${_MK}
5150febff82SDavid E. O'Brien	echo "trap 'umount /dev || true' 0"	>> ${_MK}
5160febff82SDavid E. O'Brien	echo "_RELTARGET=\$${1:-doRELEASE}"	>> ${_MK}
5177a7a00adSRuslan Ermilov.for var in \
5183e4ac74dSRuslan Ermilov	AUTO_KEYBOARD_DETECT \
5193e4ac74dSRuslan Ermilov	BUILDNAME \
520b2200964SJohn Baldwin	CD_PACKAGE_TREE \
5213e4ac74dSRuslan Ermilov	DISTRIBUTIONS \
5223e4ac74dSRuslan Ermilov	DOMINIMALDOCPORTS \
5233e4ac74dSRuslan Ermilov	EXTRA_SRC \
52477d79f0cSMakoto Matsushita	FTP_PASSIVE_MODE \
52577d79f0cSMakoto Matsushita	FTP_PROXY \
52677d79f0cSMakoto Matsushita	HTTP_PROXY \
5273e4ac74dSRuslan Ermilov	KERNELS \
528fdb71eeeSSam Leffler	KERNELS_BASE \
5293e4ac74dSRuslan Ermilov	KERNEL_FLAGS \
5302e3a1557SKen Smith	MAKE_DVD \
53194223a53SDavid E. O'Brien	MAKE_FLOPPIES \
5323e4ac74dSRuslan Ermilov	MAKE_ISOS \
5333e4ac74dSRuslan Ermilov	NOCDROM \
5343e4ac74dSRuslan Ermilov	NODOC \
5353e4ac74dSRuslan Ermilov	NOPORTS \
53683c7ade9SRuslan Ermilov	NO_SHARED \
5373e4ac74dSRuslan Ermilov	NOSRC \
5383e4ac74dSRuslan Ermilov	NO_CPU_CFLAGS \
5393e4ac74dSRuslan Ermilov	NO_CPU_COPTFLAGS \
540f0414231SDavid E. O'Brien	NO_FLOPPIES \
5413e4ac74dSRuslan Ermilov	RELEASETAG \
5423e4ac74dSRuslan Ermilov	RELNOTES_LANG \
54392f6e2c8SJohn Baldwin	SEPARATE_LIVEFS \
5443e4ac74dSRuslan Ermilov	TARGET \
5453e4ac74dSRuslan Ermilov	TARGET_ARCH \
5463e4ac74dSRuslan Ermilov	WORLD_FLAGS
5477a7a00adSRuslan Ermilov.if defined(${var})
5480febff82SDavid E. O'Brien	echo "export ${var}=\"${${var}}\""	>> ${_MK}
54946e90709SJoerg Wunsch.endif
5507a7a00adSRuslan Ermilov.endfor
55143276d06SJoerg Wunsch	# Don't remove this, or the build will fall over!
5520febff82SDavid E. O'Brien	echo "export RELEASEDIR=${_R}"		>> ${_MK}
5530febff82SDavid E. O'Brien	echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}"	>> ${_MK}
5540febff82SDavid E. O'Brien	echo "export MANBUILDCAT=YES"		>> ${_MK}
5556ceb41c2SSam Leffler	# NB: these may fail if the host is running w/o devfs
5560febff82SDavid E. O'Brien	echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
5570febff82SDavid E. O'Brien	echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true"	>> ${_MK}
5584963cb93SRuslan Ermilov	echo "if [ ! -c /dev/null ]; then" >> ${_MK}
5594963cb93SRuslan Ermilov	echo "	echo /dev/null is not a device!" >> ${_MK}
5604963cb93SRuslan Ermilov	echo "	exit 1" >> ${_MK}
5614963cb93SRuslan Ermilov	echo "fi" >> ${_MK}
562d9aeaacbSMakoto Matsushita	echo "if [ -x /etc/rc.d/ldconfig ]; then" >> ${_MK}
563ab0a016cSYoshihiro Takahashi	echo "	/etc/rc.d/ldconfig start"	>> ${_MK}
564d9aeaacbSMakoto Matsushita	echo "else"				>> ${_MK}
565d9aeaacbSMakoto Matsushita	echo "	ldconfig /lib /usr/lib /usr/local/lib || true" >> ${_MK}
566d9aeaacbSMakoto Matsushita	echo "fi"				>> ${_MK}
5670febff82SDavid E. O'Brien	echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
5680febff82SDavid E. O'Brien	echo "	cd /usr/src"			>> ${_MK}
569f45a5bbdSRuslan Ermilov	echo "	${CROSSMAKE} ${WORLD_FLAGS} -DNO_CLEAN buildworld && \\" >> ${_MK}
570ab5e8655SBrian Somers	echo "	touch /tmp/.world_done || exit 1" >> ${_MK}
5710febff82SDavid E. O'Brien	echo "fi"				>> ${_MK}
572485b9268SKen Smith	echo "if [ ! -f /tmp/.skip_ports_index ]; then" >> ${_MK}
573485b9268SKen Smith	echo "	echo \">>> make index started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
574485b9268SKen Smith	echo "	for i in ${MAKEINDEXPORTS}"	>> ${_MK}
575485b9268SKen Smith	echo "	do"			>> ${_MK}
576485b9268SKen Smith	echo "		cd /usr/ports/\$${i}"	>> ${_MK}
577485b9268SKen Smith	echo "		env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \\" >> ${_MK}
578485b9268SKen Smith	echo "		make all install clean BATCH=yes FORCE_PKG_REGISTER=yes" >> ${_MK}
579485b9268SKen Smith	echo "	done"				>> ${_MK}
580485b9268SKen Smith	echo "	cd /usr/ports"			>> ${_MK}
581485b9268SKen Smith	echo "	rm -f INDEX*"			>> ${_MK}
582485b9268SKen Smith	echo "	make index -DINDEX_PRISTINE"	>> ${_MK}
58388f69650SKen Smith	echo "	rm -f INDEX*.tmp"		>> ${_MK}
584485b9268SKen Smith	echo "	touch /tmp/.skip_ports_index"	>> ${_MK}
585485b9268SKen Smith	echo "	echo \">>> make index finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
586485b9268SKen Smith	echo "fi"				>> ${_MK}
5870febff82SDavid E. O'Brien	echo "cd /usr/src/release"		>> ${_MK}
5880febff82SDavid E. O'Brien	echo "make obj"				>> ${_MK}
5890febff82SDavid E. O'Brien	echo "make \$${_RELTARGET}"		>> ${_MK}
5900febff82SDavid E. O'Brien	echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
5910febff82SDavid E. O'Brien	chmod 755 ${_MK}
592485b9268SKen Smith.if defined(NOPORTS)
593485b9268SKen Smith	touch ${CHROOTDIR}/tmp/.skip_ports_index
594485b9268SKen Smith.endif
595b34a415eSDavid E. O'Brien	# Ensure md.ko is loaded if md(4) is not statically compiled into
596b34a415eSDavid E. O'Brien	# the kernel
5975262ab24SDavid E. O'Brien	-mdconfig 2>/dev/null
5985bff5851SDavid E. O'Brien	env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
59920e5d523SJordan K. Hubbard
600bd668f6fSPoul-Henning Kampclean:
6017b07d01fSRuslan Ermilov	rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-8] ${EXTRAS}
602bd668f6fSPoul-Henning Kamp
6033ea0ca53SDavid E. O'Brienfetch-distfiles:
604485b9268SKen Smith	@for i in ${MAKEINDEXPORTS}; do \
605485b9268SKen Smith		cd ${CHROOTDIR}/usr/ports/$$i && \
606485b9268SKen Smith			make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
607485b9268SKen Smith			checksum-recursive ; \
608485b9268SKen Smith	done
6093ea0ca53SDavid E. O'Brien	@for i in ${DOCPORTS}; do \
6103ea0ca53SDavid E. O'Brien		cd ${CHROOTDIR}/usr/ports/$$i && \
6113ea0ca53SDavid E. O'Brien			make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
6123ea0ca53SDavid E. O'Brien			WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
6133ea0ca53SDavid E. O'Brien			checksum-recursive ; \
6143ea0ca53SDavid E. O'Brien	done
6153ea0ca53SDavid E. O'Brien
616335d64e6SJordan K. Hubbard# Clean out ${_R} and make the directory structure.
617bd668f6fSPoul-Henning Kamprelease.1:
618335d64e6SJordan K. Hubbard	mkdir -p ${_R}
619cd8d8dacSJordan K. Hubbard	-rm -rf ${_R}/* 2> /dev/null
620335d64e6SJordan K. Hubbard	-chflags -R noschg ${_R}/.
621335d64e6SJordan K. Hubbard	rm -rf ${_R}/*
622bd668f6fSPoul-Henning Kamp	mkdir ${RD}
62394223a53SDavid E. O'Brien.if defined(MAKE_FLOPPIES)
624bd668f6fSPoul-Henning Kamp	mkdir ${RD}/floppies
6251dae6ea9SRuslan Ermilov.endif
626e12c4355SPoul-Henning Kamp	mkdir ${RD}/trees
627d943f83bSJohn Baldwin	for i in ${DISTRIBUTIONS}; do \
628288fe4dbSPoul-Henning Kamp		mkdir ${RD}/trees/$$i && \
62911017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.root.dist \
630288fe4dbSPoul-Henning Kamp		    -p ${RD}/trees/$$i > /dev/null && \
63111017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
632288fe4dbSPoul-Henning Kamp		    -p ${RD}/trees/$$i/usr > /dev/null && \
63311017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.include.dist \
634288fe4dbSPoul-Henning Kamp		    -p ${RD}/trees/$$i/usr/include > /dev/null && \
63511017a68SMarcel Moolenaar		mtree -deU -f ${MTREEFILES}/BSD.var.dist \
636e12c4355SPoul-Henning Kamp		    -p ${RD}/trees/$$i/var > /dev/null ; \
63748327bc9SPoul-Henning Kamp	done
6389fe7600bSSam Leffler	mkdir ${RD}/kernels
639fdb71eeeSSam Leffler	for i in ${KERNELS_BASE} ${KERNELS}; do \
640fdb71eeeSSam Leffler		mkdir -p ${RD}/kernels/$${i}; \
6419fe7600bSSam Leffler	done
642d3c93cefSRuslan Ermilov	touch ${.TARGET}
6437f986648SPoul-Henning Kamp
644bd668f6fSPoul-Henning Kamp# Install the system into the various distributions.
645bd668f6fSPoul-Henning Kamprelease.2:
64695dc12e1SRuslan Ermilov	cd ${.CURDIR}/.. && ${CROSSMAKE} distrib-dirs DESTDIR=${RD}/trees/base
647d885836cSRuslan Ermilov	cd ${.CURDIR}/.. && ${CROSSMAKE} ${WORLD_FLAGS} distributeworld \
648d885836cSRuslan Ermilov	    DISTDIR=${RD}/trees
649d3c93cefSRuslan Ermilov	touch ${.TARGET}
650ff85b6e3SRuslan Ermilov
65197febce7SJoerg Wunsch# Make and install the generic kernel(s).
6525355286aSColin Percivalrelease.3:
653fdb71eeeSSam Leffler.for kernel in ${KERNELS_BASE} ${KERNELS}
6546bde859fSRuslan Ermilov	cd ${.CURDIR}/..; \
65574064f9fSRuslan Ermilov	${CROSSMAKE} ${KERNEL_FLAGS} \
6569fe7600bSSam Leffler 	    KERNCONF=${kernel} kernel \
6579fe7600bSSam Leffler 	    DESTDIR=${RD}/kernels KODIR=/${kernel}
6589fe7600bSSam Leffler.endfor
659d3c93cefSRuslan Ermilov	touch ${.TARGET}
660bd668f6fSPoul-Henning Kamp
66101feef2cSPoul-Henning Kamp# Make and install the three crunched binaries which live on the floppies.
662bd668f6fSPoul-Henning Kamp# You are not supposed to like this :-)
6635355286aSColin Percivalrelease.4:
664518a1d34SPoul-Henning Kamp	rm -rf ${RD}/crunch
665518a1d34SPoul-Henning Kamp	mkdir -p ${RD}/crunch
66658888af3SRuslan Ermilov.for j in ${CRUNCH_TARGETS}
6673cd22041SRuslan Ermilov.if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
66858888af3SRuslan Ermilov	rm -rf ${j}_crunch
66958888af3SRuslan Ermilov	mkdir ${j}_crunch
67095dc12e1SRuslan Ermilov	cd ${j}_crunch; ${WMAKEENV} MAKEFLAGS="-m ${.CURDIR}/../share/mk" \
6715876d743SKen Smith	    NO_WERROR= crunchgen -o \
672b34a415eSDavid E. O'Brien	    ${.CURDIR}/${TARGET}/${j}_crunch.conf
67358888af3SRuslan Ermilov	cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
674eedbbe40SRuslan Ermilov	cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
6759090f0c2SMarcel Moolenaar	cd ${j}_crunch; CFLAGS="-Os -pipe" ${WMAKE} -f ${j}_crunch.mk \
6769090f0c2SMarcel Moolenaar	    -DNO_CPU_CFLAGS all
67755ee3f14SRuslan Ermilov	${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
67858888af3SRuslan Ermilov	mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
6793cd22041SRuslan Ermilov.endif
68058888af3SRuslan Ermilov.endfor
681d3c93cefSRuslan Ermilov	touch ${.TARGET}
682bd668f6fSPoul-Henning Kamp
68330e8b491SPoul-Henning Kamp#
68430e8b491SPoul-Henning Kamp# --==## Fix up the distributions. ##==--
68530e8b491SPoul-Henning Kamp#
6865355286aSColin Percivalrelease.5:
6877284556fSJordan K. Hubbard	# Create any "synthetic dists" now.
6887284556fSJordan K. Hubbard	@for i in ${DISTRIBUTIONS}; do \
6897284556fSJordan K. Hubbard		if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
6907284556fSJordan K. Hubbard			echo -n "Running $$i dist creation script... "; \
69166422f5bSPeter Wemm			env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
69258183fc7SJordan K. Hubbard			echo "Done."; \
6937284556fSJordan K. Hubbard		fi \
6947284556fSJordan K. Hubbard	done \
6957284556fSJordan K. Hubbard
69630e8b491SPoul-Henning Kamp	# Remove all the directories we don't need.
69727d44115SPoul-Henning Kamp	-cd ${RD}/trees && \
698ece6831dSRuslan Ermilov		(find ${OTHER_DISTS} -path '*/var/empty' | xargs chflags noschg; \
699c5897626SColin Percival		find ${OTHER_DISTS} -depth -type d -empty -print | xargs rmdir)
700d3c93cefSRuslan Ermilov	touch ${.TARGET}
701f14786ddSJordan K. Hubbard
70230e8b491SPoul-Henning Kamp#
7037284556fSJordan K. Hubbard# --==## Package up the tarballs from assembled trees ##==--
70430e8b491SPoul-Henning Kamp#
7055355286aSColin Percivalrelease.6:
70695e34bfcSJordan K. Hubbard	rm -rf ${RD}/dists
70795e34bfcSJordan K. Hubbard	mkdir -p ${RD}/dists
70895e34bfcSJordan K. Hubbard	@for i in ${DISTRIBUTIONS} ; \
70995e34bfcSJordan K. Hubbard	do \
71095e34bfcSJordan K. Hubbard		if [ -d ${RD}/trees/$${i} ] ; then \
71130e8b491SPoul-Henning Kamp			cd ${.CURDIR} && $(MAKE) doTARBALL \
71230e8b491SPoul-Henning Kamp				SD=${RD}/trees/$${i} \
713288fe4dbSPoul-Henning Kamp				TN=$$i TD=$$i ARG="." && \
71495e34bfcSJordan K. Hubbard			echo "$${i} distribution is finished."; \
71595e34bfcSJordan K. Hubbard		fi ; \
71695e34bfcSJordan K. Hubbard	done
717fdb71eeeSSam Leffler	@for i in ${KERNELS_BASE} ${KERNELS} ; \
7189fe7600bSSam Leffler	do \
7199fe7600bSSam Leffler		if [ -d ${RD}/kernels/$${i} ] ; then \
7209fe7600bSSam Leffler			cd ${.CURDIR} && $(MAKE) doTARBALL \
7219fe7600bSSam Leffler				SD=${RD}/kernels \
7229fe7600bSSam Leffler				TN=$$i TD=kernels ARG="$$i" && \
7239fe7600bSSam Leffler			echo "$${i} distribution is finished."; \
7249fe7600bSSam Leffler		fi ; \
7259fe7600bSSam Leffler	done
7266daa108fSRuslan Ermilov.if !defined(NOPORTS)
7276daa108fSRuslan Ermilov	# XXX: Inline stripped version of doTARBALL
7286daa108fSRuslan Ermilov	@rm -rf ${RD}/dists/ports/ports*
7296daa108fSRuslan Ermilov	@mkdir -p ${RD}/dists/ports
7306daa108fSRuslan Ermilov	@echo rolling ports/ports tarball
731042df2e2SRuslan Ermilov	@tar --exclude CVS --exclude .svn --exclude 'ports/distfiles/*' \
73292f6e2c8SJohn Baldwin	  -czf ${RD}/dists/ports/ports.tgz -C /usr ports
7336daa108fSRuslan Ermilov	@cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
7346daa108fSRuslan Ermilov	@(cd ${RD}/dists/ports; \
7354a457aa6SHiroki Sato	  rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
7360f12c50eSKen Smith	  md5 * > .CHECKSUM.MD5; \
7374a457aa6SHiroki Sato	  sha256 * > .CHECKSUM.SHA256; \
7384a457aa6SHiroki Sato	  mv .CHECKSUM.MD5 CHECKSUM.MD5; \
7394a457aa6SHiroki Sato	  mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
7406daa108fSRuslan Ermilov	@echo "ports distribution is finished."
7416daa108fSRuslan Ermilov.endif
742d3c93cefSRuslan Ermilov	touch ${.TARGET}
74395e34bfcSJordan K. Hubbard
74495e34bfcSJordan K. Hubbard
74530e8b491SPoul-Henning Kamp#
74630e8b491SPoul-Henning Kamp# --==## Make source dists ##==--
74730e8b491SPoul-Henning Kamp#
7485355286aSColin Percivalrelease.7:
7494731faa3SJordan K. Hubbard.if !defined(NOSRC)
750288fe4dbSPoul-Henning Kamp	@cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
75195e34bfcSJordan K. Hubbard		TD=src TN=sbase ARG="[A-Z]*"
752fb29e2cfSJordan K. Hubbard	@for i in `cd /usr/src && echo [a-z]*` ; do \
75330e8b491SPoul-Henning Kamp		if [ -d /usr/src/$$i ] ; then \
75430e8b491SPoul-Henning Kamp			cd ${.CURDIR} && $(MAKE) doTARBALL \
755470f825fSJordan K. Hubbard				TN=`echo s$$i | tr -d '.' | \
756470f825fSJordan K. Hubbard				    sed -e 's/usr/u/' \
757470f825fSJordan K. Hubbard					-e 's/kerberos5/krb5/'` \
75830e8b491SPoul-Henning Kamp				SD=/usr/src TD=src ARG="$$i" ; \
75995e34bfcSJordan K. Hubbard		fi ; \
76095e34bfcSJordan K. Hubbard	done
76140b0c0d9SPeter Wemm.if defined(EXTRA_SRC)
762288fe4dbSPoul-Henning Kamp	@set ${EXTRA_SRC} && \
76340b0c0d9SPeter Wemm	while [ $$# -ge 2 ] ; do \
76430e8b491SPoul-Henning Kamp		if [ -d /usr/src/$$1 ] ; then \
76530e8b491SPoul-Henning Kamp			cd ${.CURDIR} && $(MAKE) doTARBALL \
76630e8b491SPoul-Henning Kamp				SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
76730e8b491SPoul-Henning Kamp		fi && shift && shift ; \
76840b0c0d9SPeter Wemm	done
76940b0c0d9SPeter Wemm.endif
7700f12c50eSKen Smith	(cd ${RD}/dists/src; \
7714a457aa6SHiroki Sato	  rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
7720f12c50eSKen Smith	  md5 * > .CHECKSUM.MD5; \
7734a457aa6SHiroki Sato	  sha256 * > .CHECKSUM.SHA256; \
7744a457aa6SHiroki Sato	  mv .CHECKSUM.MD5 CHECKSUM.MD5; \
7754a457aa6SHiroki Sato	  mv .CHECKSUM.SHA256 CHECKSUM.SHA256)
77695e34bfcSJordan K. Hubbard	@echo "src distribution is finished."
7774731faa3SJordan K. Hubbard.endif
778d3c93cefSRuslan Ermilov	touch ${.TARGET}
77995e34bfcSJordan K. Hubbard
780c0731f81SJohn Baldwin# Build the memory root filesystem.
7815355286aSColin Percivalrelease.8:
78255852204SRuslan Ermilov	cp ${RD}/trees/base/etc/disktab /etc
783409f9329SJordan K. Hubbard	rm -rf ${RD}/mfsfd
784409f9329SJordan K. Hubbard	mkdir ${RD}/mfsfd
785409f9329SJordan K. Hubbard	cd ${RD}/mfsfd && \
78609104034SScott Long		mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help \
78709104034SScott Long		var/empty
7883df0e2afSPoul-Henning Kamp	@cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
789a91fd119SPoul-Henning Kamp		DIR=${RD}/mfsfd/stand ZIP=false
790dc2475c5SJohn Baldwin	( cd ${RD}/mfsfd && \
791dc2475c5SJohn Baldwin	  for dir in bin sbin ; do \
792dc2475c5SJohn Baldwin		ln -sf /stand $$dir; \
793dc2475c5SJohn Baldwin	  done )
7943cb04a4dSRuslan Ermilov	cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
79509104034SScott Long	cp ${.CURDIR}/../etc/master.passwd ${RD}/mfsfd/etc/master.passwd
796f9b5f9c1SRuslan Ermilov	cp ${RD}/trees/base/etc/*pwd.db ${RD}/mfsfd/etc/
797d3b19355SRuslan Ermilov	( for F in defaults/rc.conf netconfig protocols ; do \
79864dc0a3eSDavid E. O'Brien		sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
79901df2ec3SDavid E. O'Brien		${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
80064dc0a3eSDavid E. O'Brien	  done )
801a191fd1bSAlfred Perlstein	grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
8026bde859fSRuslan Ermilov	    ${RD}/trees/base/etc/services | \
80364dc0a3eSDavid E. O'Brien	    sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
80464dc0a3eSDavid E. O'Brien	    > ${RD}/mfsfd/stand/etc/services
805bc5ffda6SJun Kuriyama	grep 'operator' ${RD}/trees/base/etc/group \
806bc5ffda6SJun Kuriyama	    > ${RD}/mfsfd/stand/etc/group
807a191fd1bSAlfred Perlstein	ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
808bc5ffda6SJun Kuriyama	ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
809a191fd1bSAlfred Perlstein	ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
810407ac59aSJohn Hay	cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
81121203b38SBruce A. Mah.if !defined(NODOC)
8128ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_INDEP}; do \
813b34a415eSDavid E. O'Brien	  cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
814b34a415eSDavid E. O'Brien	      ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
8158ed3802bSBruce A. Mah	done
8168ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_DEP}; do \
817b34a415eSDavid E. O'Brien	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
818b34a415eSDavid E. O'Brien	      ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
8198ed3802bSBruce A. Mah	done
8208ed3802bSBruce A. Mah.endif
821b34a415eSDavid E. O'Brien	-test -f ${.CURDIR}/install.cfg \
822b34a415eSDavid E. O'Brien	    && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
82371696ba3SJordan K. Hubbard	@mkdir -p ${RD}/mfsfd/boot
824fa7bd283SPeter Grehan.if ${TARGET_ARCH} != "ia64" && ${TARGET_ARCH} != "powerpc"
8256bde859fSRuslan Ermilov	@cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
826710d4ca3SMarcel Moolenaar.endif
827c07665ebSPeter Wemm.if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
8286bde859fSRuslan Ermilov	@cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
829c06157d4SRuslan Ermilov.endif
830042df2e2SRuslan Ermilov	@tar --exclude CVS --exclude .svn -cf - \
831042df2e2SRuslan Ermilov		-C ${.CURDIR}/../usr.sbin/sysinstall help | \
83292e86f99SJordan K. Hubbard		tar xf - -C ${RD}/mfsfd/stand
8336daa108fSRuslan Ermilov	@mkdir -p ${RD}/mfsroot
8348bf7ab35SRuslan Ermilov	sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
8353d610ec8SRuslan Ermilov	    ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
836569acadfSDavid E. O'Brien	@${ZIPPER} -fv ${RD}/mfsroot/mfsroot
8373d610ec8SRuslan Ermilov	touch ${.TARGET}
8383d610ec8SRuslan Ermilov
839c0731f81SJohn BaldwinKERNFLOPPYSET=		${RD}/floppyset/kern/kernel.gz
840c0731f81SJohn Baldwin.if defined(SMALLFLOPPYSIZE)
841c0731f81SJohn BaldwinSMALLKERNFLOPPYSET=	${RD}/floppyset/kern-small/kernel.gz
842319f35a3SRuslan Ermilov.endif
843c0731f81SJohn Baldwin.if defined(SPLIT_MFSROOT)
844c0731f81SJohn BaldwinMFSROOTFLOPPYSET=	${RD}/floppyset/mfsroot/mfsroot.gz
845c0731f81SJohn Baldwin.if defined(SMALLFLOPPYSIZE)
846c0731f81SJohn BaldwinSMALLMFSROOTFLOPPYSET=	${RD}/floppyset/mfsroot-small/mfsroot.gz
847c26d9e5aSJake Burkholder.endif
8484a2d414fSRuslan Ermilov.endif
849c0731f81SJohn Baldwin
850c0731f81SJohn Baldwin# Build boot and install floppies.
851c0731f81SJohn Baldwinfloppies.1:
852569acadfSDavid E. O'Brien	@${ZIPPER} -c ${RD}/kernels/GENERIC/kernel > ${RD}/kernels/kernel.gz
853c0731f81SJohn Baldwin	@echo "Making the kernel boot floppies..."
854c0731f81SJohn Baldwin	@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
855c0731f81SJohn Baldwin	    FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
856c0731f81SJohn Baldwin.if defined(SMALLFLOPPYSIZE)
857c0731f81SJohn Baldwin	@echo "Making the small kernel boot floppies..."
858c0731f81SJohn Baldwin	@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
859c0731f81SJohn Baldwin	    FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
860c0731f81SJohn Baldwin	    FDSIZE="SMALL"
861a40915d7SYoshihiro Takahashi.endif
862c0731f81SJohn Baldwin.if defined(SPLIT_MFSROOT)
863c0731f81SJohn Baldwin	@echo "Making the mfsroot boot floppies..."
864c0731f81SJohn Baldwin	@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
865c0731f81SJohn Baldwin	    FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
866c0731f81SJohn Baldwin.if defined(SMALLFLOPPYSIZE)
867c0731f81SJohn Baldwin	@echo "Making the small mfsroot boot floppies..."
868c0731f81SJohn Baldwin	@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
869c0731f81SJohn Baldwin	    FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
870c0731f81SJohn Baldwin	    FDSIZE="SMALL"
871c0731f81SJohn Baldwin.endif
872c0731f81SJohn Baldwin	@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
873c0731f81SJohn Baldwin	    KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
874c0731f81SJohn Baldwin	    MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
875c0731f81SJohn Baldwin.if defined(SMALLFLOPPYSIZE)
8766ab88893SYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
877c0731f81SJohn Baldwin	    KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
878c0731f81SJohn Baldwin	    MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
879c0731f81SJohn Baldwin	    FDSIZE="SMALL"
880c0731f81SJohn Baldwin.endif
881c0731f81SJohn Baldwin.else	# !SPLIT_MFSROOT
882c0731f81SJohn Baldwin	@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
883c0731f81SJohn Baldwin	    KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
884c0731f81SJohn Baldwin	    MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
885c0731f81SJohn Baldwin.if defined(SMALLFLOPPYSIZE)
8866ab88893SYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot-small" \
887c0731f81SJohn Baldwin	    KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
888c0731f81SJohn Baldwin	    MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
889c0731f81SJohn Baldwin	    FDSIZE="SMALL"
890c0731f81SJohn Baldwin.endif
891c0731f81SJohn Baldwin.endif	# SPLIT_MFSROOT
892c0731f81SJohn Baldwin	touch ${.TARGET}
893c0731f81SJohn Baldwin
894c0731f81SJohn Baldwin# Build fixit floppy.
895c0731f81SJohn Baldwinfloppies.2:
89692e86f99SJordan K. Hubbard	@echo "Making fixit floppy."
89792e86f99SJordan K. Hubbard	@rm -rf ${RD}/fixitfd
89892e86f99SJordan K. Hubbard	@mkdir ${RD}/fixitfd
89992e86f99SJordan K. Hubbard	@cd ${RD}/fixitfd && \
900fbc6f9e0SJoerg Wunsch	    mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
901d26a815bSJordan K. Hubbard	    usr/share/misc
90201df2ec3SDavid E. O'Brien	@cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
903ef812d2fSJun Kuriyama	    ${RD}/fixitfd/etc
904ef812d2fSJun Kuriyama	@sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
905ef812d2fSJun Kuriyama	    > ${RD}/fixitfd/etc/protocols
906ef812d2fSJun Kuriyama	@sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
907ef812d2fSJun Kuriyama	    > ${RD}/fixitfd/usr/share/misc/scsi_modes
90892e86f99SJordan K. Hubbard	@cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
90992e86f99SJordan K. Hubbard	@cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
91092e86f99SJordan K. Hubbard	@cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
91192e86f99SJordan K. Hubbard	@chmod 555 ${RD}/fixitfd/stand/tar
912c0731f81SJohn Baldwin.if defined(SMALLFLOPPYSIZE)
913c2bed627SYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
914c2bed627SYoshihiro Takahashi	    DIR=${RD}/fixitfd/stand ZIP=false
915b34a415eSDavid E. O'Brien	@sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
916c0731f81SJohn Baldwin	    ${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
917c2bed627SYoshihiro Takahashi	@rm -rf ${RD}/fixitfd/stand
918c2bed627SYoshihiro Takahashi	@mkdir ${RD}/fixitfd/stand
919c2bed627SYoshihiro Takahashi.endif
920c2bed627SYoshihiro Takahashi	@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
921c2bed627SYoshihiro Takahashi	    DIR=${RD}/fixitfd/stand ZIP=false
922b34a415eSDavid E. O'Brien	@sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
923c0731f81SJohn Baldwin	    ${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
924c0731f81SJohn Baldwin	touch ${.TARGET}
925c0731f81SJohn Baldwin
926c0731f81SJohn Baldwin# Do our last minute floppies directory setup
927c0731f81SJohn Baldwinfloppies.3:
92813fc8773SBruce A. Mah	@(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
9290f12c50eSKen Smith	@(cd ${RD}/floppies; sha256 *.flp > CHECKSUM.SHA256)
930d3c93cefSRuslan Ermilov	touch ${.TARGET}
9313bc93c76SPoul-Henning Kamp
93230e8b491SPoul-Henning Kamp#
93330e8b491SPoul-Henning Kamp# --==## Setup a suitable ftp-area ##==--
93430e8b491SPoul-Henning Kamp#
935e12c4355SPoul-Henning Kampftp.1:
93692e86f99SJordan K. Hubbard	@echo "Setting up FTP distribution area"
93792e86f99SJordan K. Hubbard	@mkdir -p ${FD}
93834594ab9SJordan K. Hubbard	-@ln -s . ${FD}/${BUILDNAME}
93994223a53SDavid E. O'Brien.if defined(MAKE_FLOPPIES)
94092e86f99SJordan K. Hubbard	@cd ${RD} && find floppies -print | cpio -dumpl ${FD}
9411dae6ea9SRuslan Ermilov.endif
94292e86f99SJordan K. Hubbard	@cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
94321203b38SBruce A. Mah.if !defined(NODOC)
9448ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_INDEP}; do \
945b34a415eSDavid E. O'Brien		cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
946b34a415eSDavid E. O'Brien		    ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
947b34a415eSDavid E. O'Brien		cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
948b34a415eSDavid E. O'Brien		    ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
9498ed3802bSBruce A. Mah	done
9508ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_DEP}; do \
951b34a415eSDavid E. O'Brien		cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
952b34a415eSDavid E. O'Brien		    ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
953b34a415eSDavid E. O'Brien		cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
954b34a415eSDavid E. O'Brien		    ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
9558ed3802bSBruce A. Mah	done
956febbbc67SBruce A. Mah	@cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
9578ed3802bSBruce A. Mah.endif
95892e86f99SJordan K. Hubbard	@echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
959d3c93cefSRuslan Ermilov	touch ${.TARGET}
9603bc93c76SPoul-Henning Kamp
96192f6e2c8SJohn Baldwin# Build a live filesystem cdrom image
962c5b0a909SPoul-Henning Kampcdrom.1:
96392f6e2c8SJohn Baldwin	@echo "Building CDROM live filesystem image"
96492f6e2c8SJohn Baldwin	@mkdir -p ${CD_LIVEFS}
96592e86f99SJordan K. Hubbard	@for i in ${DISTRIBUTIONS} ; \
966c5b0a909SPoul-Henning Kamp	do \
967c5b0a909SPoul-Henning Kamp		if [ -d ${RD}/trees/$${i} ] ; then \
968ad5ebf3fSDag-Erling Smørgrav			chflags -R noschg ${RD}/trees/$${i} || true ; \
96901feef2cSPoul-Henning Kamp			( cd ${RD}/trees/$${i} && \
97092f6e2c8SJohn Baldwin			    find . -depth -print | cpio -dumpl ${CD_LIVEFS} ) ; \
971c5b0a909SPoul-Henning Kamp		fi \
972c5b0a909SPoul-Henning Kamp	done
9732e3a1557SKen Smith.if defined(MAKE_DVD)
9742e3a1557SKen Smith	@echo "Building DVD filesystem image as well as CDROM"
97589811440SKen Smith	@mkdir -p ${CD_DVD1}/${BUILDNAME}
9762e3a1557SKen Smith	@for i in ${DISTRIBUTIONS} ; \
9772e3a1557SKen Smith	do \
9782e3a1557SKen Smith		if [ -d ${RD}/trees/$${i} ] ; then \
9792e3a1557SKen Smith			chflags -R noschg ${RD}/trees/$${i} || true ; \
9802e3a1557SKen Smith			( cd ${RD}/trees/$${i} && \
98189811440SKen Smith			    find . -depth -print | cpio -dumpl ${CD_DVD1} ) ; \
9822e3a1557SKen Smith		fi \
9832e3a1557SKen Smith	done
9842e3a1557SKen Smith.endif
9859fe7600bSSam Leffler	@echo "Copy GENERIC kernel to boot area"
9869fe7600bSSam Leffler	@cp -Rp ${RD}/kernels/GENERIC/ ${CD_LIVEFS}/boot/kernel
987f24c80e2SSimon L. B. Nielsen	@rm -f ${CD_LIVEFS}/boot/kernel/*.symbols
98892f6e2c8SJohn Baldwin	@rm -f ${CD_LIVEFS}/.profile
98992f6e2c8SJohn Baldwin	@cp ${.CURDIR}/fixit.profile ${CD_LIVEFS}/.profile
9900cdbdea6STai-hwa Liang	@ln -sf /rescue ${CD_LIVEFS}/stand
99192f6e2c8SJohn Baldwin	@echo "Setting up CDROM boot area"
99292f6e2c8SJohn Baldwin	@rm -f ${CD_LIVEFS}/boot/loader.conf
99392f6e2c8SJohn Baldwin	@cp ${RD}/mfsroot/mfsroot.gz ${CD_LIVEFS}/boot/mfsroot.gz
99492f6e2c8SJohn Baldwin	@echo 'mfsroot_load="YES"' > ${CD_LIVEFS}/boot/loader.conf
99592f6e2c8SJohn Baldwin	@echo 'mfsroot_type="mfs_root"' >> ${CD_LIVEFS}/boot/loader.conf
99692f6e2c8SJohn Baldwin	@echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_LIVEFS}/boot/loader.conf
99792f6e2c8SJohn Baldwin.if exists(${RD}/trees/base/boot/device.hints)
99892f6e2c8SJohn Baldwin	# Break the link to device.hints so we can modify it
99992f6e2c8SJohn Baldwin	@rm -f ${CD_LIVEFS}/boot/device.hints
100092f6e2c8SJohn Baldwin	@cp ${RD}/trees/base/boot/device.hints ${CD_LIVEFS}/boot/device.hints
100192f6e2c8SJohn Baldwin.endif
10025fc898dfSKen Smith	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_LIVEFS}/cdrom.inf
10032e3a1557SKen Smith.if defined(MAKE_DVD)
100489811440SKen Smith	@cp -Rp ${RD}/kernels/GENERIC/ ${CD_DVD1}/boot/kernel
100589811440SKen Smith	@rm -f ${CD_DVD1}/boot/kernel/*.symbols
100689811440SKen Smith	@rm -f ${CD_DVD1}/.profile
100789811440SKen Smith	@cp ${.CURDIR}/fixit.profile ${CD_DVD1}/.profile
100889811440SKen Smith	@ln -sf /rescue ${CD_DVD1}/stand
100989811440SKen Smith	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
101089811440SKen Smith	@rm -f ${CD_DVD1}/boot/loader.conf
101189811440SKen Smith	@cp ${RD}/mfsroot/mfsroot.gz ${CD_DVD1}/boot/mfsroot.gz
101289811440SKen Smith	@echo 'mfsroot_load="YES"' > ${CD_DVD1}/boot/loader.conf
101389811440SKen Smith	@echo 'mfsroot_type="mfs_root"' >> ${CD_DVD1}/boot/loader.conf
101489811440SKen Smith	@echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DVD1}/boot/loader.conf
10152e3a1557SKen Smith.if exists(${RD}/trees/base/boot/device.hints)
101689811440SKen Smith	@rm -f ${CD_DVD1}/boot/device.hints
101789811440SKen Smith	@cp ${RD}/trees/base/boot/device.hints ${CD_DVD1}/boot/device.hints
10182e3a1557SKen Smith.endif
10192e3a1557SKen Smith.endif
102092f6e2c8SJohn Baldwin	touch ${.TARGET}
102192f6e2c8SJohn Baldwin
1022b2200964SJohn Baldwin# Build disc1 and disc2 cdrom images
102392f6e2c8SJohn Baldwincdrom.2:
102492f6e2c8SJohn Baldwin	@echo "Building CDROM disc1 filesystem image"
102592f6e2c8SJohn Baldwin	@mkdir -p ${CD_DISC1}/${BUILDNAME}
102692f6e2c8SJohn Baldwin.if defined(MAKE_FLOPPIES)
102792f6e2c8SJohn Baldwin	@cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
102892f6e2c8SJohn Baldwin.endif
102992f6e2c8SJohn Baldwin	@cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}/${BUILDNAME}
103021203b38SBruce A. Mah.if !defined(NODOC)
10318ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_INDEP}; do \
1032b34a415eSDavid E. O'Brien	  cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
1033b34a415eSDavid E. O'Brien	      ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1034b34a415eSDavid E. O'Brien	  cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
1035b34a415eSDavid E. O'Brien	      ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
10368ed3802bSBruce A. Mah	done
10378ed3802bSBruce A. Mah	@for i in ${DIST_DOCS_ARCH_DEP}; do \
1038b34a415eSDavid E. O'Brien	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
1039b34a415eSDavid E. O'Brien	      ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
1040b34a415eSDavid E. O'Brien	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
1041b34a415eSDavid E. O'Brien	      ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
10428ed3802bSBruce A. Mah	done
1043febbbc67SBruce A. Mah	@cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
10448ed3802bSBruce A. Mah.endif
104592f6e2c8SJohn Baldwin.if defined(SEPARATE_LIVEFS)
104692f6e2c8SJohn Baldwin	@cp -Rp ${CD_LIVEFS}/boot ${CD_DISC1}
104792f6e2c8SJohn Baldwin	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
1048f09470adSBrooks Davis.endif
10499bc245fbSMarcel Moolenaar	@echo "CD_VOLUME = 1" >> ${CD_DISC1}/cdrom.inf
1050b2200964SJohn Baldwin	@echo "Building CDROM disc2 filesystem image"
1051b2200964SJohn Baldwin	@mkdir -p ${CD_DISC2}
1052b2200964SJohn Baldwin	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
1053b2200964SJohn Baldwin	@echo "CD_VOLUME = 2" >> ${CD_DISC2}/cdrom.inf
10542e3a1557SKen Smith.if defined(MAKE_DVD)
10552e3a1557SKen Smith.if defined(MAKE_FLOPPIES)
105689811440SKen Smith	@cd ${RD} && find floppies -print | cpio -dumpl ${CD_DVD1}
10572e3a1557SKen Smith.endif
105889811440SKen Smith	@cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DVD1}/${BUILDNAME}
10592e3a1557SKen Smith.if !defined(NODOC)
10602e3a1557SKen Smith	@for i in ${DIST_DOCS_ARCH_INDEP}; do \
10612e3a1557SKen Smith	  cp ${RND}/${RELNOTES_LANG}/$$i/article.txt \
106289811440SKen Smith	      ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
10632e3a1557SKen Smith	  cp ${RND}/${RELNOTES_LANG}/$$i/article.html \
106489811440SKen Smith	      ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
10652e3a1557SKen Smith	done
10662e3a1557SKen Smith	@for i in ${DIST_DOCS_ARCH_DEP}; do \
10672e3a1557SKen Smith	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt \
106889811440SKen Smith	      ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
10692e3a1557SKen Smith	  cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html \
107089811440SKen Smith	      ${CD_DVD1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
10712e3a1557SKen Smith	done
107289811440SKen Smith	@cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DVD1}
10732e3a1557SKen Smith.endif
107489811440SKen Smith	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_DVD1}/cdrom.inf
107589811440SKen Smith	@echo "CD_VOLUME = 1" >> ${CD_DVD1}/cdrom.inf
10762e3a1557SKen Smith.endif
1077a1b193b5SJohn Baldwin.if !defined(NODOC)
10780cd91f06SKen Smith	@echo "Building CDROM docs filesystem image"
1079639fe104SKen Smith	@mkdir -p ${CD_DOCS}
1080639fe104SKen Smith	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_DOCS}/cdrom.inf
1081944bc81dSMarc Fonvieille	@echo "CD_VOLUME = 3" >> ${CD_DOCS}/cdrom.inf
1082a1b193b5SJohn Baldwin.endif
108392f6e2c8SJohn Baldwin	touch ${.TARGET}
108492f6e2c8SJohn Baldwin
108592f6e2c8SJohn Baldwin#
108692f6e2c8SJohn Baldwin# --==## Setup a suitable cdrom-area ##==--
108792f6e2c8SJohn Baldwin#
108892f6e2c8SJohn Baldwincdrom.3:
10896daa108fSRuslan Ermilov.if defined(CD_BOOT)
109092f6e2c8SJohn Baldwin	@echo "Building bootonly CDROM filesystem image"
109192f6e2c8SJohn Baldwin	@mkdir -p ${CD_BOOT}
109292f6e2c8SJohn Baldwin	@cp -Rp ${CD_LIVEFS}/boot ${CD_BOOT}
1093b2200964SJohn Baldwin	@echo "CD_VERSION = ${BUILDNAME}" > ${CD_BOOT}/cdrom.inf
1094a4f9e93cSRuslan Ermilov.if defined(MINIROOT)
109592f6e2c8SJohn Baldwin	@echo "Building bootonly UFS filesystem image"
1096a4f9e93cSRuslan Ermilov	@mkdir -p ${FD}/miniroot
1097a4f9e93cSRuslan Ermilov	@sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
1098a4f9e93cSRuslan Ermilov	    ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
1099569acadfSDavid E. O'Brien	@${ZIPPER} -v ${FD}/miniroot/miniroot.ufs
1100a4f9e93cSRuslan Ermilov.endif
1101dfbc75ffSYoshihiro Takahashi.endif
1102d3c93cefSRuslan Ermilov	touch ${.TARGET}
1103c5b0a909SPoul-Henning Kamp
1104b2200964SJohn Baldwin.if make(iso.1)
1105b2200964SJohn Baldwin.if defined(CD_PACKAGE_TREE)
1106b2200964SJohn Baldwin.if exists(${CD_PACKAGE_TREE}/disc1)
1107b2200964SJohn BaldwinCD_DISC1_PKGS=	${CD_PACKAGE_TREE}/disc1
1108b2200964SJohn Baldwin.endif
1109b2200964SJohn Baldwin.if exists(${CD_PACKAGE_TREE}/disc2)
1110b2200964SJohn BaldwinCD_DISC2_PKGS=	${CD_PACKAGE_TREE}/disc2
1111b2200964SJohn Baldwin.endif
1112944bc81dSMarc Fonvieille# scripts/package-trees.sh names all discs according to the "discX"
1113944bc81dSMarc Fonvieille# scheme where X is the number of the disc
1114944bc81dSMarc Fonvieille.if exists(${CD_PACKAGE_TREE}/disc3)
1115944bc81dSMarc FonvieilleCD_DOCS_PKGS=	${CD_PACKAGE_TREE}/disc3
1116944bc81dSMarc Fonvieille.endif
111789811440SKen Smith.if exists(${CD_PACKAGE_TREE}/dvd1)
111889811440SKen SmithCD_DVD1_PKGS=	${CD_PACKAGE_TREE}/dvd1
11192e3a1557SKen Smith.endif
1120b2200964SJohn Baldwin.endif
1121b2200964SJohn Baldwin.endif
1122b2200964SJohn Baldwin
11232ef74d22SJordan K. Hubbardiso.1:
1124c1fc2282SRuslan Ermilov.if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
112530fa4984SDavid E. O'Brien	@echo "Creating ISO images..."
11266daa108fSRuslan Ermilov.if defined(CD_BOOT)
11276daa108fSRuslan Ermilov	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1128b2200964SJohn Baldwin	    FreeBSD_bootonly \
11296daa108fSRuslan Ermilov	    ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
11306daa108fSRuslan Ermilov.endif
113130fa4984SDavid E. O'Brien	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1132b2200964SJohn Baldwin	    FreeBSD_Install \
1133b2200964SJohn Baldwin	    ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
1134b2200964SJohn Baldwin	    ${CD_DISC1_PKGS}
1135b2200964SJohn Baldwin	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1136b2200964SJohn Baldwin	    FreeBSD_Packages \
1137b2200964SJohn Baldwin	    ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \
1138b2200964SJohn Baldwin	    ${CD_DISC2_PKGS}
11392e3a1557SKen Smith.if defined(MAKE_DVD)
11402e3a1557SKen Smith	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
11412e3a1557SKen Smith	    FreeBSD_Install \
114289811440SKen Smith	    ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \
114389811440SKen Smith	    ${CD_DVD1_PKGS}
11442e3a1557SKen Smith.endif
1145639fe104SKen Smith.if !defined(NODOC)
1146639fe104SKen Smith	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
1147639fe104SKen Smith	    FreeBSD_Documentation \
1148944bc81dSMarc Fonvieille	    ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DOCS} \
1149944bc81dSMarc Fonvieille	    ${CD_DOCS_PKGS}
1150639fe104SKen Smith.endif
115192f6e2c8SJohn Baldwin.if defined(SEPARATE_LIVEFS)
115230fa4984SDavid E. O'Brien	@sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
1153b2200964SJohn Baldwin	    FreeBSD_LiveFS \
1154b2200964SJohn Baldwin	    ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS}
115530fa4984SDavid E. O'Brien.endif
11560f12c50eSKen Smith	@echo "Generating MD5 and SHA256 sums..."
1157eb9bb3eeSDavid E. O'Brien	@(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5)
11580f12c50eSKen Smith	@(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256)
1159d3c93cefSRuslan Ermilov	touch ${.TARGET}
116030fa4984SDavid E. O'Brien.else
1161c1fc2282SRuslan Ermilov	@echo "Do not know how to create an ISO for ${TARGET_ARCH}."
116230fa4984SDavid E. O'Brien.endif
11632ef74d22SJordan K. Hubbard
11648ed3802bSBruce A. Mah#
11658ed3802bSBruce A. Mah# --==## Documentation Project files such as the Handbook and FAQ ##==--
11668ed3802bSBruce A. Mah#
1167793e8c6fSJordan K. Hubbarddoc.1:
116892e86f99SJordan K. Hubbard	@echo "Making docs..."
116992e86f99SJordan K. Hubbard	@for i in ${DOCPORTS}; do \
1170da037ed3SRuslan Ermilov	    cd /usr/ports/$$i && \
1171cd9568c7SMarcel Moolenaar	    env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
1172cd9568c7SMarcel Moolenaar		make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
1173cd9568c7SMarcel Moolenaar		WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
1174b59d8897SJordan K. Hubbard	done
1175d3c93cefSRuslan Ermilov	touch ${.TARGET}
1176793e8c6fSJordan K. Hubbard
11778ed3802bSBruce A. Mah#
11788ed3802bSBruce A. Mah# --==## RELNOTESng:  Next-generation replacements for *.TXT files ##==--
11798ed3802bSBruce A. Mah#
11808ed3802bSBruce A. Mahdoc.2:
11818ed3802bSBruce A. Mah	@echo "Making release documentation..."
1182ba547cb4SYoshihiro Takahashi	@cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' \
118352957bbfSBruce A. Mah	    INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${RND}
1184d3c93cefSRuslan Ermilov	touch ${.TARGET}
11858ed3802bSBruce A. Mah
11867eb11201SPoul-Henning Kamp# Various "subroutine" and other supporting targets.
11877eb11201SPoul-Henning Kamp
1188470f825fSJordan K. Hubbard# RD=
1189470f825fSJordan K. Hubbard# SD=
1190470f825fSJordan K. Hubbard# TD=
1191470f825fSJordan K. Hubbard# ARG=
1192bd668f6fSPoul-Henning KampdoTARBALL:
1193bd668f6fSPoul-Henning Kamp.if !defined(SD)
1194288fe4dbSPoul-Henning Kamp	@echo "SD undefined in doTARBALL" && exit 1
1195bd668f6fSPoul-Henning Kamp.endif
1196bd668f6fSPoul-Henning Kamp.if !defined(TD)
119719cc96f6SDavid E. O'Brien	@echo "TD undefined in doTARBALL" && exit 1
1198bd668f6fSPoul-Henning Kamp.endif
1199bd668f6fSPoul-Henning Kamp.if !defined(ARG)
1200288fe4dbSPoul-Henning Kamp	@echo "ARG undefined in doTARBALL" && exit 1
1201bd668f6fSPoul-Henning Kamp.endif
120292e86f99SJordan K. Hubbard	@rm -rf ${RD}/dists/${TD}/${TN}*
120392e86f99SJordan K. Hubbard	@mkdir -p ${RD}/dists/${TD}
120492e86f99SJordan K. Hubbard	@( cd ${SD} && \
120571098935SRuslan Ermilov		tn=`echo ${TN} | tr 'A-Z' 'a-z'` && \
1206d2b98961SPoul-Henning Kamp		echo rolling ${TD}/$$tn tarball &&\
1207042df2e2SRuslan Ermilov		tar --exclude CVS --exclude .svn --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
120895e34bfcSJordan K. Hubbard		${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
1209b34a415eSDavid E. O'Brien		sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn \
1210b34a415eSDavid E. O'Brien		    > ${RD}/dists/${TD}/$$tn.inf && \
12111e104a1eSJordan K. Hubbard		if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
1212b34a415eSDavid E. O'Brien			cp -p ${.CURDIR}/scripts/$${TD}-install.sh \
1213cbfec51aSSam Leffler			    ${RD}/dists/${TD}/install.sh && \
1214cbfec51aSSam Leffler			chmod +x ${RD}/dists/${TD}/install.sh; \
12151e104a1eSJordan K. Hubbard		fi && \
121616c61233SJordan K. Hubbard		if [ "${SD}" != "/usr/src" ]; then \
121711017a68SMarcel Moolenaar			mtree -c -i -p ${SD}/${ARG} \
121816c61233SJordan K. Hubbard			  -k gname,md5digest,mode,nlink,uname,size,link,type \
121991f2535eSJordan K. Hubbard			  > ${RD}/dists/${TD}/$$tn.mtree ; \
122091f2535eSJordan K. Hubbard		else \
122191f2535eSJordan K. Hubbard			true; \
122291f2535eSJordan K. Hubbard		fi; \
122391f2535eSJordan K. Hubbard		( cd ${RD}/dists/${TD}; \
12244a457aa6SHiroki Sato		rm -f CHECKSUM.MD5 CHECKSUM.SHA256; \
12250f12c50eSKen Smith		md5 * > .CHECKSUM.MD5; \
12264a457aa6SHiroki Sato		sha256 * > .CHECKSUM.SHA256; \
12274a457aa6SHiroki Sato		mv .CHECKSUM.MD5 CHECKSUM.MD5; \
12284a457aa6SHiroki Sato		mv .CHECKSUM.SHA256 CHECKSUM.SHA256) \
122991f2535eSJordan K. Hubbard	)
12307eb11201SPoul-Henning Kamp
12315355286aSColin PercivaldoRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 \
12325355286aSColin Percival    release.5 release.6 release.7 release.8 ${EXTRAS}
12337eb11201SPoul-Henning Kamp	@echo "Release done"
12347eb11201SPoul-Henning Kamp
12350ead1f1dSJordan K. Hubbardfloppies:
12365355286aSColin Percival	@rm -f release.4 release.8 floppies.[123]
12375355286aSColin Percival	@cd ${.CURDIR} && ${MAKE} release.4 release.8 floppies.1 floppies.2 \
1238c0731f81SJohn Baldwin	    floppies.3
123992e86f99SJordan K. Hubbard	@cd ${RD} && find floppies -print | cpio -dumpl ${FD}
12400ead1f1dSJordan K. Hubbard
1241518a1d34SPoul-Henning KampinstallCRUNCH:
1242518a1d34SPoul-Henning Kamp.if !defined(CRUNCH)
1243288fe4dbSPoul-Henning Kamp	@echo "CRUNCH undefined in installCRUNCH" && exit 1
1244518a1d34SPoul-Henning Kamp.endif
1245518a1d34SPoul-Henning Kamp.if !defined(DIR)
1246288fe4dbSPoul-Henning Kamp	@echo "DIR undefined in installCRUNCH" && exit 1
1247518a1d34SPoul-Henning Kamp.endif
1248518a1d34SPoul-Henning Kamp.if !defined(ZIP)
1249288fe4dbSPoul-Henning Kamp	@echo "ZIP undefined in installCRUNCH" && exit 1
1250518a1d34SPoul-Henning Kamp.endif
125192e86f99SJordan K. Hubbard	@if ${ZIP} ; then \
1252569acadfSDavid E. O'Brien		${ZIPPER} < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1253518a1d34SPoul-Henning Kamp	else \
1254518a1d34SPoul-Henning Kamp		ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1255518a1d34SPoul-Henning Kamp	fi
125692e86f99SJordan K. Hubbard	@chmod 555 ${DIR}/${CRUNCH}_crunch
12578f1f55e9SRuslan Ermilov	@if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
12588f1f55e9SRuslan Ermilov		for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1259518a1d34SPoul-Henning Kamp			ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
12607ec62217SYoshihiro Takahashi		done \
12617ec62217SYoshihiro Takahashi	else \
12627ec62217SYoshihiro Takahashi		for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
12637ec62217SYoshihiro Takahashi			ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
12647ec62217SYoshihiro Takahashi		done \
12657ec62217SYoshihiro Takahashi	fi
1266288fe4dbSPoul-Henning Kamp
1267288fe4dbSPoul-Henning Kamp#
1268c0731f81SJohn Baldwin# --==## Build a floppy set for a splitfs file ##==--
1269288fe4dbSPoul-Henning Kamp#
1270c0731f81SJohn Baldwin# FLOPPYBASE - basename of floppy image files
1271c0731f81SJohn Baldwin# FLOPPYDESC - description of floppy set
1272c0731f81SJohn Baldwin# SPLITFILE - filename of the file to split
1273c0731f81SJohn Baldwin# FDSIZE - if specified and "small", small floppy is created
1274c0731f81SJohn Baldwin
1275c0731f81SJohn Baldwin.if make(makeFloppySet)
1276c0731f81SJohn BaldwinSPLITDIR=	${RD}/floppyset/${FLOPPYBASE}
1277c0731f81SJohn Baldwin.if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1278c0731f81SJohn BaldwinFLPSPLITSIZE=	${SMALLFLOPPYSPLITSIZE}
1279c0731f81SJohn BaldwinFLPSIZE=	${SMALLFLOPPYSIZE}
1280c0731f81SJohn BaldwinFLPLABEL=	${SMALLFLOPPYLABEL}
1281c0731f81SJohn Baldwin.else
1282c0731f81SJohn BaldwinFLPSPLITSIZE=	${FLOPPYSPLITSIZE}
1283c0731f81SJohn BaldwinFLPSIZE=	${FLOPPYSIZE}
1284c0731f81SJohn BaldwinFLPLABEL=	${FLOPPYLABEL}
1285319f35a3SRuslan Ermilov.endif
1286c0731f81SJohn Baldwin.endif
1287c0731f81SJohn Baldwin
1288c0731f81SJohn BaldwinmakeFloppySet:
1289c0731f81SJohn Baldwin.if !defined(FLOPPYBASE)
1290c0731f81SJohn Baldwin	@echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
1291c0731f81SJohn Baldwin.endif
1292c0731f81SJohn Baldwin.if !defined(FLOPPYDESC)
1293c0731f81SJohn Baldwin	@echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
1294c0731f81SJohn Baldwin.endif
1295c0731f81SJohn Baldwin.if !defined(SPLITFILE)
1296c0731f81SJohn Baldwin	@echo "SPLITFILE undefined in ${.TARGET}" && exit 1
1297c0731f81SJohn Baldwin.endif
1298e45b43aaSRuslan Ermilov	sh ${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
1299c0731f81SJohn Baldwin	    ${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
1300c0731f81SJohn Baldwin	( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
1301c0731f81SJohn Baldwin	lines=`cat $${splitfile} | wc -l`; \
130285231d66SRuslan Ermilov	lines=$$(($$lines - 1)) ; \
1303c0731f81SJohn Baldwin	for line in `jot $$lines`; do \
1304c0731f81SJohn Baldwin		file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
1305c0731f81SJohn Baldwin		sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
1306c0731f81SJohn Baldwin		${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
1307c0731f81SJohn Baldwin		${BOOTINODE} ${FLPLABEL}; \
1308c0731f81SJohn Baldwin	done )
1309c0731f81SJohn Baldwin
1310c0731f81SJohn Baldwin#
1311c0731f81SJohn Baldwin# --==## Build a boot floppy ##==--
1312c0731f81SJohn Baldwin#
1313c0731f81SJohn Baldwin# FSIMAGE - base floppy image name
1314c0731f81SJohn Baldwin# FDSIZE - if specified and "small", small floppy is created
1315c0731f81SJohn Baldwin# KERNFILE - path to kernel split file
1316c0731f81SJohn Baldwin# MFSROOTFILE - path to mfsroot split file
1317c0731f81SJohn Baldwin
1318c0731f81SJohn Baldwin.if make(buildBootFloppy)
1319c0731f81SJohn BaldwinIMAGEDIR=	${RD}/image.${FSIMAGE}
132013ff581dSJohn BaldwinBOOTDIR=	${RD}/trees/base/boot
132113ff581dSJohn BaldwinHINTSFILE=	${BOOTDIR}/device.hints
1322deff04b4SYoshihiro TakahashiACPI_KO=	${RD}/kernels/GENERIC/acpi.ko
1323c0731f81SJohn BaldwinIMAGEFILE=	${RD}/floppies/${FSIMAGE}.flp
1324c0731f81SJohn Baldwin.if defined(FDSIZE) && ${FDSIZE} == "SMALL"
1325c0731f81SJohn BaldwinFLPSIZE=	${SMALLFLOPPYSIZE}
1326c0731f81SJohn BaldwinFLPLABEL=	${SMALLFLOPPYLABEL}
1327c0731f81SJohn Baldwin.else
1328c0731f81SJohn BaldwinFLPSIZE=	${FLOPPYSIZE}
1329c0731f81SJohn BaldwinFLPLABEL=	${FLOPPYLABEL}
1330c0731f81SJohn Baldwin.endif
1331c0731f81SJohn Baldwin.endif
1332c0731f81SJohn Baldwin
1333c0731f81SJohn BaldwinbuildBootFloppy:
1334c0731f81SJohn Baldwin.if !defined(FSIMAGE)
1335c0731f81SJohn Baldwin	@echo "FSIMAGE undefined in ${.TARGET}" && exit 1
1336c0731f81SJohn Baldwin.endif
1337c0731f81SJohn Baldwin.if !defined(KERNFILE)
1338c0731f81SJohn Baldwin	@echo "KERNFILE undefined in ${.TARGET}" && exit 1
1339c0731f81SJohn Baldwin.endif
1340c0731f81SJohn Baldwin.if !defined(MFSROOTFILE)
1341c0731f81SJohn Baldwin	@echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
1342c0731f81SJohn Baldwin.endif
1343c0731f81SJohn Baldwin	@echo "Running ${.TARGET} for ${FSIMAGE}"
1344c0731f81SJohn Baldwin	@rm -rf ${IMAGEDIR}
1345c0731f81SJohn Baldwin	@mkdir ${IMAGEDIR}
134692e86f99SJordan K. Hubbard	@echo "Setting up /boot directory for ${FSIMAGE} floppy"
1347c0731f81SJohn Baldwin	@mkdir -p ${IMAGEDIR}/boot
13488f1f55e9SRuslan Ermilov.if ${TARGET} == "i386"
1349b34a415eSDavid E. O'Brien	@${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
135013ff581dSJohn Baldwin	    ${IMAGEDIR}/boot/loader ${BOOTDIR}/loader
13514b60693cSMakoto Matsushita.else
135213ff581dSJohn Baldwin	@cp ${BOOTDIR}/loader ${IMAGEDIR}/boot
13534b60693cSMakoto Matsushita.endif
135413ff581dSJohn Baldwin	@cp -Rp ${BOOTDIR}/*.4th ${BOOTDIR}/defaults ${BOOTDIR}/loader.help \
135513ff581dSJohn Baldwin	    ${BOOTDIR}/loader.rc ${IMAGEDIR}/boot
135613ff581dSJohn Baldwin.if exists(${HINTSFILE})
1357f09470adSBrooks Davis	@cp ${HINTSFILE} ${IMAGEDIR}/boot/device.hints
1358569acadfSDavid E. O'Brien	@${ZIPPER} ${IMAGEDIR}/boot/device.hints
135913ff581dSJohn Baldwin.endif
1360569acadfSDavid E. O'Brien	@${ZIPPER} ${IMAGEDIR}/boot/*.4th ${IMAGEDIR}/boot/loader.help \
136113ff581dSJohn Baldwin	    ${IMAGEDIR}/boot/defaults/loader.conf
136213ff581dSJohn Baldwin	@echo 'bootfile="/kernel"' > ${IMAGEDIR}/boot/loader.conf
1363d943f83bSJohn Baldwin.if exists(${ACPI_KO})
1364569acadfSDavid E. O'Brien	@${ZIPPER} -c ${ACPI_KO} > ${IMAGEDIR}/acpi.ko.gz
136513ff581dSJohn Baldwin	@echo 'acpi_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
136613ff581dSJohn Baldwin	@echo 'acpi_name="/acpi.ko"' >> ${IMAGEDIR}/boot/loader.conf
136713ff581dSJohn Baldwin	@echo 'acpi_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
1368d943f83bSJohn Baldwin.endif
136913ff581dSJohn Baldwin	@echo 'mfsroot_load="YES"' >> ${IMAGEDIR}/boot/loader.conf
137013ff581dSJohn Baldwin	@echo 'mfsroot_type="mfs_root"' >> ${IMAGEDIR}/boot/loader.conf
137113ff581dSJohn Baldwin	@echo 'mfsroot_name="/mfsroot"' >> ${IMAGEDIR}/boot/loader.conf
137213ff581dSJohn Baldwin.if !exists(${ACPI_KO})
137313ff581dSJohn Baldwin	@echo 'mfsroot_before="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
137413ff581dSJohn Baldwin.endif
137591dda500SYoshihiro Takahashi.if defined(SPLIT_MFSROOT)
137691dda500SYoshihiro Takahashi	@echo 'mfsroot_after="read -p \"Insert boot floppy and press Enter\""' >> ${IMAGEDIR}/boot/loader.conf
137791dda500SYoshihiro Takahashi.endif
13789f5cc52fSRuslan Ermilov.if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
13799f5cc52fSRuslan Ermilov.if ${AUTO_KEYBOARD_DETECT}
1380c0731f81SJohn Baldwin	@echo "-P" >> ${IMAGEDIR}/boot.config
13818198d9b0SJordan K. Hubbard.endif
13829f5cc52fSRuslan Ermilov.endif
1383c0731f81SJohn Baldwin	@rm -f ${IMAGEFILE}
1384c0731f81SJohn Baldwin	@cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
1385c0731f81SJohn Baldwin	sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
1386c0731f81SJohn Baldwin	    ${BOOTINODE} ${FLPLABEL}
138792e86f99SJordan K. Hubbard	@echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1388270ee878SJohn W. De Boskey
1389e738d1eaSJohn Baldwin.if make(package-split)
1390e738d1eaSJohn Baldwin# Targets related to making a package split
1391e738d1eaSJohn Baldwin#
1392e738d1eaSJohn Baldwin# PKG_COPY instructs the script to copy the actual package files rather than
1393e738d1eaSJohn Baldwin#     make hard links
1394e738d1eaSJohn Baldwin# PKG_TREE is the path to the package tree to be split
1395e738d1eaSJohn Baldwin# PKG_DEST is the path to the destination tree to create the split in
1396e738d1eaSJohn Baldwin# PKG_VERBOSE asks for verbose output of the layout process
13979bae572bSMarcel Moolenaar# PKG_INDEX is the path to the INDEX file. By default ${PKG_TREE}/INDEX.
1398e738d1eaSJohn Baldwin
1399e738d1eaSJohn Baldwin.if defined(PKG_COPY)
1400e738d1eaSJohn BaldwinPKG_DO_COPY=	cp
1401e738d1eaSJohn Baldwin.else
1402e738d1eaSJohn BaldwinPKG_DO_COPY=	ln
1403e738d1eaSJohn Baldwin.endif
14049bae572bSMarcel MoolenaarPKG_WRKIDX=	${PKG_DEST}/INDEX.master
1405e738d1eaSJohn BaldwinPKG_ENV?=
1406e738d1eaSJohn Baldwin.if defined(TARGET_ARCH)
1407e738d1eaSJohn BaldwinPKG_ENV+=	PKG_ARCH=${TARGET_ARCH}
1408e738d1eaSJohn Baldwin.endif
1409e738d1eaSJohn Baldwin.if defined(PKG_VERBOSE)
1410e738d1eaSJohn BaldwinPKG_ENV+=	PKG_VERBOSE=1
1411e738d1eaSJohn Baldwin.endif
14129bae572bSMarcel MoolenaarPKG_INDEX?=	${PKG_TREE}/INDEX
1413e738d1eaSJohn Baldwin
1414e738d1eaSJohn Baldwinpackage-split:
1415e738d1eaSJohn Baldwin.if !defined(PKG_TREE)
1416e738d1eaSJohn Baldwin	@echo "PKG_TREE must be defined" && exit 1
1417e738d1eaSJohn Baldwin.endif
1418e738d1eaSJohn Baldwin.if !defined(PKG_DEST)
1419e738d1eaSJohn Baldwin	@echo "PKG_DEST must be defined" && exit 1
1420e738d1eaSJohn Baldwin.endif
1421e738d1eaSJohn Baldwin	@env ${PKG_ENV} python ${.CURDIR}/scripts/package-split.py \
14229bae572bSMarcel Moolenaar	    ${PKG_INDEX} ${PKG_WRKIDX}
1423e738d1eaSJohn Baldwin	@env ${PKG_ENV} sh ${.CURDIR}/scripts/package-trees.sh ${PKG_DO_COPY} \
14249bae572bSMarcel Moolenaar	    ${PKG_WRKIDX} ${PKG_TREE} ${PKG_DEST}
1425e738d1eaSJohn Baldwin.endif
1426e738d1eaSJohn Baldwin
14278eb4e096SRuslan Ermilov.include <bsd.obj.mk>
1428