Makefile revision 1.241
11.241Slukem# $NetBSD: Makefile,v 1.241 2003/01/03 15:34:36 lukem Exp $ 21.66Smikel# from: @(#)Makefile 8.7 (Berkeley) 5/25/95 31.1Scgd 41.96Scjs# Environment variables without default values: 51.96Scjs# DESTDIR must be set before anything in this file will work. 61.96Scjs# RELEASEDIR is where the tarred up stuff for a snapshot or 71.96Scjs# release will be placed. 81.96Scjs# 91.96Scjs# Environment variables with default values: 101.96Scjs# LOCALTIME will set the default local time for the system you 111.96Scjs# build; it determines what /etc/localtime is symlink'd to. 121.96Scjs# KERNSRCDIR points to kernel source; it is set by default to ../sys, 131.96Scjs# but can be overridden. 141.96Scjs# KERNOBJDIR is the kernel build directory, it defaults to 151.172Sjlam# ${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden. 161.96Scjs# KERNCONFDIR is where the configuration files for kernels are found; 171.96Scjs# default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden. 181.97Scjs# UPDATE is normally undefined; if defined, don't do a 'make clean' 191.97Scjs# before kernel compile 201.96Scjs# NO_SENDMAIL is normally undefined; if defined, it will not do a 211.96Scjs# `make distribution' in the sendmail config file source directory. 221.154Sthorpej# 231.96Scjs# Targets: 241.96Scjs# distribution: makes a full NetBSD distribution in DESTDIR. If 251.96Scjs# INSTALL_DONE is set, it will not do a `make install.' 261.182Schs# if DISTRIBUTION_DONE is set, it will not do anything. 271.96Scjs# distrib-dirs: creates an empty NetBSD directory tree in DESTDIR. 281.96Scjs# Called by distribution. 291.96Scjs# snapshot: calls distribution, above, and then tars up the files 301.241Slukem# into a release(7) format in RELEASEDIR/${MACHINE}. 311.241Slukem# Any port-dependent stuff for this target is found in 321.241Slukem# etc.${MACHINE}/Makefile.inc. 331.106Scjs# release: a synonym for `snapshot' 341.96Scjs 351.199Stv# setting NOOBJ prevents "make obj" from doing anything; 361.199Stv# an objdir would break the installation stuff below 371.199StvNOOBJ= # defined 381.199Stv 391.155Sthorpej# For NO_SENDMAIL, INSTPRIV, MKCRYPTO 401.90Skim.include <bsd.own.mk> 411.187Sjmc 421.211Slukem# For KERNSRCDIR, KERNOBJDIR, ... 431.211Slukem.include <bsd.kernobj.mk> 441.211Slukem 451.211Slukem 461.187Sjmc.MAKEOVERRIDES+= USETOOLS 471.90Skim 481.23ScgdTZDIR= /usr/share/zoneinfo 491.157SkleinkLOCALTIME?= UTC 501.198SjmcPWD_MKDB?= pwd_mkdb 511.233SlukemMAKESUMS= CKSUM=${CKSUM:Q} sh ${NETBSDSRCDIR}/distrib/sets/makesums 521.19Sderaadt 531.161Shubertf# Flags for creating ISO CDROM image 541.161Shubertf# mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrecord 551.161ShubertfMKISOFS?= mkisofs 561.233SlukemDISTRIBREV!= sh ${KERNSRCDIR}/conf/osrelease.sh -s 571.224Sbjh21# ISO 9660 volume ID. Note that this can only contain [A-Z0-9_]. 581.224Sbjh21ISO_VOLID!= echo NETBSD_${MACHINE}_${DISTRIBREV} | tr a-z A-Z 591.161ShubertfMKISOFS_FLAGS+= -J -l \ 601.161Shubertf -r -T -v \ 611.224Sbjh21 -V ${ISO_VOLID} \ 621.161Shubertf -P "The NetBSD Project" \ 631.241Slukem -m "${RELEASEDIR}/${MACHINE}/installation/cdrom" 641.1Scgd 651.80Sjonathan# MD Makefile.inc may append MD targets to BIN[123]. Make sure all 661.80Sjonathan# are empty, to preserve the old semantics of setting them below with "=". 671.200SlukemBIN1= 681.80SjonathanBIN2= 691.80SjonathanBIN3= 701.80Sjonathan 711.241Slukem# Directories to build in ${RELEASEDIR}/${MACHINE}. 721.241Slukem# MD Makefile.inc files can add to this. 731.117Ssimonb# NOTE: Parent directories must be listed before subdirectories. 741.217SlukemINSTALLATION_DIRS= binary binary/sets binary/kernel installation 751.117Ssimonb 761.71Scjs.if exists(etc.${MACHINE}/Makefile.inc) 771.71Scjs.include "etc.${MACHINE}/Makefile.inc" 781.71Scjs.endif 791.32Sjtc 801.21Scgd# -rw-r--r-- 811.21ScgdBINOWN= root 821.21ScgdBINGRP= wheel 831.227SperryUTMPGRP= utmp 841.184SlukemBIN1+= bootptab changelist csh.cshrc csh.login csh.logout daily \ 851.223Sfredette daily.conf dm.conf floppytab ftpchroot ftpusers \ 861.131Sveego gettytab group hosts hosts.lpd inetd.conf lkm.conf \ 871.131Sveego mailer.conf man.conf monthly monthly.conf mrouted.conf \ 881.151Sfvdl netconfig networks newsyslog.conf nsswitch.conf ntp.conf \ 891.213Sperry passwd.conf phones printcap profile protocols rbootd.conf rc rc.conf \ 901.159Slukem rc.lkm rc.local rc.subr rc.shutdown remote rpc \ 911.142Stsarna security security.conf services shells sysctl.conf syslog.conf \ 921.142Stsarna weekly weekly.conf wscons.conf \ 931.236Sjdolecek etc.${MACHINE}/ttys 941.236Sjdolecek 951.236Sjdolecek# use machine-specific disktab if it exists, or the MI one otherwise 961.236Sjdolecek.if exists(etc.${MACHINE}/disktab) 971.236SjdolecekBIN1+= etc.${MACHINE}/disktab 981.236Sjdolecek.else 991.236SjdolecekBIN1+= disktab 1001.236Sjdolecek.endif 1011.105Smycroft 1021.234Sjdolecek.if exists(etc.${MACHINE}/ld.so.conf) 1031.234SjdolecekBIN1+= etc.${MACHINE}/ld.so.conf 1041.152Sperry.endif 1051.152Sperry 1061.234Sjdolecek.if exists(etc.${MACHINE}/ttyaction) 1071.234SjdolecekBIN1+= etc.${MACHINE}/ttyaction 1081.105Smycroft.endif 1091.1Scgd 1101.46Sderaadt# -rw-rw-r-- 1111.80SjonathanBIN2+= motd 1121.1Scgd 1131.77Smycroft# -rw------- 1141.80SjonathanBIN3+= hosts.equiv 1151.77Smycroft 1161.230SperryETC_PKG=-T etc_pkg 1171.230SperryBASE_PKG=-T base_pkg 1181.230SperryETC_INSTALL_FILE=${INSTALL_FILE} ${ETC_PKG} 1191.230SperryETC_INSTALL_LINK=${INSTALL_LINK} ${ETC_PKG} 1201.230SperryETC_INSTALL_SYMLINK=${INSTALL_SYMLINK} ${ETC_PKG} 1211.230Sperry 1221.144SthorpejNAMEDB= 127 root.cache named.conf localhost loopback.v6 1231.1Scgd 1241.220Sitojun.if make(install-etc-files) # { 1251.221Sitojun.include <bsd.endian.mk> 1261.191Stv.if ${TARGET_ENDIANNESS} == "1234" 1271.221SitojunTARGET_ENDIANNESS= -L 1281.191Stv.elif ${TARGET_ENDIANNESS} == "4321" 1291.221SitojunTARGET_ENDIANNESS= -B 1301.170Sjdolecek.else 1311.170SjdolecekTARGET_ENDIANNESS= 1321.191Stv.endif 1331.220Sitojun.endif # install-etc-files # } 1341.149Ssjg 1351.149Ssjgobj: 1361.149Ssjg mkdir -p ${KERNOBJDIR} 1371.149Ssjg 1381.204Slukemdistribution: check_DESTDIR .WAIT distrib-dirs 1391.182Schs.if !defined(DISTRIBUTION_DONE) 1401.87Sperry.if !defined(INSTALL_DONE) 1411.233Slukem (cd ${NETBSDSRCDIR}; ${MAKE} _DISTRIB= includes) 1421.233Slukem (cd ${NETBSDSRCDIR}; ${MAKE} _DISTRIB= install) 1431.200Slukem.endif # !INSTALL_DONE 1441.193Sthorpej ${MAKE} install-etc-files 1451.200Slukem.endif # !DISTRIBUTION_DONE 1461.193Sthorpej 1471.204Slukeminstall-etc-files: check_DESTDIR 1481.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 1491.230Sperry ${BIN1} ${DESTDIR}/etc 1501.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 \ 1511.230Sperry ${BIN2} ${DESTDIR}/etc 1521.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \ 1531.230Sperry ${BIN3} ${DESTDIR}/etc 1541.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 1551.230Sperry aliases ${DESTDIR}/etc/mail 1561.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 1571.230Sperry /dev/null ${DESTDIR}/etc/mail/local-host-names 1581.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 1591.230Sperry crontab ${DESTDIR}/var/cron/tabs/root 1601.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 1611.230Sperry master.passwd ${DESTDIR}/etc 1621.198Sjmc ${PWD_MKDB} -p ${TARGET_ENDIANNESS} -d ${DESTDIR}/ \ 1631.230Sperry ${DESTDIR}/etc/master.passwd 1641.194Sperry.if defined(UNPRIVED) 1651.222Slukem ( \ 1661.239Slukem echo "./etc/passwd type=file mode=0644 uname=root gname=wheel tags=etc_pkg"; \ 1671.239Slukem echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel tags=etc_pkg"; \ 1681.239Slukem echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel tags=etc_pkg"; \ 1691.239Slukem ) | ${METALOG.add} 1701.200Slukem.endif # UNPRIVED 1711.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \ 1721.230Sperry MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev 1731.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 1741.230Sperry minfree ${DESTDIR}/var/crash 1751.1Scgd (cd root; \ 1761.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 644 \ 1771.230Sperry dot.cshrc ${DESTDIR}/root/.cshrc; \ 1781.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 1791.230Sperry dot.klogin ${DESTDIR}/root/.klogin; \ 1801.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 644 \ 1811.230Sperry dot.login ${DESTDIR}/root/.login; \ 1821.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 644 \ 1831.230Sperry dot.profile ${DESTDIR}/root/.profile; \ 1841.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 644 \ 1851.230Sperry dot.shrc ${DESTDIR}/root/.shrc; \ 1861.189Sperry rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \ 1871.230Sperry ${ETC_INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \ 1881.230Sperry ${ETC_INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile) 1891.162Slukem (cd defaults; ${MAKE} install) 1901.83Smrg (cd mtree; ${MAKE} install) 1911.63Smikel (cd namedb; \ 1921.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 1931.124Ssimonb ${NAMEDB} ${DESTDIR}/etc/namedb) 1941.140Slukem (cd rc.d; ${MAKE} install) 1951.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 1961.230Sperry postinstall ${DESTDIR}/etc 1971.230Sperry ${ETC_INSTALL_SYMLINK} -o root -g wheel -m 755 \ 1981.230Sperry ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime 1991.230Sperry ${ETC_INSTALL_SYMLINK} -o root -g wheel -m 755 \ 2001.230Sperry /usr/sbin/rmt ${DESTDIR}/etc/rmt 2011.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g operator -m 664 \ 2021.230Sperry /dev/null ${DESTDIR}/etc/dumpdates 2031.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g operator -m 600 \ 2041.230Sperry /dev/null ${DESTDIR}/etc/skeykeys 2051.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 2061.230Sperry /dev/null ${DESTDIR}/var/at/at.deny 2071.230Sperry ${ETC_INSTALL_FILE} -o root -g wheel -m 600 \ 2081.230Sperry /dev/null ${DESTDIR}/var/cron/log 2091.230Sperry ${ETC_INSTALL_FILE} -o nobody -g ${BINGRP} -m 664 \ 2101.230Sperry /dev/null ${DESTDIR}/var/db/locate.database 2111.230Sperry ${ETC_INSTALL_FILE} -o uucp -g dialer -m 640 \ 2121.230Sperry /dev/null ${DESTDIR}/var/log/aculog 2131.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \ 2141.230Sperry /dev/null ${DESTDIR}/var/log/authlog 2151.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 \ 2161.230Sperry /dev/null ${DESTDIR}/var/log/lastlog 2171.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 640 \ 2181.230Sperry /dev/null ${DESTDIR}/var/log/lpd-errs 2191.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \ 2201.230Sperry /dev/null ${DESTDIR}/var/log/maillog 2211.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2221.230Sperry /dev/null ${DESTDIR}/var/log/messages 2231.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \ 2241.230Sperry /dev/null ${DESTDIR}/var/log/secure 2251.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2261.230Sperry /dev/null ${DESTDIR}/var/log/sendmail.st 2271.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2281.230Sperry /dev/null ${DESTDIR}/var/log/wtmp 2291.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \ 2301.230Sperry /dev/null ${DESTDIR}/var/log/wtmpx 2311.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \ 2321.230Sperry /dev/null ${DESTDIR}/var/log/xferlog 2331.230Sperry ${ETC_INSTALL_FILE} -o daemon -g staff -m 664 \ 2341.230Sperry /dev/null ${DESTDIR}/var/msgs/bounds 2351.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 \ 2361.230Sperry /dev/null ${DESTDIR}/var/run/utmp 2371.230Sperry ${ETC_INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 \ 2381.230Sperry /dev/null ${DESTDIR}/var/run/utmpx 2391.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2401.230Sperry /dev/null ${DESTDIR}/var/games/atc_scores 2411.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2421.230Sperry /dev/null ${DESTDIR}/var/games/battlestar.log 2431.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2441.230Sperry /dev/null ${DESTDIR}/var/games/cfscores 2451.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2461.230Sperry /dev/null ${DESTDIR}/var/games/criblog 2471.231Sperry ${ETC_INSTALL_FILE} -o games -g games -m 660 \ 2481.231Sperry /dev/null ${DESTDIR}/var/games/hackdir/perm 2491.231Sperry ${ETC_INSTALL_FILE} -o games -g games -m 660 \ 2501.231Sperry /dev/null ${DESTDIR}/var/games/hackdir/record 2511.231Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2521.231Sperry /dev/null ${DESTDIR}/var/games/larn/llog12.0 2531.231Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2541.231Sperry /dev/null ${DESTDIR}/var/games/larn/lscore12.0 2551.231Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2561.231Sperry /dev/null ${DESTDIR}/var/games/larn/playerids 2571.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2581.230Sperry /dev/null ${DESTDIR}/var/games/robots_roll 2591.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2601.230Sperry /dev/null ${DESTDIR}/var/games/rogue.scores 2611.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2621.230Sperry /dev/null ${DESTDIR}/var/games/saillog 2631.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2641.230Sperry /dev/null ${DESTDIR}/var/games/snakerawscores 2651.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2661.230Sperry /dev/null ${DESTDIR}/var/games/snake.log 2671.230Sperry ${ETC_INSTALL_FILE} -o games -g games -m 664 \ 2681.230Sperry /dev/null ${DESTDIR}/var/games/tetris.scores 2691.165Ssimonb (cd skel; ${MAKE} distribution) 2701.233Slukem (cd ${NETBSDSRCDIR}/usr.bin/mail; ${MAKE} distribution) 2711.233Slukem (cd ${NETBSDSRCDIR}/gnu/usr.sbin/postfix/; ${MAKE} distribution) 2721.155Sthorpej.if (${MKCRYPTO} != "no") 2731.233Slukem (cd ${NETBSDSRCDIR}/usr.bin/ssh; ${MAKE} distribution) 2741.155Sthorpej.endif 2751.200Slukem.if !defined(NO_SENDMAIL) 2761.233Slukem (cd ${NETBSDSRCDIR}/gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution) 2771.90Skim.endif 2781.1Scgd 2791.204Slukemdistrib-dirs: check_DESTDIR 2801.230Sperry ${INSTALL_DIR} -o root -g wheel -m 755 ${BASE_PKG} ${DESTDIR} 2811.235Slukem ${MTREE} -def mtree/NetBSD.dist -N ${.CURDIR} \ 2821.235Slukem -p ${DESTDIR}/ -U ${UNPRIVED:D-W} 2831.200Slukem 2841.204Slukemrelease snapshot: check_DESTDIR check_RELEASEDIR .WAIT \ 2851.233Slukem distribution .WAIT \ 2861.233Slukem snap_pre .WAIT snap_kern .WAIT \ 2871.233Slukem snap_post .WAIT snap_md_post 2881.233Slukem (cd ${NETBSDSRCDIR}/distrib/sets; ${MAKE} sets) 2891.241Slukem ${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/binary/kernel '*.gz' 2901.161Shubertf 2911.161Shubertf# Standalone target to create a CDROM image after the release 2921.161Shubertf# was composed. Should be run after "make build" in both src and xsrc 2931.204Slukemiso-image: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_post 2941.233Slukem# empty target 2951.161Shubertf 2961.204Slukemiso-image_mi: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_pre 2971.161Shubertf @if ${MKISOFS} --version; then \ 2981.241Slukem mkdir -p ${RELEASEDIR}/${MACHINE}/installation/cdrom ; \ 2991.161Shubertf ${MKISOFS} ${MKISOFS_FLAGS} \ 3001.241Slukem -o ${RELEASEDIR}/${MACHINE}/installation/cdrom/netbsd-${MACHINE}.iso \ 3011.241Slukem ${RELEASEDIR}/${MACHINE} ; \ 3021.241Slukem ${MAKESUMS} -t \ 3031.241Slukem ${RELEASEDIR}/${MACHINE}/installation/cdrom '*.iso' ; \ 3041.161Shubertf else \ 3051.161Shubertf echo "install pkgsrc/sysutils/cdrecord and type 'make iso-image'." ; \ 3061.161Shubertf fi 3071.161Shubertf 3081.241Slukem# Setup the ${RELEASEDIR}/${MACHINE} to produce a bootable CD image: 3091.204Slukemiso-image_md_pre: check_DESTDIR check_RELEASEDIR 3101.233Slukem# nothing here -- look in the machine-dependent Makefile.inc 3111.161Shubertf 3121.161Shubertf# Fixup the CD-image to be bootable 3131.204Slukemiso-image_md_post: check_DESTDIR check_RELEASEDIR .WAIT iso-image_mi 3141.233Slukem# nothing here -- look in the machine-dependent Makefile.inc 3151.41Scgd 3161.204Slukemsnap_pre: check_DESTDIR check_RELEASEDIR 3171.241Slukem ${INSTALL} -d -m 755 ${RELEASEDIR} 3181.240Slukem.ifndef UPDATE 3191.168Sjmc# Could be a mount point, ignore the errors 3201.241Slukem -/bin/rm -rf ${RELEASEDIR}/${MACHINE} 3211.240Slukem.endif 3221.241Slukem ${INSTALL} -d -m 755 ${RELEASEDIR}/${MACHINE} 3231.117Ssimonb.for dir in ${INSTALLATION_DIRS} 3241.241Slukem ${INSTALL} -d -m 755 ${RELEASEDIR}/${MACHINE}/${dir} 3251.117Ssimonb.endfor 3261.96Scjs 3271.233Slukemsnap_post: check_DESTDIR check_RELEASEDIR 3281.233Slukem.ifndef UPDATE 3291.233Slukem cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir 3301.233Slukem.endif 3311.233Slukem cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \ 3321.233Slukem ${MAKE} release 3331.233Slukem 3341.232Slukem# snap_kern -- 3351.232Slukem# This target builds the kernels specified by each port. 3361.232Slukem# A port may specify the following kernels: 3371.196Sthorpej# 3381.196Sthorpej# KERNEL_SETS The list of kernels that will be 3391.196Sthorpej# packaged into sets, named 3401.196Sthorpej# kern-${kernel}.tgz. These kernels 3411.203Schs# are also placed in the binary/kernel 3421.196Sthorpej# area of the release package as 3431.196Sthorpej# netbsd-${kernel}.gz. 3441.196Sthorpej# 3451.196Sthorpej# EXTRA_KERNELS Additional kernels to place in the 3461.203Schs# binary/kernel area of the release 3471.196Sthorpej# package as netbsd-${kernel}.gz, but 3481.196Sthorpej# which are not placed into sets. This 3491.196Sthorpej# allows a port to provide e.g. a netbootable 3501.196Sthorpej# installation kernel containing a ramdisk. 3511.196Sthorpej# 3521.196Sthorpej# BUILD_KERNELS Additional kernels to build which are 3531.196Sthorpej# not placed into sets nor into the 3541.203Schs# binary/kernel area of the release 3551.196Sthorpej# package. These are typically kernels 3561.196Sthorpej# that are built for inclusion only in 3571.196Sthorpej# installation disk/CD-ROM/tape images. 3581.116Sfair# 3591.197Sthorpej# A port may also specify KERNEL_SUFFIXES, which is an optional list 3601.197Sthorpej# of filename suffixes for kernels to include in the kernel sets and 3611.203Schs# in the binary/kernel area of the release package (e.g. "netbsd" vs. 3621.197Sthorpej# "netbsd.ecoff" and "netbsd.srec"). It is not an error if kernels 3631.197Sthorpej# with these suffixes do not exist in the kernel build directory. 3641.197Sthorpej# 3651.229Slukem# 3661.229Slukem# A list of all the kernels to build, which can be overridden from 3671.229Slukem# external sources (such as make(1)'s environment or command line) 3681.229Slukem# 3691.229SlukemALL_KERNELS?= ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS} 3701.229Slukem# 3711.116SfairGETKERNELAWK= awk '/^config/ {print $$2; found=1} \ 3721.116Sfair END{ if (found == 0) print "netbsd"; }' 3731.96Scjs# 3741.232Slukem.if !target(snap_kern) # { 3751.232Slukem 3761.232Slukem# build_kernels -- 3771.232Slukem# Configure & compile kernels listed in ${ALL_KERNELS} 3781.232Slukem# 3791.201Slukem.if !defined(KERNELS_DONE) # { 3801.232Slukem.for configfile in ${ALL_KERNELS} # { 3811.232Slukem_KERNELS_TO_BUILD+=kern-${configfile} 3821.232Slukemkern-${configfile}: 3831.232Slukem cd ${KERNCONFDIR} && ${CONFIG} -s ${KERNSRCDIR} \ 3841.232Slukem -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile} 3851.201Slukem.if !defined(UPDATE) 3861.200Slukem cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean 3871.96Scjs.endif 3881.218Ssommerfe cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE} 3891.232Slukem.endfor # ALL_KERNELS # } 3901.232Slukem.endif # KERNELS_DONE # } 3911.232Slukem 3921.232Slukembuild_kernels: ${_KERNELS_TO_BUILD} 3931.232Slukem 3941.232Slukem# build_kernelsets -- 3951.241Slukem# Create kernel sets from ${KERNEL_SETS} into 3961.241Slukem# ${RELEASEDIR}/${MACHINE}/binary/sets 3971.232Slukem# 3981.232Slukem.for configfile in ${KERNEL_SETS} # { 3991.232Slukem_KERNELSETS_TO_BUILD+=kernset-${configfile} 4001.232Slukemkernset-${configfile}: 4011.197Sthorpej kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \ 4021.197Sthorpej kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 4031.207Sbjh21 kernsuffixes="${KERNEL_SUFFIXES}"; \ 4041.210Slukem cd $${kerndir} && ( \ 4051.214Slukem echo "/set uname=${BINOWN} gname=${BINGRP}"; \ 4061.214Slukem echo ". type=dir optional"; \ 4071.210Slukem for kernel in $${kernlist}; do \ 4081.214Slukem echo "./$${kernel} type=file"; \ 4091.207Sbjh21 for s in $${kernsuffixes}; do \ 4101.197Sthorpej if [ -f $${kernel}.$${s} ]; then \ 4111.214Slukem echo "./$${kernel}.$${s} type=file"; \ 4121.197Sthorpej fi; \ 4131.197Sthorpej done; \ 4141.238Slukem done ) | GZIP=-9 ${PAX} -O -zw \ 4151.235Slukem -M -N ${NETBSDSRCDIR}/etc \ 4161.241Slukem -f ${RELEASEDIR}/${MACHINE}/binary/sets/kern-${configfile}.tgz 4171.232Slukem.endfor # KERNEL_SETS # } 4181.232Slukem 4191.232Slukembuild_kernelsets: ${_KERNELSETS_TO_BUILD} 4201.232Slukem 4211.232Slukem# build_releasekernels -- 4221.232Slukem# Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into 4231.241Slukem# ${RELEASEDIR}/${MACHINE}/binary/kernel 4241.232Slukem# 4251.232Slukem.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS} # { 4261.232Slukem_RELEASEKERNELS_TO_BUILD+=releasekern-${configfile} 4271.232Slukemreleasekern-${configfile}: 4281.197Sthorpej kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \ 4291.197Sthorpej kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \ 4301.207Sbjh21 kernsuffixes="${KERNEL_SUFFIXES}"; \ 4311.197Sthorpej cd $${kerndir} && \ 4321.197Sthorpej gziplist=`for kernel in $${kernlist}; do \ 4331.197Sthorpej echo "$${kernel}"; \ 4341.207Sbjh21 for s in $${kernsuffixes}; do \ 4351.197Sthorpej if [ -f $${kernel}.$${s} ]; then \ 4361.197Sthorpej echo "$${kernel}.$${s}"; \ 4371.197Sthorpej fi; \ 4381.197Sthorpej done; \ 4391.197Sthorpej done`; \ 4401.197Sthorpej for kernel in $${gziplist} ; do \ 4411.114Sfair gzip -c -9 < $${kernel} > \ 4421.241Slukem ${RELEASEDIR}/${MACHINE}/binary/kernel/$${kernel}-${configfile:C/.*\///}.gz ; done 4431.232Slukem.endfor # KERNEL_SETS EXTRA_KERNELS # } 4441.232Slukem 4451.232Slukembuild_releasekernels: ${_RELEASEKERNELS_TO_BUILD} 4461.232Slukem 4471.232Slukem# snap_kern -- 4481.232Slukem# build the kernels, then the sets & release kernels 4491.232Slukemsnap_kern: check_DESTDIR check_RELEASEDIR .WAIT \ 4501.232Slukem build_kernels .WAIT \ 4511.232Slukem build_kernelsets build_releasekernels 4521.232Slukem 4531.232Slukem.endif # !target(snap_kern) # } 4541.232Slukem 4551.108Sdrochner 4561.204Slukemsnap_md_post: check_DESTDIR check_RELEASEDIR 4571.233Slukem# nothing here -- look in the machine-dependent Makefile.inc 4581.7Scgd 4591.1Scgd.include <bsd.prog.mk> 460