]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - release/Makefile
This commit was generated by cvs2svn to compensate for changes in r123041,
[FreeBSD/FreeBSD.git] / release / Makefile
1 # $FreeBSD$
2 #
3 # make release [BUILDNAME=somename] CHROOTDIR=/some/dir CVSROOT=/cvs/dir \
4 #     [RELEASETAG=tag]
5 #
6 # Where "/some/dir" is the pathname of a directory on a some filesystem with
7 # at least 1000MB of free space, "somename" is what you want the release to
8 # call itself, "/cvs/dir" is where our source repo resides and, optionally,
9 # which CVS "tag" name should be used when checking out the sources to build
10 # the release (default is HEAD).
11 #
12 # Please note: the md(4) driver must be present in the kernel
13 # (either by being compiled in or available as a kld(4) module),
14 # otherwise the target 'release.9' and possibly others will fail.
15 #
16 # Note: If you add options to this file, please keep release(7) updated!
17 #
18 # Set these, release builder!
19 #
20 # Fixed version:
21 #BUILDNAME=5.1-RELEASE
22 #
23 # Automatic SNAP versioning:
24 DATE != date +%Y%m%d
25 BASE = 5.1
26 BUILDNAME?=${BASE}-${DATE}-SNAP
27 #
28 #CHROOTDIR=/junk/release
29 # If this is a -stable snapshot, then set
30 #RELEASETAG=RELENG_4
31 #
32 # To test a release with a source tree containing patches and
33 # other work. This tree will get copied instead of getting the
34 # src/ tree from a CVS checkout. For "rerelease", this will NOT
35 # be copied; cvs update will be used instead.
36 #EXTSRCDIR=/usr/src
37 #
38 # To add other options to the CVS subcommands (co,up), set
39 #CVSCMDARGS="-D '01/01/2002 00:00:00 UTC'"
40 #
41 # To add other options to the CVS command, set
42 #CVSARGS="-lfq"
43 #
44 # To prefix the cvs command
45 #CVSPREFIX="/usr/bin/time"
46 #
47 # Where the CVS repository is
48 #CVSROOT="/home/ncvs"
49 #
50 # Non-zero if ${RELEASETAG} is in the form "RELENG_ver_RELEASE"; we
51 # are building an official release.  Otherwise, we are building for
52 # a branch.
53 .if defined(RELEASETAG)
54 ISRELEASE!=     expr "${RELEASETAG}" : '^RELENG_.*_RELEASE$$' || true
55 .if ${ISRELEASE} != 0
56 # Convert "RELENG_ver_RELEASE" to "RELEASE_ver" for ports and doc trees.
57 AUXRELEASETAG!= echo ${RELEASETAG} | sed -e 's/^RELENG_/RELEASE_/' -e 's/_RELEASE$$//'
58 DOCRELEASETAG?=         ${AUXRELEASETAG}
59 PORTSRELEASETAG?=       ${AUXRELEASETAG}
60 .endif
61 .endif
62
63 # If you want to pass flags to the world build such as -j X, use
64 # WORLD_FLAGS.  Similarly, you can specify make flags for kernel
65 # builds via KERNEL_FLAGS.
66 # Similarly, you can specify make flags for make readmes via PORTREADMES_FLAGS.
67 #WORLD_FLAGS=-j4
68 #KERNEL_FLAGS=-j4
69 #PORTREADMES_FLAGS=-j4
70
71 TARGET_ARCH?=   ${MACHINE_ARCH}
72 .if ${TARGET_ARCH} == ${MACHINE_ARCH}
73 TARGET?=        ${MACHINE}
74 .else
75 TARGET?=        ${TARGET_ARCH}
76 .endif
77 CROSSENV=       TARGET_ARCH=${TARGET_ARCH} TARGET=${TARGET}
78 CROSSMAKE=      ${MAKE} ${CROSSENV}
79 NATIVEMAKE=     ${MAKE} TARGET_ARCH=${MACHINE_ARCH} TARGET=${MACHINE}
80
81 # If you are using a local CVS repository with components stored in 
82 # non-standard modules, override these on the make commandline or
83 # in the environment.
84 RELEASESRCMODULE?=      src
85 RELEASEDOCMODULE?=      doc
86 RELEASEPORTSMODULE?=    ports
87
88 # Uncomment this to disable the doc.1 target.  Docs normally require
89 # the ports tree, so NOPORTS can be set together with NODOC in order
90 # to have neither ports or docs.  If only NOPORTS is set to YES, but
91 # docs are still desired, the DOMINIMALDOCPORTS logic below will only
92 # install the ports that are minimally required for the docs.  This is
93 # intended as a compromise, less disk space is required than for using
94 # the entire ports collection (and much less time due to the huge number
95 # of directories it would create), but still quite a bit as well as some
96 # CPU cycles (some of the programs are C++, and things like ghostscript
97 # belong to the required ports nevertheless).
98 #
99 # Setting this also disables building of release note documentation
100 # (RELNOTESng).
101 #NODOC=  YES
102 #NOPORTS=  YES
103
104 # Modify this definition if you want the release notes 
105 # and other release documentation in a language other than English.
106 RELNOTES_LANG?= en_US.ISO8859-1
107
108 # As an alternative to installing the entire ports collection (which
109 # can take a huge amount of time, in particular on slower disks),
110 # setting ${MINIMALDOCPORTS} allows to install and build just those
111 # ports that are really required for getting the docs up & running.
112 .if defined(NOPORTS) && !defined(NODOC)
113 DOMINIMALDOCPORTS=      YES
114 .include "Makefile.inc.docports"
115 RELEASEPORTSMODULE=     ${MINIMALDOCPORTS}
116 .endif
117
118 # Helper variable
119 .if defined(NOPORTS)
120 .if !defined(DOMINIMALDOCPORTS) || ${DOMINIMALDOCPORTS} != "YES"
121 NOPORTSATALL=   YES
122 .endif
123 .endif
124
125 # By default, documentation (Handbook, FAQ, etc.) is built for all
126 # the languages.  To speed up building, set the DOC_LANG to just
127 # the languages you need.  (The language for the release notes is
128 # controlled by the RELNOTES_LANG variable above.)
129 #DOC_LANG=      en_US.ISO8859-1
130 DOCPORTS=       textproc/docproj
131 # Set this to wherever the distfiles required by release procedures.
132 .if defined(DOCDISTFILES)
133 # Respect DOCDISTFILES which is used before.
134 RELEASEDISTFILES?=      ${DOCDISTFILES}
135 .else
136 RELEASEDISTFILES?=      ${.CURDIR}/../../ports/distfiles
137 .endif
138 # Set this to 1 if you want -P to be used for automatic keyboard detection
139 # on the boot floppy.  WARNING: Breaks on some Athlon (K7) motherboards.
140 AUTO_KEYBOARD_DETECT?= 0
141
142 .if !defined(NODOC)
143 DIST_DOCS_ARCH_INDEP=   readme errata early-adopter
144 DIST_DOCS_ARCH_DEP=     installation relnotes hardware
145 .endif
146
147 # Things which without too much trouble can be considered variables
148 # BASE_DISTS are special in that they get full /etc installation sets.
149 #
150 .if ${TARGET_ARCH} == "i386"
151 COMPAT_DISTS?=  compat1x compat20 compat21 compat22 compat3x compat4x
152 .elif ${TARGET_ARCH} != "ia64"
153 COMPAT_DISTS?=  compat4x
154 .endif
155 OTHER_DISTS?=   catpages manpages games proflibs dict info doc
156 CRYPTO_DISTS?=  crypto
157 BASE_DISTS?=    base
158 DISTRIBUTIONS?= ${BASE_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS}
159
160 # mountpoint for filesystems.
161 MNT=                    /mnt
162
163 # Various floppy image parameters.
164 #
165
166 .if ${TARGET_ARCH} == "i386"
167 .if ${TARGET} == "pc98"
168 SMALLBOOTSIZE=          1200
169 BOOTSIZE=               1440
170 SMALLFIXITSIZE=         1200
171 FIXITSIZE=              1440
172 MFSSIZE=                4320
173 BOOTINODE=              80000
174 FIXITINODE=             40000
175 MFSINODE=               8000
176 SMALLBOOTLABEL=         fd1200
177 BOOTLABEL=              fd1440
178 SMALLFIXITLABEL=        fd1200
179 FIXITLABEL=             fd1440
180 MFSLABEL=               minimum3
181 .else
182 DRIVERSIZE=             1440
183 BOOTSIZE=               1440
184 FIXITSIZE=              1440
185 MFSSIZE=                4320
186 BIGBOOTSIZE=            2880
187 DRIVERINODE=            40000
188 BOOTINODE=              80000
189 FIXITINODE=             40000
190 MFSINODE=               8000
191 DRIVERLABEL=            fd1440
192 BOOTLABEL=              fd1440
193 FIXITLABEL=             fd1440
194 MFSLABEL=               minimum3
195 BIGBOOTLABEL=           minimum2
196 .endif
197 .elif ${TARGET_ARCH} == "alpha"
198 MFSSIZE=                4320
199 MFSINODE=               8000
200 MFSLABEL=               auto
201 NO_FLOPPIES=
202 .elif ${TARGET_ARCH} == "sparc64"
203 DISKLABEL=              sunlabel
204 MFSSIZE=                4096
205 MFSINODE=               8192
206 MFSLABEL=               auto
207 MINIROOT=
208 NO_FLOPPIES=
209 .elif ${TARGET_ARCH} == "ia64"
210 MFSINODE=               8192
211 MFSLABEL=               auto
212 MFSSIZE=                8192
213 NO_FLOPPIES=
214 .elif ${TARGET_ARCH} == "amd64"
215 MFSSIZE=                4096
216 MFSINODE=               8192
217 MFSLABEL=               auto
218 NO_FLOPPIES=
219 .endif
220
221 .if exists(/sbin/bsdlabel)
222 DISKLABEL?=             bsdlabel
223 .else
224 DISKLABEL?=             disklabel
225 .endif
226
227 ZIPNSPLIT=              gzip --no-name -9 -c | split -b 1423k -
228
229 # Things that need to be compiled without crypto support in releases
230 .if !defined(FIXCRYPTO) && !make(release) && !make(rerelease)
231 FIXCRYPTO!=     cd ${.CURDIR}/../kerberos5; ${MAKE} -V KPROGS; \
232                 cd ${.CURDIR}/../secure; ${MAKE} -V SPROGS
233 .endif
234
235 # Things which may get you into trouble if you change them
236 MTREEFILES=             ${.CURDIR}/../etc/mtree
237 _R?=                    /R
238 RD=                     ${_R}/stage
239 RND=                    ${RD}/release.doc
240 FD=                     ${_R}/ftp
241 CD=                     ${_R}/cdrom
242 .if ${TARGET} != "pc98"
243 CD_BOOT=                ${CD}/bootonly
244 .endif
245 CD_DISC1=               ${CD}/disc1
246 CD_DISC2=               ${CD}/disc2
247 _MK?=                   ${CHROOTDIR}/mk
248
249 # Where the bootstrap ports (see DOCPORTS) get installed.
250 LOCALDIR=               /usr/local/bin
251
252 .if ${TARGET} != ${MACHINE} && ${DISKLABEL} == "bsdlabel"
253 DOFS_SH=        ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ${TARGET}
254 .else
255 DOFS_SH=        ${.CURDIR}/scripts/doFS.sh ${DISKLABEL} ""
256 .endif
257
258 CRUNCH_TARGETS= boot
259 .if ${TARGET_ARCH} == "i386"
260 CRUNCH_TARGETS+=fixit
261 .if ${TARGET} == "pc98"
262 CRUNCH_TARGETS+=fixit-small
263 .endif
264 .endif
265
266 EXTRAS= ftp.1
267 .if !defined(NOCDROM)
268 EXTRAS+= cdrom.1
269 .if defined(MAKE_ISOS)
270 EXTRAS+= iso.1
271 .endif
272 .if ${TARGET} == "i386" && defined(EMUL_BOOT)
273 BOOTABLE="-eb"
274 .elif ${TARGET} == "pc98"
275 BOOTABLE=
276 .else
277 BOOTABLE="-b"
278 .endif
279 .endif
280
281 .if !defined(NODOC)
282 DOCREL= doc.1 doc.2
283 .endif
284
285 .if !make(release) && !make(rerelease)
286 BINMAKE!=       cd ${.CURDIR}/..; ${MAKE} -V BINMAKE
287 WMAKEENV!=      cd ${.CURDIR}/..; \
288                 ${BINMAKE} ${CROSSENV} -f Makefile.inc1 -V WMAKEENV
289 WMAKE=          ${WMAKEENV} ${BINMAKE}
290 .endif
291
292 CVS_SRCARGS=    -P
293 .if defined(RELEASETAG)
294 CVS_SRCARGS+=   -r ${RELEASETAG}
295 .endif
296
297 CVS_DOCARGS=    -P
298 .if defined(DOCRELEASETAG)
299 CVS_DOCARGS+=   -r ${DOCRELEASETAG}
300 .endif
301
302 CVS_PORTSARGS=  -P
303 .if defined(PORTSRELEASETAG)
304 CVS_PORTSARGS+= -r ${PORTSRELEASETAG}
305 .endif
306
307 WORLDDIR?=      ${.CURDIR}/..
308
309 release rerelease:
310 .if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT)
311         @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false
312 .endif
313 .if defined(NOPORTSATALL) && !defined(NODOC)
314         @echo "Ports are required for building the docs.  Either set NODOC or"
315         @echo "unset NOPORTS, or set at least DOMINIMALDOCPORTS to YES!"
316         @exit 1
317 .endif
318 .if make(release)
319 .if exists(${CHROOTDIR})
320 # The first command will fail on a handful of files that have their schg
321 # flags set.  But it greatly speeds up the next two commands.
322         # NB: clear any vestigal devfs mount, just in case
323         -umount ${CHROOTDIR}/dev > /dev/null 2>&1
324         -rm -rf ${CHROOTDIR} 2>/dev/null
325         -chflags -R noschg ${CHROOTDIR}/.
326         -rm -rf ${CHROOTDIR}
327 .endif
328         mkdir -p ${CHROOTDIR}
329         @echo ">>> make release for ${TARGET} started on `LC_ALL=C TZ=GMT date`"
330         cd ${WORLDDIR} && ${NATIVEMAKE} -DNOGAMES -DNOHTML -DNOINFO -DNOMAN \
331             -DNOPROFILE installworld DESTDIR=${CHROOTDIR}
332         cd ${WORLDDIR}/etc && ${NATIVEMAKE} distribution DESTDIR=${CHROOTDIR}
333         if [ -f /etc/resolv.conf ]; then \
334                 cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
335         fi
336 .if defined(EXTLOCALDIR)
337         rm -rf ${CHROOTDIR}/usr/local
338         cd ${CHROOTDIR}/usr && cp -R -H ${EXTLOCALDIR} local
339 .endif
340         rm -rf ${CHROOTDIR}/usr/src
341 .if defined(EXTSRCDIR)
342         cd ${CHROOTDIR}/usr && \
343                 cp -R -H ${EXTSRCDIR} src
344 .else
345         cd ${CHROOTDIR}/usr && \
346                 ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} co ${CVSCMDARGS} ${CVS_SRCARGS} ${RELEASESRCMODULE}
347 .endif
348 .if defined(LOCAL_PATCHES) && !empty(LOCAL_PATCHES)
349 .for p in ${LOCAL_PATCHES}
350 .if exists(${p})
351         patch -d ${CHROOTDIR}/usr/${RELEASESRCMODULE} ${PATCH_FLAGS} < ${p}
352 .endif
353 .endfor
354 .endif
355 .if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT})
356         cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT}
357 .endif
358         rm -rf ${CHROOTDIR}/usr/ports
359 .if !defined(NOPORTSATALL)
360         cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} co ${CVSCMDARGS} ${CVS_PORTSARGS} ${RELEASEPORTSMODULE}
361 .endif
362 .if !defined(NODOC)
363         rm -rf ${CHROOTDIR}/usr/doc
364 .if defined(EXTDOCDIR)
365         cd ${CHROOTDIR}/usr && cp -R -H ${EXTDOCDIR} doc
366 .else
367         cd ${CHROOTDIR}/usr && ${CVSPREFIX} cvs -R ${CVSARGS} -d ${CVSROOT} co ${CVSCMDARGS} ${CVS_DOCARGS} ${RELEASEDOCMODULE}
368 .endif
369         if [ -d ${RELEASEDISTFILES}/ ]; then \
370                 cp -rp ${RELEASEDISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
371         else \
372                 mkdir -p ${CHROOTDIR}/usr/ports/distfiles; \
373         fi
374 .if !defined(NO_PREFETCHDISTFILES)
375         @cd ${.CURDIR} && ${MAKE} fetch-distfiles
376 .endif
377 .endif
378 .endif
379 .if make(rerelease)
380 .if !defined(RELEASENOUPDATE)
381 .if !defined(RELEASETAG)
382         cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d -A
383 .else
384         cd ${CHROOTDIR}/usr/src && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d -r ${RELEASETAG}
385 .endif
386         rm -f ${CHROOTDIR}/tmp/.world_done 
387 .if !defined(NOPORTS)
388         cd ${CHROOTDIR}/usr/ports && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d
389 .endif
390 .if defined(DOMINIMALDOCPORTS) && ${DOMINIMALDOCPORTS} == "YES"
391         for i in ${MINIMALDOCPORTS}; do \
392                 ( cd ${CHROOTDIR}/usr/$$i && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d ) ; \
393         done
394 .endif
395 .if !defined(NODOC)
396         cd ${CHROOTDIR}/usr/doc && ${CVSPREFIX} cvs -R ${CVSARGS} -q update ${CVSCMDARGS} -P -d
397 .endif
398 .endif
399 .endif
400         # Add version information to those things that need it.
401         if [ ! -f ${CHROOTDIR}/tmp/.world_done ]; then \
402                 cd ${CHROOTDIR}/usr/src/sys/conf && \
403                 mv newvers.sh foo && \
404                 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && \
405                 rm foo; \
406         fi
407         -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release
408         echo "#!/bin/sh"                        > ${_MK}
409         echo "set -ex"                          >> ${_MK}
410         echo "trap 'umount /dev || true' 0"     >> ${_MK}
411         echo "_RELTARGET=\$${1:-doRELEASE}"     >> ${_MK}
412 .for var in \
413         AUTO_KEYBOARD_DETECT \
414         BOOT_CONFIG \
415         BUILDNAME \
416         CD_EXTRA_BITS \
417         DISTRIBUTIONS \
418         DOC_LANG \
419         DOMINIMALDOCPORTS \
420         EXTRA_SRC \
421         FIXCRYPTO \
422         FTP_PASSIVE_MODE \
423         FTP_PROXY \
424         HTTP_PROXY \
425         KERNELS \
426         KERNEL_FLAGS \
427         MAKE_ISOS \
428         NOCDROM \
429         NODOC \
430         NOPORTS \
431         NOSHARED \
432         NOSRC \
433         NO_CPU_CFLAGS \
434         NO_CPU_COPTFLAGS \
435         NO_FLOPPIES \
436         NO_SENDMAIL \
437         RELEASETAG \
438         RELNOTES_LANG \
439         TARGET \
440         TARGET_ARCH \
441         WORLD_FLAGS
442 .if defined(${var})
443         echo "export ${var}=\"${${var}}\""      >> ${_MK}
444 .endif
445 .endfor
446         # Don't remove this, or the build will fall over!
447         echo "export RELEASEDIR=${_R}"          >> ${_MK}
448         echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}"    >> ${_MK}
449         echo "export MANBUILDCAT=YES"           >> ${_MK}
450         # NB: these may fail if the host is running w/o devfs
451         echo "umount /dev >/dev/null 2>&1 || true" >> ${_MK}
452         echo "mount -t devfs devfs /dev >/dev/null 2>&1 || true"        >> ${_MK}
453         echo "if [ ! -f /tmp/.world_done ]; then" >> ${_MK}
454         echo "  cd /usr/src"                    >> ${_MK}
455         echo "  ${CROSSMAKE} ${WORLD_FLAGS} -DNOCLEAN buildworld && \\" >> ${_MK}
456         echo "  touch /tmp/.world_done"         >> ${_MK}
457         echo "fi"                               >> ${_MK}
458         echo "if [ ! -f /tmp/.skip_ports ]; then" >> ${_MK}
459         echo "  echo \">>> make readmes started on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
460         echo "  cd /usr/ports"                  >> ${_MK}
461         echo "  make ${PORTREADMES_FLAGS} readmes" >> ${_MK}
462         echo "  touch /tmp/.skip_ports"         >> ${_MK}
463         echo "  echo \">>> make readmes finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
464         echo "fi"                               >> ${_MK}
465         echo "cd /usr/src/release"              >> ${_MK}
466         echo "make obj"                         >> ${_MK}
467         echo "make \$${_RELTARGET}"             >> ${_MK}
468         echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${_MK}
469         chmod 755 ${_MK}
470 .if defined(NOPORTS) || defined(NOPORTREADMES)
471         touch ${CHROOTDIR}/tmp/.skip_ports
472 .endif
473         # Ensure md.ko is loaded if md(4) is not statically compiled into the kernel
474         -mdconfig 2>/dev/null
475         env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
476
477 clean:
478         rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-9] release.10 \
479             ${EXTRAS}
480
481 fetch-distfiles:
482         @for i in ${DOCPORTS}; do \
483                 cd ${CHROOTDIR}/usr/ports/$$i && \
484                         make PORTSDIR=${CHROOTDIR}/usr/ports BATCH=yes \
485                         WITHOUT_X11=yes JADETEX=no WITHOUT_PYTHON=yes \
486                         checksum-recursive ; \
487         done
488
489 # Clean out ${_R} and make the directory structure.
490 release.1:
491         mkdir -p ${_R}
492         -rm -rf ${_R}/* 2> /dev/null
493         -chflags -R noschg ${_R}/.
494         rm -rf ${_R}/*
495         mkdir ${RD}
496 .if !defined(NO_FLOPPIES)
497         mkdir ${RD}/floppies
498 .endif
499         mkdir ${RD}/trees
500         mkdir ${RD}/kernels
501         for i in ${DISTRIBUTIONS} special; do \
502                 mkdir ${RD}/trees/$$i && \
503                 mtree -deU -f ${MTREEFILES}/BSD.root.dist \
504                     -p ${RD}/trees/$$i > /dev/null && \
505                 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \
506                     -p ${RD}/trees/$$i/usr > /dev/null && \
507                 mtree -deU -f ${MTREEFILES}/BSD.include.dist \
508                     -p ${RD}/trees/$$i/usr/include > /dev/null && \
509                 mtree -deU -f ${MTREEFILES}/BSD.var.dist \
510                     -p ${RD}/trees/$$i/var > /dev/null ; \
511         done
512         touch ${.TARGET}
513
514 # Install the system into the various distributions.
515 release.2:
516         cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/base
517         cd ${.CURDIR}/.. && ${CROSSMAKE} distributeworld DISTDIR=${RD}/trees
518         touch ${.TARGET}
519
520 # Build and install non-crypto versions of some tools.
521 release.3:
522         # Handle some grief caused by the munition braindeadness.
523         cd ${.CURDIR}/..; \
524         ${CROSSMAKE} ${WORLD_FLAGS} -DNO_MAKEDB_RUN -DNOCRYPT \
525             SUBDIR_OVERRIDE="${FIXCRYPTO}" \
526             buildworld distributeworld DISTDIR=${RD}/trees
527         -chflags -R noschg ${RD}/trees
528         touch ${.TARGET}
529
530 # Make and install the generic kernel(s).
531 release.4:
532 .for kernel in ${KERNELS}
533         cd ${.CURDIR}/..; \
534         ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
535             KERNCONF=${kernel} INSTKERNNAME=${kernel} kernel \
536             DESTDIR=${RD}/trees/base
537 .endfor
538         # Install a standard boot kernel+modules.
539         cd ${.CURDIR}/..; \
540         ${CROSSMAKE} ${KERNEL_FLAGS} \
541             kernel \
542             DESTDIR=${RD}/trees/base; \
543         cd ${.CURDIR}/..; \
544         ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES \
545             reinstallkernel -DINSTALL_DEBUG \
546             DESTDIR=${RD}/trees/base
547         touch ${.TARGET}
548
549 # Make and install the three crunched binaries which live on the floppies.
550 # You are not supposed to like this :-)
551 release.5:
552         rm -rf ${RD}/crunch
553         mkdir -p ${RD}/crunch
554 .for j in ${CRUNCH_TARGETS}
555 .if exists(${.CURDIR}/${TARGET}/${j}_crunch.conf)
556         rm -rf ${j}_crunch
557         mkdir ${j}_crunch
558         cd ${j}_crunch; ${WMAKEENV} crunchgen -o ${.CURDIR}/${TARGET}/${j}_crunch.conf
559         cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk subclean
560         cd ${.CURDIR}/..; ${BINMAKE} -f Makefile.inc1 _build-tools
561         cd ${j}_crunch; ${WMAKE} -f ${j}_crunch.mk \
562             CFLAGS="-Os -pipe" -DNO_CPU_CFLAGS all
563         ${WMAKEENV} strip -R .comment ${j}_crunch/${j}_crunch
564         mv ${j}_crunch/${j}_crunch ${RD}/crunch/${j}
565 .endif
566 .endfor
567         touch ${.TARGET}
568
569 #
570 # --==## Fix up the distributions. ##==--
571 #
572 release.6:
573         # Create any "synthetic dists" now.
574         @for i in ${DISTRIBUTIONS}; do \
575                 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \
576                         echo -n "Running $$i dist creation script... "; \
577                         env RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \
578                         echo "Done."; \
579                 fi \
580         done \
581
582         # Remove all the directories we don't need.
583         -cd ${RD}/trees && \
584                 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir
585         touch ${.TARGET}
586
587 #
588 # --==## Package up the tarballs from assembled trees ##==--
589 #
590 release.7:
591         rm -rf ${RD}/dists
592         mkdir -p ${RD}/dists
593         @for i in ${DISTRIBUTIONS} ; \
594         do \
595                 if [ -d ${RD}/trees/$${i} ] ; then \
596                         cd ${.CURDIR} && $(MAKE) doTARBALL \
597                                 SD=${RD}/trees/$${i} \
598                                 TN=$$i TD=$$i ARG="." && \
599                         echo "$${i} distribution is finished."; \
600                 fi ; \
601         done
602 .if !defined(NOPORTS)
603         # XXX: Inline stripped version of doTARBALL
604         @rm -rf ${RD}/dists/ports/ports*
605         @mkdir -p ${RD}/dists/ports
606         @echo rolling ports/ports tarball
607         @tar --exclude CVS --exclude 'ports/distfiles/*' -czf \
608           ${RD}/dists/ports/ports.tgz -C /usr ports
609         @cp ${.CURDIR}/scripts/ports-install.sh ${RD}/dists/ports/install.sh
610         @(cd ${RD}/dists/ports; \
611           rm -f CHECKSUM.MD5; \
612           md5 * > CHECKSUM.MD5)
613         @echo "ports distribution is finished."
614 .endif
615         touch ${.TARGET}
616
617
618 #
619 # --==## Make source dists ##==--
620 #
621 release.8:
622 .if !defined(NOSRC)
623         @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \
624                 TD=src TN=sbase ARG="[A-Z]*"
625         @for i in `cd /usr/src && echo [a-z]*` ; do \
626                 if [ -d /usr/src/$$i ] ; then \
627                         cd ${.CURDIR} && $(MAKE) doTARBALL \
628                                 TN=`echo s$$i | tr -d '.' | \
629                                     sed -e 's/usr/u/' \
630                                         -e 's/kerberos5/krb5/'` \
631                                 SD=/usr/src TD=src ARG="$$i" ; \
632                 fi ; \
633         done
634 .if defined(EXTRA_SRC)
635         @set ${EXTRA_SRC} && \
636         while [ $$# -ge 2 ] ; do \
637                 if [ -d /usr/src/$$1 ] ; then \
638                         cd ${.CURDIR} && $(MAKE) doTARBALL \
639                                 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \
640                 fi && shift && shift ; \
641         done
642 .endif
643         if [ -d ${RD}/dists/crypto ] ; then ( cd ${RD}/dists/src && \
644                 if [ -f ssecure.aa ] ; then mv ssecure.* ../crypto ; fi && \
645                 if [ -f scrypto.aa ] ; then mv scrypto.* ../crypto ; fi && \
646                 if [ -f skrb5.aa ] ; then mv skrb5.* ../crypto ; fi ; \
647                 cd ${RD}/dists/crypto; rm -f CHECKSUM.MD5; \
648                 md5 * > CHECKSUM.MD5 ) ; fi
649         (cd ${RD}/dists/src; rm -f CHECKSUM.MD5; md5 * > CHECKSUM.MD5)
650         @echo "src distribution is finished."
651 .endif
652         touch ${.TARGET}
653
654 # Complete the bootfd
655 #
656 # Now, just to get this picture down once and for all:
657 #
658 # +------------------------------------------------------------------------+
659 # |boot.flp                                                                |
660 # +-----+-----+------------------------------------------------------------+
661 # |boot1|boot2|floppy filesystem "bootfd"                                  |
662 # +-----+-----+-+----------------------+---------------------------------+-+
663 #               |kernel.gz             |mfsroot.gz                       |
664 #               +----------------------+---------------------------------+
665 #
666
667 release.9:
668 .if exists(${.CURDIR}/../sys/boot/${TARGET}/loader)
669         cd ${.CURDIR}/../sys/boot/${TARGET}/loader; \
670         ${WMAKE} clean cleandepend; \
671         ${WMAKE} -DNOMAN -DNOFORTH all; \
672         ${WMAKE} -DNOMAN -DNOFORTH install DESTDIR=${RD}/trees/special
673 .endif
674         cp ${RD}/trees/base/etc/disktab /etc
675         rm -rf ${RD}/mfsfd
676         mkdir ${RD}/mfsfd
677         cd ${RD}/mfsfd && \
678                 mkdir -p etc/defaults dev mnt stand/etc/defaults stand/help
679         @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \
680                 DIR=${RD}/mfsfd/stand ZIP=false
681         ( cd ${RD}/mfsfd && \
682           for dir in bin sbin ; do \
683                 ln -sf /stand $$dir; \
684           done )
685         cp ${RD}/trees/base/sbin/dhclient-script ${RD}/mfsfd/stand
686 .if ${TARGET} == "pc98"
687         cp ${.CURDIR}/../etc/defaults/pccard.conf ${RD}/mfsfd/etc/defaults/pccard.conf
688 .endif
689         cp ${.CURDIR}/../etc/usbd.conf ${RD}/mfsfd/etc/usbd.conf
690         ( for F in defaults/rc.conf netconfig protocols ; do \
691                 sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
692                 ${RD}/trees/base/etc/$$F > ${RD}/mfsfd/stand/etc/$$F ; \
693           done )
694         grep -E '^(ftp|nameserver|domain|sunrpc|cmd|nfsd)[^-\w]' \
695             ${RD}/trees/base/etc/services | \
696             sed -e '/^#.*$$/d' -e 's/[:space:]*#.*$$//g' \
697             > ${RD}/mfsfd/stand/etc/services
698         grep 'operator' ${RD}/trees/base/etc/group \
699             > ${RD}/mfsfd/stand/etc/group
700         ln ${RD}/mfsfd/stand/etc/services ${RD}/mfsfd/etc/services
701         ln ${RD}/mfsfd/stand/etc/group ${RD}/mfsfd/etc/group
702         ln ${RD}/mfsfd/stand/etc/netconfig ${RD}/mfsfd/etc/netconfig
703         cp ${RD}/trees/base/COPYRIGHT ${RD}/mfsfd/stand/help/COPYRIGHT.hlp
704 .if !defined(NODOC)
705         @for i in ${DIST_DOCS_ARCH_INDEP}; do \
706           cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
707         done
708         @for i in ${DIST_DOCS_ARCH_DEP}; do \
709           cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt ${RD}/mfsfd/stand/help/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
710         done
711         @mv ${RD}/mfsfd/stand/help/INSTALLATION.TXT ${RD}/mfsfd/stand/help/INSTALL.TXT
712         @mv ${RD}/mfsfd/stand/help/EARLY-ADOPTER.TXT ${RD}/mfsfd/stand/help/EARLY.TXT
713 .endif
714         -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd
715         @mkdir -p ${RD}/mfsfd/boot
716 .if ${TARGET_ARCH} != "ia64"
717         @cp ${RD}/trees/base/boot/boot* ${RD}/mfsfd/boot
718 .endif
719 .if ${TARGET} == "i386" || ${TARGET_ARCH} == "amd64"
720         @cp ${RD}/trees/base/boot/mbr ${RD}/mfsfd/boot
721 .endif
722         @tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
723                 tar xf - -C ${RD}/mfsfd/stand
724 .if defined(SMALLBOOTSIZE)
725         @mkdir -p ${RD}/mfsroot-small
726 .if exists(${.CURDIR}/${TARGET}/drivers-small.conf)
727         @mkdir -p ${RD}/mfsfd/modules
728         @awk -f  ${.CURDIR}/scripts/driver-copy2.awk 2 \
729             ${.CURDIR}/${TARGET}/drivers-small.conf \
730             ${RD}/trees/base/boot/kernel ${RD}/mfsfd/modules
731 .endif
732         sh -e ${DOFS_SH} ${RD}/mfsroot-small/mfsroot ${RD} ${MNT} \
733                 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
734         @gzip -9nv ${RD}/mfsroot-small/mfsroot
735         @rm -rf ${RD}/mfsfd/modules
736 .endif
737 .if exists(${.CURDIR}/${TARGET}/drivers.conf)
738         @mkdir -p ${RD}/mfsfd/modules
739         @awk -f  ${.CURDIR}/scripts/driver-copy2.awk 2 \
740             ${.CURDIR}/${TARGET}/drivers.conf \
741             ${RD}/trees/base/boot/kernel ${RD}/mfsfd/modules
742 .endif
743         @mkdir -p ${RD}/mfsroot
744         sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
745                 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
746         @gzip -9nv ${RD}/mfsroot/mfsroot
747         touch ${.TARGET}
748
749 release.10:
750 .if !defined(NO_FLOPPIES)
751 .if exists(${.CURDIR}/${TARGET}/drivers.conf)
752         @echo "Making the drivers floppy."
753         @rm -rf ${RD}/driversfd
754         @mkdir ${RD}/driversfd
755         @awk -f  ${.CURDIR}/scripts/driver-copy2.awk 3 \
756             ${.CURDIR}/${TARGET}/drivers.conf \
757             ${RD}/trees/base/boot/kernel ${RD}/driversfd
758         -@rmdir ${RD}/driversfd
759         if [ -d ${RD}/driversfd ]; then \
760             sh -e ${DOFS_SH} \
761                 ${RD}/floppies/drivers.flp ${RD} ${MNT} ${DRIVERSIZE} \
762                 ${RD}/driversfd ${DRIVERINODE} ${DRIVERLABEL}; \
763             cd ${RD}/driversfd && awk -f  ${.CURDIR}/scripts/driver-desc.awk \
764                 *.dsc >> ${RD}/floppies/DRIVERS.TXT; \
765         fi
766 .endif
767 .if defined(BOOTSIZE)
768         @echo "Making the regular boot floppy."
769         @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
770 .endif
771 .if defined(SMALLBOOTSIZE)
772         @echo "Making the small boot floppy."
773         @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern-small FDSIZE=SMALL
774 .endif
775 .if defined(BIGBOOTSIZE)
776         @echo "Making the big boot floppy."
777         @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot FDSIZE=BIG
778 .endif
779 .if defined(FIXITSIZE) || defined(SMALLFIXITSIZE)
780         @echo "Making fixit floppy."
781         @rm -rf ${RD}/fixitfd
782         @mkdir ${RD}/fixitfd
783         @cd ${RD}/fixitfd && \
784                 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \
785                 usr/share/misc
786         @cp ${RD}/trees/base/etc/spwd.db ${RD}/trees/base/etc/group \
787                 ${RD}/fixitfd/etc
788         @sed -e 's/#.*//' ${RD}/trees/base/etc/protocols \
789                 > ${RD}/fixitfd/etc/protocols
790         @sed -e 's/#.*//' ${RD}/trees/base/usr/share/misc/scsi_modes \
791                 > ${RD}/fixitfd/usr/share/misc/scsi_modes
792         @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile
793         @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
794         @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
795         @chmod 555 ${RD}/fixitfd/stand/tar
796 .if defined(SMALLFIXITSIZE)
797         @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
798                 DIR=${RD}/fixitfd/stand ZIP=false
799         @sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp \
800                 ${RD} ${MNT} ${SMALLFIXITSIZE} ${RD}/fixitfd ${FIXITINODE} \
801                 ${SMALLFIXITLABEL}
802         @rm -rf ${RD}/fixitfd/stand
803         @mkdir ${RD}/fixitfd/stand
804 .endif
805 .if defined(FIXITSIZE)
806         @cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
807                 DIR=${RD}/fixitfd/stand ZIP=false
808         @sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} \
809                 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
810 .endif
811 .endif
812 # Do our last minute floppies directory setup in a convenient place.
813 .if !defined(NODOC)
814         @cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
815                 ${RD}/floppies/README.TXT
816         @(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
817 .else
818         @(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
819 .endif
820 .endif
821         touch ${.TARGET}
822
823 #
824 # --==## Setup a suitable ftp-area ##==--
825 #
826 ftp.1:
827         @echo "Setting up FTP distribution area"
828         @mkdir -p ${FD}
829         -@ln -s . ${FD}/${BUILDNAME}
830 .if !defined(NO_FLOPPIES)
831         @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
832 .endif
833         @cd ${RD}/dists && find . -print | cpio -dumpl ${FD}
834 .if !defined(NODOC)
835         @for i in ${DIST_DOCS_ARCH_INDEP}; do \
836           cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
837           cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
838         done
839         @for i in ${DIST_DOCS_ARCH_DEP}; do \
840           cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
841           cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html ${FD}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
842         done
843         @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${FD}
844         @mv ${FD}/INSTALLATION.TXT ${FD}/INSTALL.TXT
845         @mv ${FD}/INSTALLATION.HTM ${FD}/INSTALL.HTM
846         @mv ${FD}/EARLY-ADOPTER.TXT ${FD}/EARLY.TXT
847         @mv ${FD}/EARLY-ADOPTER.HTM ${FD}/EARLY.HTM
848 .endif
849         @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf
850         touch ${.TARGET}
851
852 #
853 # --==## Setup a suitable cdrom-area ##==--
854 #
855 cdrom.1:
856         @echo "Setting up CDROM distribution area"
857         @mkdir -p ${CD_BOOT} ${CD_DISC1} ${CD_DISC2}
858         -@ln -s . ${CD_DISC1}/${BUILDNAME}
859 .if !defined(NO_FLOPPIES)
860         @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1}
861 .endif
862         @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1}
863         @for i in ${DISTRIBUTIONS} ; \
864         do \
865                 if [ -d ${RD}/trees/$${i} ] ; then \
866                         chflags -R noschg ${RD}/trees/$${i} || true ; \
867                         ( cd ${RD}/trees/$${i} && \
868                         find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \
869                 fi \
870         done
871         @rm -f ${CD_DISC2}/.profile
872         @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile
873         @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf
874         @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf
875 .if !defined(NODOC)
876         @for i in ${DIST_DOCS_ARCH_INDEP}; do \
877           cp ${RND}/${RELNOTES_LANG}/$$i/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
878           cp ${RND}/${RELNOTES_LANG}/$$i/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
879         done
880         @for i in ${DIST_DOCS_ARCH_DEP}; do \
881           cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.txt ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.TXT; \
882           cp ${RND}/${RELNOTES_LANG}/$$i/${TARGET}/article.html ${CD_DISC1}/`echo $${i} | tr 'a-z' 'A-Z'`.HTM; \
883         done
884         @cp ${RND}/${RELNOTES_LANG}/readme/docbook.css ${CD_DISC1}
885         @mv ${CD_DISC1}/INSTALLATION.TXT ${CD_DISC1}/INSTALL.TXT
886         @mv ${CD_DISC1}/INSTALLATION.HTM ${CD_DISC1}/INSTALL.HTM
887         @mv ${CD_DISC1}/EARLY-ADOPTER.TXT ${CD_DISC1}/EARLY.TXT
888         @mv ${CD_DISC1}/EARLY-ADOPTER.HTM ${CD_DISC1}/EARLY.HTM
889 .endif
890 .if ${TARGET} != "pc98"
891         @echo "Setting up boot area"
892         @rm -f ${CD_DISC2}/boot/loader.conf
893         @cp ${RD}/mfsroot/mfsroot.gz ${CD_DISC2}/boot/mfsroot.gz
894         @echo 'mfsroot_load="YES"' > ${CD_DISC2}/boot/loader.conf
895         @echo 'mfsroot_type="mfs_root"' >> ${CD_DISC2}/boot/loader.conf
896         @echo 'mfsroot_name="/boot/mfsroot"' >> ${CD_DISC2}/boot/loader.conf
897 .if defined(CD_BOOT)
898         @cp -Rp ${CD_DISC2}/boot ${CD_BOOT}
899 .if defined(MINIROOT)
900         @mkdir -p ${FD}/miniroot
901         @sh -e ${DOFS_SH} ${FD}/miniroot/miniroot.ufs \
902             ${RD} ${MNT} 0 ${CD_BOOT} 8192 auto
903         @gzip -9v ${FD}/miniroot/miniroot.ufs
904 .endif
905 .endif
906         @cp -Rp ${CD_DISC2}/boot ${CD_DISC1}
907 .if ${TARGET} == "i386" && defined(EMUL_BOOT) && !defined(NO_FLOPPIES)
908         # In case bootable ISO with floppy emulation is desired.
909 .if defined(CD_BOOT)
910         @mkdir -p ${CD_BOOT}/floppies
911         @cp ${CD_DISC1}/floppies/boot.flp ${CD_BOOT}/floppies
912 .endif
913         @mkdir -p ${CD_DISC2}/floppies
914         @cp ${CD_DISC1}/floppies/boot.flp ${CD_DISC2}/floppies
915 .endif
916 .endif
917         touch ${.TARGET}
918
919 iso.1:
920 .if exists(${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh)
921         @echo "Creating ISO images..."
922 .if defined(CD_BOOT)
923         @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
924             fbsd_bootonly \
925             ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT}
926 .endif
927         @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
928             fbsd_miniinst \
929             ${CD}/${BUILDNAME}-${TARGET}-miniinst.iso ${CD_DISC1}
930         @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \
931             fbsd_livefs \
932             ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2}
933 .if defined(CD_EXTRA_BITS)
934         @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \
935             ${BOOTABLE} fbsd_boot \
936             ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \
937             ${CD_EXTRA_BITS} \
938             && false
939 .endif
940         touch ${.TARGET}
941 .else
942         @echo "Do not know how to create an ISO for ${TARGET_ARCH}."
943 .endif
944
945 #
946 # --==## Documentation Project files such as the Handbook and FAQ ##==--
947 #
948 doc.1:
949         @echo "Making docs..."
950         @for i in ${DOCPORTS}; do \
951             cd /usr/ports/$$i && \
952             env -i FTP_PASSIVE_MODE=$${FTP_PASSIVE_MODE:-no} PATH=$${PATH} \
953                 make all install clean BATCH=yes WITHOUT_X11=yes JADETEX=no \
954                 WITHOUT_PYTHON=yes FORCE_PKG_REGISTER=yes; \
955         done
956         @cd /usr/doc && make all install 'FORMATS=html html-split txt' INSTALL_COMPRESSED='' DOCDIR=${RD}/trees/base/usr/share/doc
957         touch ${.TARGET}
958
959 #
960 # --==## RELNOTESng:  Next-generation replacements for *.TXT files ##==--
961 #
962 doc.2:
963         @echo "Making release documentation..."
964         @cd ${.CURDIR}/doc && make all install clean 'FORMATS=html txt' INSTALL_COMPRESSED='' DOCDIR=${RND}
965         touch ${.TARGET}
966
967 # Various "subroutine" and other supporting targets.
968
969 # RD=
970 # SD=
971 # TD=
972 # ARG=
973 doTARBALL:
974 .if !defined(SD)
975         @echo "SD undefined in doTARBALL" && exit 1
976 .endif
977 .if !defined(TD)
978         @echo "TD undefined in doTARBALL" && exit 1
979 .endif
980 .if !defined(ARG)
981         @echo "ARG undefined in doTARBALL" && exit 1
982 .endif
983         @rm -rf ${RD}/dists/${TD}/${TN}*
984         @mkdir -p ${RD}/dists/${TD}
985         @( cd ${SD} && \
986                 tn=`echo ${TN} | tr 'A-Z' 'a-z' | cut -c1-8` && \
987                 echo rolling ${TD}/$$tn tarball &&\
988                 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \
989                 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \
990                 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \
991                    ${RD}/dists/${TD}/$$tn.inf && \
992                 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \
993                   cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \
994                 fi && \
995                 if [ "${SD}" != "/usr/src" ]; then \
996                         mtree -c -i -p ${SD}/${ARG} \
997                           -k gname,md5digest,mode,nlink,uname,size,link,type \
998                           > ${RD}/dists/${TD}/$$tn.mtree ; \
999                 else \
1000                         true; \
1001                 fi; \
1002                 (cd ${RD}/dists/${TD}; \
1003                    rm -f CHECKSUM.MD5; \
1004                    md5 * > CHECKSUM.MD5) \
1005         )
1006
1007 doRELEASE: release.1 release.2 release.3 ${DOCREL} release.4 release.5 \
1008     release.6 release.7 release.8 release.9 release.10 ${EXTRAS}
1009         @echo "Release done"
1010
1011 floppies:
1012         @rm -f release.5 release.9 release.10
1013         @cd ${.CURDIR} && ${MAKE} release.5 release.9 release.10
1014         @cd ${RD} && find floppies -print | cpio -dumpl ${FD}
1015
1016 installCRUNCH:
1017 .if !defined(CRUNCH)
1018         @echo "CRUNCH undefined in installCRUNCH" && exit 1
1019 .endif
1020 .if !defined(DIR)
1021         @echo "DIR undefined in installCRUNCH" && exit 1
1022 .endif
1023 .if !defined(ZIP)
1024         @echo "ZIP undefined in installCRUNCH" && exit 1
1025 .endif
1026         @if ${ZIP} ; then \
1027                 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \
1028         else \
1029                 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \
1030         fi
1031         @chmod 555 ${DIR}/${CRUNCH}_crunch
1032         @if [ -f ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf ] ; then \
1033                 for i in `crunchgen -l ${.CURDIR}/${TARGET}/${CRUNCH}_crunch.conf` ; do \
1034                         ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1035                 done \
1036         else \
1037                 for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \
1038                         ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \
1039                 done \
1040         fi
1041
1042 #
1043 # --==## Put a filesystem into a BOOTMFS kernel ##==--
1044 #
1045 doMFSKERN:
1046         @echo "Running ${.TARGET} for ${FSIMAGE}"
1047         @rm -f ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
1048         @cd ${.CURDIR}/../sys/${TARGET}/conf; \
1049         if [ -r ${.CURDIR}/${TARGET}/dokern.sh ]; then \
1050             sh ${.CURDIR}/${TARGET}/dokern.sh ${FDSIZE}; \
1051         else \
1052             sed -e 's/ident.*GENERIC/ident              BOOTMFS/g'; \
1053         fi < GENERIC > BOOTMFS; \
1054         [ -r GENERIC.hints ] && cp GENERIC.hints BOOTMFS.hints
1055 .if defined(FDSIZE) && ${FDSIZE} == "SMALL" && \
1056     exists(${.CURDIR}/${TARGET}/drivers-small.conf)
1057         @awk -f ${.CURDIR}/scripts/driver-remove.awk \
1058                 ${.CURDIR}/${TARGET}/drivers-small.conf \
1059                 ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
1060 .elif exists(${.CURDIR}/${TARGET}/drivers.conf)
1061         @awk -f ${.CURDIR}/scripts/driver-remove.awk \
1062                 ${.CURDIR}/${TARGET}/drivers.conf \
1063                 ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
1064 .endif
1065         cd ${.CURDIR}/..; \
1066         KERNEL_KO=BOOTMFS KODIR= \
1067             ${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES -DNO_KERNELCLEAN \
1068             KERNCONF=BOOTMFS COPTFLAGS="-Os -pipe" -DNO_CPU_COPTFLAGS \
1069             buildkernel reinstallkernel \
1070             DESTDIR=${RD}/kernels
1071         [ -r ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ] && \
1072         cp ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ${RD}/kernels
1073         @rm -rf ${RD}/image.${FSIMAGE}
1074         @mkdir ${RD}/image.${FSIMAGE}
1075         @cd ${RD}/kernels && \
1076           (chflags noschg BOOTMFS || true) && \
1077           ${WMAKEENV} strip -R .comment BOOTMFS && \
1078           cp BOOTMFS BOOTMFS.${FSIMAGE} && \
1079           [ -r BOOTMFS.hints ] && mv BOOTMFS.hints BOOTMFS.${FSIMAGE}.hints
1080         mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
1081         @echo "Setting up /boot directory for ${FSIMAGE} floppy"
1082         @mkdir -p ${RD}/image.${FSIMAGE}/boot
1083 .if ${TARGET} == "i386"
1084         @${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o \
1085             -o ${RD}/image.${FSIMAGE}/boot/loader ${RD}/trees/special/boot/loader
1086 .else
1087         @cp ${RD}/trees/special/boot/loader ${RD}/image.${FSIMAGE}/boot
1088 .endif
1089         @[ -r ${RD}/kernels/BOOTMFS.${FSIMAGE}.hints ] && \
1090           sed -e '/^hint/s/^/set /' -e '/^#/d' \
1091             ${RD}/kernels/BOOTMFS.${FSIMAGE}.hints > \
1092             ${RD}/image.${FSIMAGE}/boot/device.hints && \
1093           echo "include /boot/device.hints" > ${RD}/image.${FSIMAGE}/boot/loader.rc
1094         @echo "load /kernel" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1095 .if !defined(FDSIZE) || ${FDSIZE} != "BIG"
1096         @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1097         @echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1098         @echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1099 .endif
1100         @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1101         @echo "set hint.acpi.0.disabled=1" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1102         @if [ -r ${RD}/floppies/drivers.flp ]; then \
1103             echo "set driver_floppy=YES" >> ${RD}/image.${FSIMAGE}/boot/loader.rc; \
1104         fi
1105         @echo "set module_path=\"/modules;/dist\"" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1106         @echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1107         @echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
1108 .if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
1109         @echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config
1110 .endif
1111         @gzip -9v ${RD}/image.${FSIMAGE}/kernel
1112         @rm -f ${RD}/floppies/${FSIMAGE}.flp
1113 .if defined(FDSIZE) && ${FDSIZE} == "BIG"
1114         @cp ${RD}/mfsroot/mfsroot.gz ${RD}/image.${FSIMAGE}
1115         sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp \
1116                 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \
1117                 ${BOOTINODE} ${BIGBOOTLABEL}
1118 .elif defined(FDSIZE) && ${FDSIZE} == "SMALL"
1119         sh -e ${DOFS_SH} ${RD}/floppies/mfsroot-small.flp \
1120                 ${RD} ${MNT} ${SMALLBOOTSIZE} ${RD}/mfsroot-small/mfsroot.gz \
1121                 ${BOOTINODE} ${SMALLBOOTLABEL}
1122         sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp \
1123                 ${RD} ${MNT} ${SMALLBOOTSIZE} ${RD}/image.${FSIMAGE} \
1124                 ${BOOTINODE} ${SMALLBOOTLABEL}
1125 .else
1126         sh -e ${DOFS_SH} ${RD}/floppies/mfsroot.flp \
1127                 ${RD} ${MNT} ${BOOTSIZE} ${RD}/mfsroot/mfsroot.gz \
1128                 ${BOOTINODE} ${BOOTLABEL}
1129         sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp \
1130                 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \
1131                 ${BOOTINODE} ${BOOTLABEL}
1132 .endif
1133         @echo "Created ${RD}/floppies/${FSIMAGE}.flp"
1134
1135 .include <bsd.obj.mk>