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