Makefile revision 44755
1# $Id: Makefile,v 1.473 1999/03/10 03:50:38 jkh Exp $ 2# 3# make release CHROOTDIR=/some/dir BUILDNAME=somename [ RELEASETAG=tag ] 4# 5# Where "/some/dir" is the pathname of a directory on a some 6# filesystem with at least 1000MB of free space, "somename" is what 7# you want the release to call itself and, optionally, which CVS "tag" 8# name should be used when checking out the sources to build the release 9# (default is HEAD). 10# 11# Please note: the vn driver must also be compiled into your kernel, 12# otherwise the target 'release.8' and possibly others will fail. 13# 14# Set these, release builder! 15# 16# Fixed version: 17#BUILDNAME=4.0-RELEASE 18# 19# Automatic SNAP versioning: 20DATE != date +%Y%m%d 21BASE = 4.0 22BUILDNAME?=${BASE}-${DATE}-SNAP 23# 24#CHROOTDIR=/junk/release 25# If this is a RELEASE, then set 26#RELEASETAG=RELENG_2_2 27 28# If you are using a local CVS repository with components stored in 29# non-standard modules, override these on the make commandline or 30# in the environment. 31RELEASESRCMODULE?= src 32RELEASEDOCMODULE?= doc 33RELEASEPORTSMODULE?= ports 34 35# Unless set elsewhere, indicate the object format we'll be using. 36OBJFORMAT?= elf 37 38# Uncomment this to disable the doc.1 target. It is also an ERROR 39# to set NOPORTS and not set NODOC since docs depend on ports. 40#NODOC= YES 41#NOPORTS= YES 42# Comment the following if you want the release documentation to be 43# in English only. 44ALLLANG= yes 45DOCPORTS= textproc/docproj 46# Set this to wherever the distfiles required by ${DOCPORTS} live. 47DISTFILES?= ${.CURDIR}/../../ports/distfiles 48 49DIST_DOCS= ABOUT.TXT ERRATA.TXT LAYOUT.TXT README.TXT HARDWARE.TXT \ 50 INSTALL.TXT RELNOTES.TXT TROUBLE.TXT UPGRADE.TXT 51 52# Things which without too much trouble can be considered variables 53# BIN_DISTS are special in that they get full /etc installation sets. 54# 55COMPAT_DISTS?= compat1x compat20 compat21 56OTHER_DISTS?= manpages catpages games proflibs dict info doc 57CRYPTO_DISTS?= krb des 58BIN_DISTS?= bin 59DISTRIBUTIONS?= ${BIN_DISTS} ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} 60KERNELS?= GENERIC 61 62# Extra source tarballs; each argument is a pair of source dir and 63# distribution name. The dist name should not exceed 7 characters 64# (another "s" for "source" will be prepended). 65EXTRA_SRC+= usr.sbin/sendmail/cf smailcf 66 67BOOT1= etc/protocols etc/defaults/rc.conf 68 69# mountpoint for filesystems. 70MNT= /mnt 71 72# Various floppy image parameters. 73# 74BOOTSIZE= 1440 75FIXITSIZE= 1440 76MFSSIZE= 2880 77BIGBOOTSIZE= 2880 78BOOTINODE= 80000 79MFSINODE= 8000 80FIXITINODE= 2000 81BOOTLABEL= fd1440 82FIXITLABEL= fd1440 83BIGBOOTLABEL= minimum2 84MFSLABEL= minimum2 85 86# overrides. 87.if ${MACHINE_ARCH} == "alpha" 88FIXITSIZE= 2880 89FIXITLABEL= minimum2 90.endif 91 92ZIPNSPLIT= gzip --no-name -9 -c | split -b 240640 - 93 94 95VNDEVICE?= vn0 96 97# Things which may get you into trouble if you change them 98MTREEFILES= ${.CURDIR}/../etc/mtree 99RD= /R/stage 100FD= /R/ftp 101CD= /R/cdrom 102CD_DISC1= ${CD}/disc1 103CD_DISC2= ${CD}/disc2 104 105# Where the bootstrap ports (see DOCPORTS) get installed. 106LOCALDIR= /usr/local/bin 107 108# ${BOOTSTRAPDIR} is for those utilities that refer to the hosting 109# environment, rather than the target environment. This is specifically 110# intended for kernel-dependent utilities that are used during the build. 111# 112# ${BOOTSTRAPDIR} is actually being used by prepending it to the normal 113# ${PATH}. Thus, it's also available to outside utilities like doFS.sh. 114BOOTSTRAPDIR= /bootstrap 115# 116# The mount subsystem has been changed between 2.2 and 3.0 by the 117# Lite2 import. 118BOOTSTRAPUTILS= /sbin/mount /sbin/umount 119# 120# 3.0 cpio tries to reference lchown(2) which is not available in 2.2 121BOOTSTRAPUTILS+= /usr/bin/cpio 122 123.if !defined(CRUNCH_TARGETS) 124CRUNCH_TARGETS= boot fixit 125.endif 126 127EXTRAS= cdrom.1 ftp.1 128 129.if !defined(NODOC) 130DOCREL= doc.1 131.endif 132 133rerelease release: 134.if !defined(CHROOTDIR) || !defined(BUILDNAME) || !defined(CVSROOT) 135 @echo "To make a release you must set CHROOTDIR, BUILDNAME and CVSROOT" && false 136.endif 137.if make(release) 138.if exists(${CHROOTDIR}) 139# The first command will fail on a handful of files that have their schg 140# flags set. But it greatly speeds up the next two commands. 141 -rm -rf ${CHROOTDIR} 142 -chflags -R noschg ${CHROOTDIR}/. 143 -rm -rf ${CHROOTDIR} 144.endif 145 -mkdir -p ${CHROOTDIR} 146 cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR} 147 cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR} 148 [ -f /etc/resolv.conf ] && cp -p /etc/resolv.conf ${CHROOTDIR}/etc 149 cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1 150 mkdir ${CHROOTDIR}/${BOOTSTRAPDIR} 151 for i in ${BOOTSTRAPUTILS} ; do \ 152 cp -p ${CHROOTDIR}$$i ${CHROOTDIR}/${BOOTSTRAPDIR} ; \ 153 done 154.if !defined(RELEASETAG) 155 cd ${CHROOTDIR}/usr && rm -rf src && \ 156 cvs -R -d ${CVSROOT} co -P ${RELEASESRCMODULE} 157.else 158 cd ${CHROOTDIR}/usr && rm -rf src && \ 159 cvs -R -d ${CVSROOT} co -P -r ${RELEASETAG} ${RELEASESRCMODULE} 160.endif 161.if defined(LOCAL_PATCHES) && exists(${LOCAL_PATCHES}) 162 cd ${CHROOTDIR}/usr/src && patch --silent < ${LOCAL_PATCHES} 163.endif 164.if defined(LOCAL_SCRIPT) && exists(${LOCAL_SCRIPT}) 165 cd ${CHROOTDIR} && env CHROOTDIR=${CHROOTDIR} BUILDNAME=${BUILDNAME} RELEASETAG=${RELEASETAG} ${LOCAL_SCRIPT} 166.endif 167.if !defined(NOPORTS) 168 cd ${CHROOTDIR}/usr && rm -rf ports && cvs -R -d ${CVSROOT} co -P ${RELEASEPORTSMODULE} && cd ports && make readmes PORTSDIR=${CHROOTDIR}/usr/ports 169.endif 170.if !defined(NODOC) 171 cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE} 172 [ -d ${DISTFILES}/ ] && cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distfiles 173.endif 174.endif 175.if make(rerelease) 176.if !defined(RELEASENOUPDATE) 177.if !defined(RELEASETAG) 178 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d 179.else 180 cd ${CHROOTDIR}/usr/src && cvs -R -q update -P -d -r ${RELEASETAG} 181.endif 182.if !defined(NOPORTS) 183 cd ${CHROOTDIR}/usr/ports && cvs -R -q update -P -d 184.endif 185.if !defined(NODOC) 186 cd ${CHROOTDIR}/usr/doc && cvs -R -q update -P -d 187.endif 188.endif 189.endif 190 # Add version information to those things that need it. 191 ( cd ${CHROOTDIR}/usr/src/sys/conf && \ 192 mv newvers.sh foo && \ 193 sed "s/^RELEASE=.*/RELEASE=${BUILDNAME}/" foo > newvers.sh && rm foo ) 194 echo OBJFORMAT=${OBJFORMAT} > ${CHROOTDIR}/etc/objformat 195 -test -f install.cfg && cp install.cfg ${CHROOTDIR}/usr/src/release 196 echo "#!/bin/sh" > ${CHROOTDIR}/mk 197 echo "set -ex" >> ${CHROOTDIR}/mk 198 echo "_RELTARGET=\$${1:-doRELEASE}" >> ${CHROOTDIR}/mk 199 echo "export CFLAGS='-O -pipe'" >> ${CHROOTDIR}/mk 200 echo "export DISTRIBUTIONS=\"${DISTRIBUTIONS}\"" >> ${CHROOTDIR}/mk 201 echo "export BUILDNAME=${BUILDNAME}" >> ${CHROOTDIR}/mk 202 echo "export VNDEVICE=${VNDEVICE}" >> ${CHROOTDIR}/mk 203 echo "export OBJFORMAT=${OBJFORMAT}" >> ${CHROOTDIR}/mk 204.if defined(RELEASETAG) 205 echo "export RELEASETAG=${RELEASETAG}" >> ${CHROOTDIR}/mk 206.endif 207.if defined(NOPORTS) 208 echo "export NOPORTS=${NOPORTS}" >> ${CHROOTDIR}/mk 209.endif 210.if defined(NODOC) 211 echo "export NODOC=${NODOC}" >> ${CHROOTDIR}/mk 212.endif 213.if defined(ALLLANG) 214 echo "export ALLLANG=${ALLLANG}" >> ${CHROOTDIR}/mk 215.endif 216.if defined(NOSRC) 217 echo "export NOSRC=${NOSRC}" >> ${CHROOTDIR}/mk 218.endif 219.if defined(NOSHARED) 220 echo "export NOSHARED=${NOSHARED}" >> ${CHROOTDIR}/mk 221.endif 222.if defined(BOOT_CONFIG) 223 echo "export BOOT_CONFIG=\"${BOOT_CONFIG}\"">> ${CHROOTDIR}/mk 224.endif 225 # Don't remove this, or the build will fall over! 226 echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk 227 echo "export PATH=${BOOTSTRAPDIR}:$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk 228 echo "if [ ! -f /tmp/.world_done ]; then" >> ${CHROOTDIR}/mk 229 echo " cd /usr/src" >> ${CHROOTDIR}/mk 230.if make(release) 231 echo " (cd etc; make distrib-dirs distribution)" >> ${CHROOTDIR}/mk 232 echo " make world" >> ${CHROOTDIR}/mk 233.endif 234.if make(rerelease) 235 echo " make all install" >> ${CHROOTDIR}/mk 236.endif 237 echo " touch /tmp/.world_done" >> ${CHROOTDIR}/mk 238 echo "fi" >> ${CHROOTDIR}/mk 239 echo "cd /usr/src/release/sysinstall" >> ${CHROOTDIR}/mk 240 echo "make obj" >> ${CHROOTDIR}/mk 241 echo "cd /usr/src/release" >> ${CHROOTDIR}/mk 242 echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk 243 echo "echo make ${.TARGET} Finished" >> ${CHROOTDIR}/mk 244 chmod 755 ${CHROOTDIR}/mk 245 chroot ${CHROOTDIR} /mk 246 247clean: 248 rm -rf boot_crunch release.[0-9] 249 250# Clean out /R and make the directory structure. 251release.1: 252 -mkdir /R 253 -chflags -R noschg /R/. 254 rm -rf /R/* 255 mkdir ${RD} 256 mkdir ${RD}/floppies 257 mkdir ${RD}/trees 258 mkdir ${RD}/dists 259 mkdir ${RD}/kernels 260 for i in ${DISTRIBUTIONS} ; do \ 261 mkdir ${RD}/trees/$$i && \ 262 mkdir ${RD}/dists/$$i && \ 263 mtree -deU -f ${MTREEFILES}/BSD.root.dist \ 264 -p ${RD}/trees/$$i > /dev/null && \ 265 mtree -deU -f ${MTREEFILES}/BSD.usr.dist \ 266 -p ${RD}/trees/$$i/usr > /dev/null && \ 267 mtree -deU -f ${MTREEFILES}/BSD.include.dist \ 268 -p ${RD}/trees/$$i/usr/include > /dev/null && \ 269 mtree -deU -f ${MTREEFILES}/BSD.var.dist \ 270 -p ${RD}/trees/$$i/var > /dev/null ; \ 271 done 272 touch release.1 273 274# Install the system into the various distributions. 275release.2: 276 cd ${.CURDIR}/../etc && make distrib-dirs DESTDIR=${RD}/trees/bin 277 cd ${.CURDIR}/.. && make distribute DISTDIR=${RD}/trees 278.if exists(${.CURDIR}/../kerberosIV) && !defined(NOKERBEROS) 279 cd ${.CURDIR}/../kerberosIV && ( \ 280 make bootstrap &&\ 281 make obj all help-distribute DISTDIR=${RD}/trees &&\ 282 make kprog \ 283 ) 284.endif 285 -chflags -R noschg ${RD}/trees 286 touch release.2 287 288# Make and install the generic kernel(s). 289release.3: 290.for kernel in ${KERNELS} 291 rm -f ${RD}/kernels/${kernel} 292 rm -rf ${.CURDIR}/../sys/compile/${kernel} 293 cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=${kernel} 294 rm -rf ${.CURDIR}/../sys/compile/${kernel} 295 ln -f ${RD}/kernels/${kernel} ${RD}/trees/bin/kernel.${kernel} 296.endfor 297 touch release.3 298 299# Make and install the three crunched binaries which live on the floppies. 300# You are not supposed to like this :-) 301# 302# NB: the "RELEASE_BUILD_FIXIT" magic prevents vi from including the 303# Tcl and Perl APIs. See also /usr/src/usr.bin/vi/Makefile. 304release.4: 305 @mkdir -p /stand 306 cd ${.CURDIR}/sysinstall && make obj depend all install 307 rm -rf ${RD}/crunch 308 mkdir -p ${RD}/crunch 309 export RELEASE_BUILD_FIXIT=noway ; \ 310 for j in ${CRUNCH_TARGETS} ; do \ 311 rm -rf $${j}_crunch && \ 312 mkdir $${j}_crunch && \ 313 ( cd $${j}_crunch && \ 314 crunchgen ${.CURDIR}/$${j}_crunch.conf && \ 315 ${MAKE} -DRELEASE_CRUNCH -f $${j}_crunch.mk subclean all \ 316 NOCRYPT=yes "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY") && \ 317 mv $${j}_crunch/$${j}_crunch ${RD}/crunch/$${j} && \ 318 true || { rm -rf $${j}_crunch ; false ; } ; \ 319 done 320 touch release.4 321 322# 323# --==## Fix up the distributions. ##==-- 324# 325release.5: 326 # Handle some grief caused by the munition braindeadness. 327 for i in sbin/init bin/ed usr.sbin/ppp ; do \ 328 ( cd ${.CURDIR}/../$$i; \ 329 make -DNOCRYPT clean all distribute DISTDIR=${RD}/trees ) ; \ 330 done 331 332 # Create any "synthetic dists" now. 333 @for i in ${DISTRIBUTIONS}; do \ 334 if [ -f ${.CURDIR}/scripts/$${i}-make.sh ]; then \ 335 echo -n "Running $$i dist creation script... "; \ 336 env OBJFORMAT=${OBJFORMAT} RD=${RD} sh ${.CURDIR}/scripts/$${i}-make.sh || echo "$$i distribution script returned bad status."; \ 337 echo "Done."; \ 338 fi \ 339 done \ 340 341 # Create symlinks for the MD5-based crypt lib, too. The 342 # automatically created links still point to the DES stuff, 343 # which went into its own distribution. 344 for i in ${RD}/trees/bin/usr/lib/libscrypt* ; do \ 345 c=`echo $$i | sed -e 's/libscrypt/libcrypt/'` ; \ 346 rm -f $$c ; \ 347 ln -s `basename $$i` $$c ; \ 348 done 349 350 # Remove all the directories we don't need. 351 -cd ${RD}/trees && \ 352 find ${OTHER_DISTS} ${COMPAT_DISTS} ${CRYPTO_DISTS} -depth -type d -print | xargs rmdir 353 touch release.5 354 355# 356# --==## Package up the tarballs from assembled trees ##==-- 357# 358release.6: 359 rm -rf ${RD}/dists 360 mkdir -p ${RD}/dists 361 @for i in ${DISTRIBUTIONS} ; \ 362 do \ 363 if [ -d ${RD}/trees/$${i} ] ; then \ 364 cd ${.CURDIR} && $(MAKE) doTARBALL \ 365 SD=${RD}/trees/$${i} \ 366 TN=$$i TD=$$i ARG="." && \ 367 echo "$${i} distribution is finished."; \ 368 fi ; \ 369 done 370 # More munition braindeadness. 371 ( cd ${RD}/dists && \ 372 if [ -f krb/krb.aa ] ; then mv krb/* des && rmdir krb ; fi ) 373 touch release.6 374 375 376# 377# --==## Make source dists ##==-- 378# 379release.7: 380.if !defined(NOSRC) 381 @cd ${.CURDIR} && $(MAKE) doTARBALL SD=/usr/src \ 382 TD=src TN=sbase ARG="[A-Z]*" 383 @for i in `cd /usr/src && echo [a-z]*` ; do \ 384 if [ -d /usr/src/$$i ] ; then \ 385 cd ${.CURDIR} && $(MAKE) doTARBALL \ 386 TN=`echo s$$i | tr -d '.' | sed 's/usr/u/'` \ 387 SD=/usr/src TD=src ARG="$$i" ; \ 388 fi ; \ 389 done 390.if defined(EXTRA_SRC) 391 @set ${EXTRA_SRC} && \ 392 while [ $$# -ge 2 ] ; do \ 393 if [ -d /usr/src/$$1 ] ; then \ 394 cd ${.CURDIR} && $(MAKE) doTARBALL \ 395 SD=/usr/src TN="s$$2" TD=src ARG="$$1" ; \ 396 fi && shift && shift ; \ 397 done 398.endif 399 ( cd ${RD}/dists/src && \ 400 if [ -f ssecure.aa ] ; then mv ssecure.* ../des ; fi && \ 401 if [ -f scrypto.aa ] ; then mv scrypto.* ../des ; fi && \ 402 if [ -f skerbero.aa ] ; then mv skerbero.* ../des ; fi ; ) 403 @echo "src distribution is finished." 404.endif 405 touch release.7 406 407# Complete the bootfd 408# 409# Now, just to get this picture down once and for all: 410# 411# +------------------------------------------------------------------------+ 412# |boot.flp | 413# +-----+-----+------------------------------------------------------------+ 414# |boot1|boot2|floppy filesystem "bootfd" | 415# +-----+-----+-+--------------------------------------------------------+-+ 416# |kernel | 417# +------------+-----------------------------------------+-+ 418# |mfs filesystem "mfsfd" | 419# +-----------------------------------------+ 420# 421 422release.8: write_mfs_in_kernel 423 rm -rf ${RD}/mfsfd 424 mkdir ${RD}/mfsfd 425 cd ${RD}/mfsfd && \ 426 mkdir -p etc dev mnt stand/help 427 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=boot \ 428 DIR=${RD}/mfsfd/stand ZIP=false 429 ( cd ${RD}/trees/bin/dev && \ 430 ls console tty ttyv0 ttyv1 ttyv2 ttyv3 null zero | \ 431 cpio -dump ${RD}/mfsfd/dev ) 432 ( cd ${RD}/mfsfd/dev && rm -f *[swo]d*[bdefgh] ) 433 cd ${RD}/trees/bin && ls ${BOOT1} | cpio -dump ${RD}/mfsfd/stand 434 echo "nameserver 42/tcp name" > ${RD}/mfsfd/stand/etc/services 435 echo "ftp 21/tcp" >> ${RD}/mfsfd/stand/etc/services 436 echo "domain 53/tcp nameserver" >> ${RD}/mfsfd/stand/etc/services 437 echo "domain 53/udp nameserver" >> ${RD}/mfsfd/stand/etc/services 438 echo "cmd 514/tcp shell" >> ${RD}/mfsfd/stand/etc/services 439 gzip -9c ${.CURDIR}/../COPYRIGHT > ${RD}/mfsfd/stand/help/COPYRIGHT.hlp.gz 440 for i in README.TXT RELNOTES.TXT INSTALL.TXT UPGRADE.TXT HARDWARE.TXT; do \ 441 gzip -9c ${.CURDIR}/texts/$${i} > ${RD}/mfsfd/stand/help/$${i}.gz; done 442 -test -f ${.CURDIR}/install.cfg && cp ${.CURDIR}/install.cfg ${RD}/mfsfd 443 @mkdir -p ${RD}/mfsfd/boot 444 @cp /boot/boot* ${RD}/mfsfd/boot 445 @echo "Making the regular boot floppy." 446 @tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \ 447 tar xf - -C ${RD}/mfsfd/stand 448 @echo "Compressing doc files..." 449 @gzip -9 ${RD}/mfsfd/stand/help/*.hlp 450 sh -e ${.CURDIR}/scripts/doFS.sh -s mfsroot ${RD} ${MNT} \ 451 ${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL} 452 @gzip -9vc mfsroot > mfsroot.gz 453 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/mfsroot.flp \ 454 ${RD} ${MNT} ${BOOTSIZE} mfsroot.gz ${BOOTINODE} ${BOOTLABEL} 455 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern 456 @cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot BIGBOOT=YES 457 @rm mfsroot mfsroot.gz mfsroot.size 458 @echo "Regular and MFS boot floppies made." 459 touch release.8 460 461# 462# --==## Create a fixit floppy ##==-- 463# 464release.9: 465 @echo "Making fixit floppy." 466 @rm -rf ${RD}/fixitfd 467 @mkdir ${RD}/fixitfd 468 @cd ${RD}/fixitfd && \ 469 mkdir -p dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp \ 470 usr/share/misc 471 @cd ${.CURDIR} && $(MAKE) installCRUNCH CRUNCH=fixit \ 472 DIR=${RD}/fixitfd/stand ZIP=false 473 @( cd ${RD}/fixitfd/dev && \ 474 sed -e '/^PATH/s/^/#/' ${RD}/trees/bin/dev/MAKEDEV > MAKEDEV && \ 475 chmod 755 MAKEDEV && \ 476 sh MAKEDEV all ) 477 @cp ${RD}/trees/bin/etc/spwd.db ${RD}/trees/bin/etc/group \ 478 ${RD}/trees/bin/etc/protocols ${RD}/fixitfd/etc 479 @cp ${RD}/trees/bin/usr/share/misc/scsi_modes \ 480 ${RD}/fixitfd/usr/share/misc 481 @cp ${.CURDIR}/fixit.profile ${RD}/fixitfd/.profile 482 @cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services 483 @cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar 484 @chmod 555 ${RD}/fixitfd/stand/tar 485 @sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/fixit.flp ${RD} \ 486 ${MNT} ${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL} 487# Do our last minute floppies directory setup in a convenient place. 488 @cp ${.CURDIR}/texts/FLOPPIES.TXT ${RD}/floppies/README.TXT 489 @(cd ${RD}/floppies; md5 * > CHECKSUM.MD5) 490 touch release.9 491 492# 493# --==## Setup a suitable ftp-area ##==-- 494# 495ftp.1: 496 @echo "Setting up FTP distribution area" 497 @mkdir -p ${FD} 498 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 499 @cd ${RD}/dists && find . -print | cpio -dumpl ${FD} 500 @for i in ${DIST_DOCS}; do cp ${.CURDIR}/texts/$${i} ${FD}; done 501 @echo "CD_VERSION = ${BUILDNAME}" > ${FD}/cdrom.inf 502.if !defined(NOPORTS) 503 @tar -cBf - -C ${CD_DISC1} ports | tar -xBf - -C ${FD} 504.endif 505 506# 507# --==## Setup a suitable cdrom-area ##==-- 508# 509cdrom.1: 510 @echo "Setting up CDROM distribution area" 511 @mkdir -p ${CD_DISC1} ${CD_DISC2} 512 @cd ${RD} && find floppies -print | cpio -dumpl ${CD_DISC1} 513 @cd ${RD}/dists && find . -print | cpio -dumpl ${CD_DISC1} 514 @ln -f ${RD}/kernels/MFSKERNEL.boot ${CD_DISC1}/kernel 515 @for i in ${DISTRIBUTIONS} ; \ 516 do \ 517 if [ -d ${RD}/trees/$${i} ] ; then \ 518 chflags -R noschg ${RD}/trees/$${i} || true ; \ 519 ( cd ${RD}/trees/$${i} && \ 520 find . -depth -print | cpio -dumpl ${CD_DISC2} ) ; \ 521 fi \ 522 done 523 @rm -f ${CD_DISC2}/.profile 524 @cp ${.CURDIR}/fixit.profile ${CD_DISC2}/.profile 525 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC1}/cdrom.inf 526 @echo "CD_VERSION = ${BUILDNAME}" > ${CD_DISC2}/cdrom.inf 527 @for i in ${DIST_DOCS}; do cp ${.CURDIR}/texts/$${i} ${CD_DISC1}; done 528.if !defined(NOPORTS) 529 @-rm -rf /usr/ports/distfiles/* 530 @mkdir -p ${CD_DISC1}/ports && \ 531 tar -czf ${CD_DISC1}/ports/ports.tgz -C /usr ports && \ 532 cp ${.CURDIR}/scripts/ports-install.sh ${CD_DISC1}/ports/install.sh \ 533 && (cd ${CD_DISC1}/ports; md5 * > CHECKSUM.MD5) 534.endif 535 536doc.1: 537 @echo "Making docs..." 538 @for i in ${DOCPORTS}; do \ 539 cd /usr/ports/$$i && make all install clean JADETEX=no FORCE_PKG_REGISTER=yes; \ 540 done 541 @cd /usr/doc && make all distribute DISTDIR=${RD}/trees 542 touch doc.1 543 544# Various "subroutine" and other supporting targets. 545 546doTARBALL: 547.if !defined(SD) 548 @echo "SD undefined in doTARBALL" && exit 1 549.endif 550.if !defined(TD) 551 @echo "TB undefined in doTARBALL" && exit 1 552.endif 553.if !defined(ARG) 554 @echo "ARG undefined in doTARBALL" && exit 1 555.endif 556 @rm -rf ${RD}/dists/${TD}/${TN}* 557 @mkdir -p ${RD}/dists/${TD} 558 @( cd ${SD} && \ 559 tn=`echo ${TN} | tr '[A-Z]' '[a-z]' | cut -c1-8` && \ 560 echo rolling ${TD}/$$tn tarball &&\ 561 tar --exclude CVS --exclude obj --exclude BOOTMFS -cf - ${ARG} | \ 562 ${ZIPNSPLIT} ${RD}/dists/${TD}/$$tn. && \ 563 sh ${.CURDIR}/scripts/info.sh ${RD}/dists/${TD}/$$tn > \ 564 ${RD}/dists/${TD}/$$tn.inf && \ 565 if [ -f ${.CURDIR}/scripts/$${TD}-install.sh ]; then \ 566 cp -p ${.CURDIR}/scripts/$${TD}-install.sh ${RD}/dists/${TD}/install.sh; \ 567 fi && \ 568 if [ "${SD}" != "/usr/src" ]; then \ 569 mtree -c -i -p ${SD}/${ARG} \ 570 -k gname,md5digest,mode,nlink,uname,size,link,type \ 571 > ${RD}/dists/${TD}/$$tn.mtree ; \ 572 else \ 573 true; \ 574 fi; \ 575 (cd ${RD}/dists/${TD}; \ 576 rm -f CHECKSUM.MD5; \ 577 md5 * > CHECKSUM.MD5) \ 578 ) 579 580doRELEASE: release.1 release.2 ${DOCREL} release.3 release.4 release.5 \ 581 release.6 release.7 release.8 release.9 582 @cd ${.CURDIR} && ${MAKE} ${EXTRAS} 583 @echo "Release done" 584 585floppies: 586 @cd ${.CURDIR} && ${MAKE} boot.flp 587 @cd ${.CURDIR} && ${MAKE} fixit.flp 588 @cd ${RD} && find floppies -print | cpio -dumpl ${FD} 589 590boot.flp: 591 @rm -f release.4 release.8 592 @cd ${.CURDIR} && ${MAKE} release.4 release.8 CRUNCH_TARGETS=boot 593 594fixit.flp: 595 @rm -f release.4 release.9 596 @cd ${.CURDIR} && ${MAKE} release.4 release.9 CRUNCH_TARGETS=fixit 597 598write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c 599 ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c 600 601installCRUNCH: 602.if !defined(CRUNCH) 603 @echo "CRUNCH undefined in installCRUNCH" && exit 1 604.endif 605.if !defined(DIR) 606 @echo "DIR undefined in installCRUNCH" && exit 1 607.endif 608.if !defined(ZIP) 609 @echo "ZIP undefined in installCRUNCH" && exit 1 610.endif 611 @if ${ZIP} ; then \ 612 gzip -9 < ${RD}/crunch/${CRUNCH} > ${DIR}/${CRUNCH}_crunch ; \ 613 else \ 614 ln -f ${RD}/crunch/${CRUNCH} ${DIR}/${CRUNCH}_crunch ; \ 615 fi 616 @chmod 555 ${DIR}/${CRUNCH}_crunch 617 @for i in `crunchgen -l ${.CURDIR}/${CRUNCH}_crunch.conf` ; do \ 618 ln -f ${DIR}/${CRUNCH}_crunch ${DIR}/$$i ; \ 619 done 620 621# 622# --==## Compile a kernel by name ${KERNEL} ##==-- 623# 624# We don't erase the sys/compile/${KERNEL} directory, since somebody 625# may want to reuse it (release.8 presently) 626# 627doKERNEL: 628 @rm -f ${RD}/kernels/${KERNEL} 629 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && config ${KERNEL} 630 @cd ${.CURDIR}/../sys/compile/${KERNEL} && \ 631 make depend && \ 632 make kernel && \ 633 cp kernel ${RD}/kernels/${KERNEL} 634 635# 636# --==## Put a filesystem into a BOOTMFS kernel ##==-- 637# 638doMFSKERN: 639 @echo "Running doMFSKERN for ${FSIMAGE}" 640 @rm -f ${RD}/kernels/BOOTMFS.${FSIMAGE} 641 @cd ${.CURDIR}/../sys/${MACHINE_ARCH}/conf && \ 642 sh ${.CURDIR}/scripts/dokern.sh ${BIGBOOT} < GENERIC > BOOTMFS 643.if ${MACHINE_ARCH} == "i386" 644 @echo "options INTRO_USERCONFIG" >> ${.CURDIR}/../sys/i386/conf/BOOTMFS 645.endif 646.if defined(BIGBOOT) 647 @echo "options \"MFS_ROOT_SIZE=`cat mfsroot.size`\"" >> \ 648 ${.CURDIR}/../sys/${MACHINE_ARCH}/conf/BOOTMFS 649.endif 650 @cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS 651 @rm -rf ${RD}/image.${FSIMAGE} 652 @mkdir ${RD}/image.${FSIMAGE} 653 @cp ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE} 654 mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel 655 @echo "Setting up /boot directory for ${FSIMAGE} floppy" 656 @mkdir -p ${RD}/image.${FSIMAGE}/boot 657 @cp /boot/boot[12] /boot/loader ${RD}/image.${FSIMAGE}/boot 658.if !defined(BIGBOOT) || ${MACHINE_ARCH} == "alpha" 659 @echo "load /kernel" > ${RD}/image.${FSIMAGE}/boot/loader.rc 660 @echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 661 @echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 662 @echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 663 @echo "boot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc 664 @touch ${RD}/image.${FSIMAGE}/boot/loader.config 665.endif 666.if defined(BIGBOOT) 667 @echo "Writing MFS image into kernel for ${FSIMAGE} floppy" 668 @./write_mfs_in_kernel ${RD}/image.${FSIMAGE}/kernel mfsroot 669 @cp ${RD}/image.${FSIMAGE}/kernel ${RD}/kernels/MFSKERNEL.${FSIMAGE} 670.endif 671 @gzip -9v ${RD}/image.${FSIMAGE}/kernel 672 @touch ${RD}/image.${FSIMAGE}/kernel.config 673 @rm -f ${RD}/floppies/${FSIMAGE}.flp 674.if defined(BIGBOOT) 675 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 676 ${RD} ${MNT} ${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} \ 677 ${BOOTINODE} ${BIGBOOTLABEL} 678.else 679 sh -e ${.CURDIR}/scripts/doFS.sh ${RD}/floppies/${FSIMAGE}.flp \ 680 ${RD} ${MNT} ${BOOTSIZE} ${RD}/image.${FSIMAGE} \ 681 ${BOOTINODE} ${BOOTLABEL} 682.endif 683 @echo "Created ${RD}/floppies/${FSIMAGE}.flp" 684 685.include <bsd.prog.mk> 686