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