Makefile revision 1.228
11.228Sgrant#	$NetBSD: Makefile,v 1.228 2002/10/05 15:23:19 grant 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.96Scjs#	into a release(7) format in RELEASEDIR. Any port-dependent
311.96Scjs#	stuff for this target is found in etc.${MACHINE}/Makefile.inc.
321.106Scjs#    release: a synonym for `snapshot'
331.96Scjs
341.199Stv# setting NOOBJ prevents "make obj" from doing anything;
351.199Stv# an objdir would break the installation stuff below
361.199StvNOOBJ=		# defined
371.199Stv
381.155Sthorpej# For NO_SENDMAIL, INSTPRIV, MKCRYPTO
391.90Skim.include <bsd.own.mk>
401.187Sjmc
411.211Slukem# For KERNSRCDIR, KERNOBJDIR, ...
421.211Slukem.include <bsd.kernobj.mk>
431.211Slukem
441.211Slukem
451.187Sjmc.MAKEOVERRIDES+=	USETOOLS
461.90Skim
471.23ScgdTZDIR=		/usr/share/zoneinfo
481.157SkleinkLOCALTIME?=	UTC
491.198SjmcPWD_MKDB?=	pwd_mkdb
501.206Sbjh21MAKESUMS=	CKSUM=${CKSUM:Q} sh ../distrib/sets/makesums
511.19Sderaadt
521.161Shubertf# Flags for creating ISO CDROM image
531.161Shubertf# mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrecord
541.161ShubertfMKISOFS?=	mkisofs
551.224Sbjh21DISTRIBREV!=	sh ${NETBSDSRCDIR}/sys/conf/osrelease.sh -s
561.224Sbjh21# ISO 9660 volume ID.  Note that this can only contain [A-Z0-9_].
571.224Sbjh21ISO_VOLID!=	echo NETBSD_${MACHINE}_${DISTRIBREV} | tr a-z A-Z
581.161ShubertfMKISOFS_FLAGS+= -J -l \
591.161Shubertf		-r -T -v \
601.224Sbjh21		-V ${ISO_VOLID} \
611.161Shubertf		-P "The NetBSD Project" \
621.164Shubertf		-m "${RELEASEDIR}/installation/cdrom"
631.1Scgd
641.80Sjonathan# MD Makefile.inc may append MD targets to BIN[123].  Make sure all
651.80Sjonathan# are empty, to preserve the old semantics of setting them below with "=".
661.200SlukemBIN1=
671.80SjonathanBIN2=
681.80SjonathanBIN3=
691.80Sjonathan
701.117Ssimonb# Directories to build in ${RELEASEDIR}.   MD Makefile.inc files can
711.117Ssimonb# add to this.
721.117Ssimonb# NOTE: Parent directories must be listed before subdirectories.
731.217SlukemINSTALLATION_DIRS=	binary binary/sets binary/kernel installation
741.117Ssimonb
751.71Scjs.if exists(etc.${MACHINE}/Makefile.inc)
761.71Scjs.include "etc.${MACHINE}/Makefile.inc"
771.71Scjs.endif
781.32Sjtc
791.21Scgd# -rw-r--r--
801.21ScgdBINOWN= root
811.21ScgdBINGRP= wheel
821.227SperryUTMPGRP= utmp
831.184SlukemBIN1+=	bootptab changelist csh.cshrc csh.login csh.logout daily \
841.223Sfredette	daily.conf dm.conf floppytab ftpchroot ftpusers \
851.131Sveego	gettytab group hosts hosts.lpd inetd.conf lkm.conf \
861.131Sveego	mailer.conf man.conf monthly monthly.conf mrouted.conf \
871.151Sfvdl	netconfig networks newsyslog.conf nsswitch.conf ntp.conf \
881.213Sperry	passwd.conf phones printcap profile protocols rbootd.conf rc rc.conf \
891.159Slukem	rc.lkm rc.local rc.subr rc.shutdown remote rpc \
901.142Stsarna	security security.conf services shells sysctl.conf syslog.conf \
911.142Stsarna	weekly weekly.conf wscons.conf \
921.109Sdrochner	etc.${MACHINE}/ttys etc.${MACHINE}/disktab
931.105Smycroft
941.121Sfvdl.if	(${MACHINE_ARCH} == "m68k") || \
951.105Smycroft	(${MACHINE_ARCH} == "ns32k") || \
961.208Swiz	(${MACHINE_ARCH} == "vax")
971.129SchristosBIN1+=	ld.so.conf
981.129Schristos.elif exists(etc.${MACHINE_ARCH}/ld.so.conf)
991.132SjlamBIN1+=	etc.${MACHINE_ARCH}/ld.so.conf
1001.152Sperry.endif
1011.152Sperry
1021.152Sperry.if exists(etc.${MACHINE_ARCH}/ttyaction)
1031.152SperryBIN1+=	etc.${MACHINE_ARCH}/ttyaction
1041.105Smycroft.endif
1051.1Scgd
1061.46Sderaadt# -rw-rw-r--
1071.80SjonathanBIN2+=	motd
1081.1Scgd
1091.77Smycroft# -rw-------
1101.80SjonathanBIN3+=	hosts.equiv
1111.77Smycroft
1121.144SthorpejNAMEDB=	127 root.cache named.conf localhost loopback.v6
1131.1Scgd
1141.220Sitojun.if make(install-etc-files)						# {
1151.221Sitojun.include <bsd.endian.mk>
1161.191Stv.if ${TARGET_ENDIANNESS} == "1234"
1171.221SitojunTARGET_ENDIANNESS=	-L
1181.191Stv.elif ${TARGET_ENDIANNESS} == "4321"
1191.221SitojunTARGET_ENDIANNESS=	-B
1201.170Sjdolecek.else
1211.170SjdolecekTARGET_ENDIANNESS=
1221.191Stv.endif
1231.220Sitojun.endif	# install-etc-files						# }
1241.149Ssjg
1251.149Ssjgobj:
1261.149Ssjg	mkdir -p ${KERNOBJDIR}
1271.149Ssjg
1281.204Slukemdistribution: check_DESTDIR .WAIT distrib-dirs
1291.182Schs.if !defined(DISTRIBUTION_DONE)
1301.87Sperry.if !defined(INSTALL_DONE)
1311.107Sscottr	(cd ..; ${MAKE} _DISTRIB= includes)
1321.107Sscottr	(cd ..; ${MAKE} _DISTRIB= install)
1331.200Slukem.endif	# !INSTALL_DONE
1341.193Sthorpej	${MAKE} install-etc-files
1351.200Slukem.endif	# !DISTRIBUTION_DONE
1361.193Sthorpej
1371.204Slukeminstall-etc-files: check_DESTDIR
1381.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
1391.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
1401.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} ${DESTDIR}/etc
1411.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 aliases \
1421.147Sitojun	    ${DESTDIR}/etc/mail
1431.228Sgrant	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
1441.228Sgrant	    ${DESTDIR}/etc/mail/local-host-names
1451.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 crontab \
1461.56Sthorpej	    ${DESTDIR}/var/cron/tabs/root
1471.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
1481.198Sjmc	${PWD_MKDB} -p ${TARGET_ENDIANNESS} -d ${DESTDIR}/ \
1491.171Ssimonb		${DESTDIR}/etc/master.passwd
1501.194Sperry.if defined(UNPRIVED)
1511.222Slukem	( \
1521.222Slukem	    echo "/etc/passwd type=file mode=0644 uname=root gname=wheel"; \
1531.222Slukem	    echo "/etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
1541.222Slukem	    echo "/etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
1551.222Slukem	) | \
1561.222Slukem	    sed -e "s|^/|./${DESTDIR}/|g" -e "s|//|/|g" | ${CAT} -l >>${METALOG}
1571.200Slukem.endif	# UNPRIVED
1581.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
1591.1Scgd	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
1601.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 minfree ${DESTDIR}/var/crash
1611.1Scgd	(cd root; \
1621.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.cshrc \
1631.1Scgd		    ${DESTDIR}/root/.cshrc; \
1641.202Slukem		${INSTALL_FILE} -o root -g wheel -m 600 dot.klogin \
1651.1Scgd		    ${DESTDIR}/root/.klogin; \
1661.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.login \
1671.1Scgd		    ${DESTDIR}/root/.login; \
1681.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.profile \
1691.1Scgd		    ${DESTDIR}/root/.profile; \
1701.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.shrc \
1711.128Smycroft		    ${DESTDIR}/root/.shrc; \
1721.189Sperry		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
1731.202Slukem		${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
1741.202Slukem		${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
1751.162Slukem	(cd defaults; ${MAKE} install)
1761.83Smrg	(cd mtree; ${MAKE} install)
1771.63Smikel	(cd namedb; \
1781.202Slukem		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
1791.124Ssimonb		    ${NAMEDB} ${DESTDIR}/etc/namedb)
1801.140Slukem	(cd rc.d; ${MAKE} install)
1811.215Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1821.215Slukem		postinstall ${DESTDIR}/etc
1831.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 \
1841.188Sperry		${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
1851.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 \
1861.188Sperry		/usr/sbin/rmt ${DESTDIR}/etc/rmt
1871.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g operator -m 664 /dev/null \
1881.32Sjtc		${DESTDIR}/etc/dumpdates
1891.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g operator -m 600 /dev/null \
1901.44Sderaadt		${DESTDIR}/etc/skeykeys
1911.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 /dev/null \
1921.127Sperry		${DESTDIR}/var/at/at.deny
1931.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 /dev/null \
1941.38Scgd		${DESTDIR}/var/cron/log
1951.202Slukem	${INSTALL_FILE} -o nobody -g ${BINGRP} -m 664 /dev/null \
1961.32Sjtc		${DESTDIR}/var/db/locate.database
1971.202Slukem	${INSTALL_FILE} -o uucp -g dialer -m 640 /dev/null \
1981.113Sfair		${DESTDIR}/var/log/aculog
1991.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2001.69Sperry		${DESTDIR}/var/log/authlog
2011.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
2021.32Sjtc		${DESTDIR}/var/log/lastlog
2031.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
2041.32Sjtc		${DESTDIR}/var/log/lpd-errs
2051.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2061.32Sjtc		${DESTDIR}/var/log/maillog
2071.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2081.32Sjtc		${DESTDIR}/var/log/messages
2091.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2101.58Slukem		${DESTDIR}/var/log/secure
2111.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2121.137Smycroft		${DESTDIR}/var/log/sendmail.st
2131.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2141.32Sjtc		${DESTDIR}/var/log/wtmp
2151.226Sperry	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2161.226Sperry		${DESTDIR}/var/log/wtmpx
2171.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2181.69Sperry		${DESTDIR}/var/log/xferlog
2191.202Slukem	${INSTALL_FILE} -o daemon -g staff -m 664 /dev/null \
2201.39Scgd		${DESTDIR}/var/msgs/bounds
2211.227Sperry	${INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 /dev/null \
2221.32Sjtc		${DESTDIR}/var/run/utmp
2231.227Sperry	${INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 /dev/null \
2241.225Swiz		${DESTDIR}/var/run/utmpx
2251.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2261.81Smrg		${DESTDIR}/var/games/atc_scores
2271.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2281.81Smrg		${DESTDIR}/var/games/battlestar.log
2291.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2301.81Smrg		${DESTDIR}/var/games/cfscores
2311.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2321.82Sperry		${DESTDIR}/var/games/criblog
2331.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2341.81Smrg		${DESTDIR}/var/games/robots_roll
2351.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2361.81Smrg		${DESTDIR}/var/games/rogue.scores
2371.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2381.81Smrg		${DESTDIR}/var/games/saillog
2391.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2401.81Smrg		${DESTDIR}/var/games/snakerawscores
2411.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2421.81Smrg		${DESTDIR}/var/games/snake.log
2431.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2441.81Smrg		${DESTDIR}/var/games/tetris.scores
2451.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2461.81Smrg		${DESTDIR}/var/games/larn/llog12.0
2471.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2481.81Smrg		${DESTDIR}/var/games/larn/lscore12.0
2491.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2501.81Smrg		${DESTDIR}/var/games/larn/playerids
2511.165Ssimonb	(cd skel; ${MAKE} distribution)
2521.62Sperry	(cd ../usr.bin/mail; ${MAKE} distribution)
2531.143Sperry	(cd ../gnu/usr.sbin/postfix/; ${MAKE} distribution)
2541.155Sthorpej.if (${MKCRYPTO} != "no")
2551.155Sthorpej	(cd ../usr.bin/ssh; ${MAKE} distribution)
2561.155Sthorpej.endif
2571.200Slukem.if !defined(NO_SENDMAIL)
2581.133Stron	(cd ../gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
2591.90Skim.endif
2601.1Scgd
2611.204Slukemdistrib-dirs: check_DESTDIR
2621.202Slukem	${INSTALL_DIR} -o root -g wheel -m 755 ${DESTDIR}
2631.192Sperry	${MTREE} -def mtree/NetBSD.dist -p ${DESTDIR}/ -U ${UNPRIVED:D-W}
2641.189Sperry	rm -f ${DESTDIR}/sys
2651.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 usr/src/sys ${DESTDIR}/sys
2661.200Slukem
2671.204Slukemrelease snapshot: check_DESTDIR check_RELEASEDIR .WAIT \
2681.218Ssommerfe    distribution .WAIT snap_pre snap_md_pre .WAIT snap_kern .WAIT snap_md_post
2691.141Sthorpej	(cd ../distrib/sets; ${MAKE} sets)
2701.206Sbjh21	${MAKESUMS} -t ${RELEASEDIR}/binary/kernel '*.gz'
2711.161Shubertf
2721.161Shubertf# Standalone target to create a CDROM image after the release
2731.161Shubertf# was composed. Should be run after "make build" in both src and xsrc
2741.204Slukemiso-image: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_post
2751.161Shubertf
2761.204Slukemiso-image_mi: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_pre
2771.161Shubertf	@if ${MKISOFS} --version; then \
2781.161Shubertf		mkdir -p ${RELEASEDIR}/installation/cdrom ; \
2791.161Shubertf		${MKISOFS} ${MKISOFS_FLAGS} \
2801.161Shubertf			-o ${RELEASEDIR}/installation/cdrom/netbsd-${MACHINE}.iso \
2811.161Shubertf			${RELEASEDIR} ; \
2821.206Sbjh21		${MAKESUMS} -t ${RELEASEDIR}/installation/cdrom '*.iso' ; \
2831.161Shubertf	else \
2841.161Shubertf		echo "install pkgsrc/sysutils/cdrecord and type 'make iso-image'." ; \
2851.161Shubertf	fi
2861.161Shubertf
2871.161Shubertf# Setup the $RELEASEDIR to produce a bootable CD image:
2881.204Slukemiso-image_md_pre: check_DESTDIR check_RELEASEDIR
2891.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
2901.161Shubertf
2911.161Shubertf# Fixup the  CD-image to be bootable
2921.204Slukemiso-image_md_post: check_DESTDIR check_RELEASEDIR .WAIT iso-image_mi
2931.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
2941.41Scgd
2951.204Slukemsnap_pre: check_DESTDIR check_RELEASEDIR
2961.168Sjmc# Could be a mount point, ignore the errors
2971.167Sjmc	-/bin/rm -rf ${RELEASEDIR}
2981.202Slukem	${INSTALL} -d -m 755 ${RELEASEDIR}
2991.117Ssimonb.for dir in ${INSTALLATION_DIRS}
3001.202Slukem	${INSTALL} -d -m 755 ${RELEASEDIR}/${dir}
3011.117Ssimonb.endfor
3021.96Scjs
3031.196Sthorpej# This target builds the kernels specified by each port.  A port may
3041.196Sthorpej# specify the following kernels:
3051.196Sthorpej#
3061.196Sthorpej#	KERNEL_SETS		The list of kernels that will be
3071.196Sthorpej#				packaged into sets, named
3081.196Sthorpej#				kern-${kernel}.tgz.  These kernels
3091.203Schs#				are also placed in the binary/kernel
3101.196Sthorpej#				area of the release package as
3111.196Sthorpej#				netbsd-${kernel}.gz.
3121.196Sthorpej#
3131.196Sthorpej#	EXTRA_KERNELS		Additional kernels to place in the
3141.203Schs#				binary/kernel area of the release
3151.196Sthorpej#				package as netbsd-${kernel}.gz, but
3161.196Sthorpej#				which are not placed into sets. This
3171.196Sthorpej#				allows a port to provide e.g. a netbootable
3181.196Sthorpej#				installation kernel containing a ramdisk.
3191.196Sthorpej#
3201.196Sthorpej#	BUILD_KERNELS		Additional kernels to build which are
3211.196Sthorpej#				not placed into sets nor into the
3221.203Schs#				binary/kernel area of the release
3231.196Sthorpej#				package.  These are typically kernels
3241.196Sthorpej#				that are built for inclusion only in
3251.196Sthorpej#				installation disk/CD-ROM/tape images.
3261.116Sfair#
3271.197Sthorpej# A port may also specify KERNEL_SUFFIXES, which is an optional list
3281.197Sthorpej# of filename suffixes for kernels to include in the kernel sets and
3291.203Schs# in the binary/kernel area of the release package (e.g. "netbsd" vs.
3301.197Sthorpej# "netbsd.ecoff" and "netbsd.srec").  It is not an error if kernels
3311.197Sthorpej# with these suffixes do not exist in the kernel build directory.
3321.197Sthorpej#
3331.116SfairGETKERNELAWK=	awk '/^config/ {print $$2; found=1} \
3341.116Sfair		END{ if (found == 0) print "netbsd"; }'
3351.96Scjs#
3361.118Sgwr.if !target(snap_kern)
3371.204Slukemsnap_kern: check_DESTDIR check_RELEASEDIR
3381.201Slukem.if !defined(KERNELS_DONE)						# {
3391.196Sthorpej.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
3401.125Ssommerfe	cd ${KERNCONFDIR} && ${CONFIG} \
3411.179Smrg		-b ${KERNOBJDIR}/${configfile:C/.*\///} -s ${KERNSRCDIR} ${configfile}
3421.201Slukem.if !defined(UPDATE)
3431.200Slukem	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean
3441.96Scjs.endif
3451.218Ssommerfe	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE}
3461.196Sthorpej.endfor # build kernels
3471.203Schs.endif # KERNELS_DONE							# }
3481.196Sthorpej.for configfile in ${KERNEL_SETS}
3491.197Sthorpej	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \
3501.197Sthorpej	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
3511.207Sbjh21	kernsuffixes="${KERNEL_SUFFIXES}"; \
3521.210Slukem	cd $${kerndir} && ( \
3531.214Slukem		echo "/set uname=${BINOWN} gname=${BINGRP}"; \
3541.214Slukem		echo ". type=dir optional"; \
3551.210Slukem		for kernel in $${kernlist}; do \
3561.214Slukem			echo "./$${kernel} type=file"; \
3571.207Sbjh21			for s in $${kernsuffixes}; do \
3581.197Sthorpej				if [ -f $${kernel}.$${s} ]; then \
3591.214Slukem					echo "./$${kernel}.$${s} type=file"; \
3601.197Sthorpej				fi; \
3611.197Sthorpej			done; \
3621.216Slukem		done ) | GZIP=-9 ${PAX} -zw \
3631.216Slukem		    -M ${UNPRIVED:D-N${NETBSDSRCDIR}/etc} \
3641.210Slukem		    -f ${RELEASEDIR}/binary/sets/kern-${configfile}.tgz
3651.196Sthorpej.endfor # make kernel sets
3661.196Sthorpej.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS}
3671.197Sthorpej	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \
3681.197Sthorpej	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
3691.207Sbjh21	kernsuffixes="${KERNEL_SUFFIXES}"; \
3701.197Sthorpej	cd $${kerndir} &&	\
3711.197Sthorpej		gziplist=`for kernel in $${kernlist}; do \
3721.197Sthorpej			echo "$${kernel}"; \
3731.207Sbjh21			for s in $${kernsuffixes}; do \
3741.197Sthorpej				if [ -f $${kernel}.$${s} ]; then \
3751.197Sthorpej					echo "$${kernel}.$${s}"; \
3761.197Sthorpej				fi; \
3771.197Sthorpej			done; \
3781.197Sthorpej		done`; \
3791.197Sthorpej		for kernel in $${gziplist} ; do \
3801.114Sfair		gzip -c -9 < $${kernel} > \
3811.201Slukem		    ${RELEASEDIR}/binary/kernel/$${kernel}-${configfile:C/.*\///}.gz ; done
3821.196Sthorpej.endfor # place KERNEL_SETS kernels + EXTRA_KERNELS in binary/kernel/...
3831.118Sgwr.endif # no target(snap_kern)
3841.108Sdrochner
3851.204Slukemsnap_md_pre: check_DESTDIR check_RELEASEDIR
3861.117Ssimonb# nothing here -- look in the machine-dependent Makefile.inc
3871.117Ssimonb
3881.204Slukemsnap_md_post: check_DESTDIR check_RELEASEDIR
3891.41Scgd# nothing here -- look in the machine-dependent Makefile.inc
3901.7Scgd
3911.1Scgd.include <bsd.prog.mk>
392