Makefile revision 1.226
11.226Sperry#	$NetBSD: Makefile,v 1.226 2002/09/16 02:30:29 perry 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.184SlukemBIN1+=	bootptab changelist csh.cshrc csh.login csh.logout daily \
831.223Sfredette	daily.conf dm.conf floppytab ftpchroot ftpusers \
841.131Sveego	gettytab group hosts hosts.lpd inetd.conf lkm.conf \
851.131Sveego	mailer.conf man.conf monthly monthly.conf mrouted.conf \
861.151Sfvdl	netconfig networks newsyslog.conf nsswitch.conf ntp.conf \
871.213Sperry	passwd.conf phones printcap profile protocols rbootd.conf rc rc.conf \
881.159Slukem	rc.lkm rc.local rc.subr rc.shutdown remote rpc \
891.142Stsarna	security security.conf services shells sysctl.conf syslog.conf \
901.142Stsarna	weekly weekly.conf wscons.conf \
911.109Sdrochner	etc.${MACHINE}/ttys etc.${MACHINE}/disktab
921.105Smycroft
931.121Sfvdl.if	(${MACHINE_ARCH} == "m68k") || \
941.105Smycroft	(${MACHINE_ARCH} == "ns32k") || \
951.208Swiz	(${MACHINE_ARCH} == "vax")
961.129SchristosBIN1+=	ld.so.conf
971.129Schristos.elif exists(etc.${MACHINE_ARCH}/ld.so.conf)
981.132SjlamBIN1+=	etc.${MACHINE_ARCH}/ld.so.conf
991.152Sperry.endif
1001.152Sperry
1011.152Sperry.if exists(etc.${MACHINE_ARCH}/ttyaction)
1021.152SperryBIN1+=	etc.${MACHINE_ARCH}/ttyaction
1031.105Smycroft.endif
1041.1Scgd
1051.46Sderaadt# -rw-rw-r--
1061.80SjonathanBIN2+=	motd
1071.1Scgd
1081.77Smycroft# -rw-------
1091.80SjonathanBIN3+=	hosts.equiv
1101.77Smycroft
1111.144SthorpejNAMEDB=	127 root.cache named.conf localhost loopback.v6
1121.1Scgd
1131.220Sitojun.if make(install-etc-files)						# {
1141.221Sitojun.include <bsd.endian.mk>
1151.191Stv.if ${TARGET_ENDIANNESS} == "1234"
1161.221SitojunTARGET_ENDIANNESS=	-L
1171.191Stv.elif ${TARGET_ENDIANNESS} == "4321"
1181.221SitojunTARGET_ENDIANNESS=	-B
1191.170Sjdolecek.else
1201.170SjdolecekTARGET_ENDIANNESS=
1211.191Stv.endif
1221.220Sitojun.endif	# install-etc-files						# }
1231.149Ssjg
1241.149Ssjgobj:
1251.149Ssjg	mkdir -p ${KERNOBJDIR}
1261.149Ssjg
1271.204Slukemdistribution: check_DESTDIR .WAIT distrib-dirs
1281.182Schs.if !defined(DISTRIBUTION_DONE)
1291.87Sperry.if !defined(INSTALL_DONE)
1301.107Sscottr	(cd ..; ${MAKE} _DISTRIB= includes)
1311.107Sscottr	(cd ..; ${MAKE} _DISTRIB= install)
1321.200Slukem.endif	# !INSTALL_DONE
1331.193Sthorpej	${MAKE} install-etc-files
1341.200Slukem.endif	# !DISTRIBUTION_DONE
1351.193Sthorpej
1361.204Slukeminstall-etc-files: check_DESTDIR
1371.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
1381.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
1391.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} ${DESTDIR}/etc
1401.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 aliases \
1411.147Sitojun	    ${DESTDIR}/etc/mail
1421.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 crontab \
1431.56Sthorpej	    ${DESTDIR}/var/cron/tabs/root
1441.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
1451.198Sjmc	${PWD_MKDB} -p ${TARGET_ENDIANNESS} -d ${DESTDIR}/ \
1461.171Ssimonb		${DESTDIR}/etc/master.passwd
1471.194Sperry.if defined(UNPRIVED)
1481.222Slukem	( \
1491.222Slukem	    echo "/etc/passwd type=file mode=0644 uname=root gname=wheel"; \
1501.222Slukem	    echo "/etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
1511.222Slukem	    echo "/etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
1521.222Slukem	) | \
1531.222Slukem	    sed -e "s|^/|./${DESTDIR}/|g" -e "s|//|/|g" | ${CAT} -l >>${METALOG}
1541.200Slukem.endif	# UNPRIVED
1551.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
1561.1Scgd	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
1571.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 minfree ${DESTDIR}/var/crash
1581.1Scgd	(cd root; \
1591.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.cshrc \
1601.1Scgd		    ${DESTDIR}/root/.cshrc; \
1611.202Slukem		${INSTALL_FILE} -o root -g wheel -m 600 dot.klogin \
1621.1Scgd		    ${DESTDIR}/root/.klogin; \
1631.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.login \
1641.1Scgd		    ${DESTDIR}/root/.login; \
1651.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.profile \
1661.1Scgd		    ${DESTDIR}/root/.profile; \
1671.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.shrc \
1681.128Smycroft		    ${DESTDIR}/root/.shrc; \
1691.189Sperry		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
1701.202Slukem		${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
1711.202Slukem		${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
1721.162Slukem	(cd defaults; ${MAKE} install)
1731.83Smrg	(cd mtree; ${MAKE} install)
1741.63Smikel	(cd namedb; \
1751.202Slukem		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
1761.124Ssimonb		    ${NAMEDB} ${DESTDIR}/etc/namedb)
1771.140Slukem	(cd rc.d; ${MAKE} install)
1781.215Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1791.215Slukem		postinstall ${DESTDIR}/etc
1801.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 \
1811.188Sperry		${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
1821.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 \
1831.188Sperry		/usr/sbin/rmt ${DESTDIR}/etc/rmt
1841.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g operator -m 664 /dev/null \
1851.32Sjtc		${DESTDIR}/etc/dumpdates
1861.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g operator -m 600 /dev/null \
1871.44Sderaadt		${DESTDIR}/etc/skeykeys
1881.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 /dev/null \
1891.127Sperry		${DESTDIR}/var/at/at.deny
1901.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 /dev/null \
1911.38Scgd		${DESTDIR}/var/cron/log
1921.202Slukem	${INSTALL_FILE} -o nobody -g ${BINGRP} -m 664 /dev/null \
1931.32Sjtc		${DESTDIR}/var/db/locate.database
1941.202Slukem	${INSTALL_FILE} -o uucp -g dialer -m 640 /dev/null \
1951.113Sfair		${DESTDIR}/var/log/aculog
1961.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
1971.69Sperry		${DESTDIR}/var/log/authlog
1981.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
1991.32Sjtc		${DESTDIR}/var/log/lastlog
2001.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
2011.32Sjtc		${DESTDIR}/var/log/lpd-errs
2021.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2031.32Sjtc		${DESTDIR}/var/log/maillog
2041.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2051.32Sjtc		${DESTDIR}/var/log/messages
2061.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2071.58Slukem		${DESTDIR}/var/log/secure
2081.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2091.137Smycroft		${DESTDIR}/var/log/sendmail.st
2101.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2111.32Sjtc		${DESTDIR}/var/log/wtmp
2121.226Sperry	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2131.226Sperry		${DESTDIR}/var/log/wtmpx
2141.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2151.69Sperry		${DESTDIR}/var/log/xferlog
2161.202Slukem	${INSTALL_FILE} -o daemon -g staff -m 664 /dev/null \
2171.39Scgd		${DESTDIR}/var/msgs/bounds
2181.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
2191.32Sjtc		${DESTDIR}/var/run/utmp
2201.225Swiz	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
2211.225Swiz		${DESTDIR}/var/run/utmpx
2221.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2231.81Smrg		${DESTDIR}/var/games/atc_scores
2241.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2251.81Smrg		${DESTDIR}/var/games/battlestar.log
2261.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2271.81Smrg		${DESTDIR}/var/games/cfscores
2281.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2291.82Sperry		${DESTDIR}/var/games/criblog
2301.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2311.81Smrg		${DESTDIR}/var/games/robots_roll
2321.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2331.81Smrg		${DESTDIR}/var/games/rogue.scores
2341.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2351.81Smrg		${DESTDIR}/var/games/saillog
2361.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2371.81Smrg		${DESTDIR}/var/games/snakerawscores
2381.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2391.81Smrg		${DESTDIR}/var/games/snake.log
2401.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2411.81Smrg		${DESTDIR}/var/games/tetris.scores
2421.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2431.81Smrg		${DESTDIR}/var/games/larn/llog12.0
2441.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2451.81Smrg		${DESTDIR}/var/games/larn/lscore12.0
2461.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2471.81Smrg		${DESTDIR}/var/games/larn/playerids
2481.165Ssimonb	(cd skel; ${MAKE} distribution)
2491.62Sperry	(cd ../usr.bin/mail; ${MAKE} distribution)
2501.143Sperry	(cd ../gnu/usr.sbin/postfix/; ${MAKE} distribution)
2511.155Sthorpej.if (${MKCRYPTO} != "no")
2521.155Sthorpej	(cd ../usr.bin/ssh; ${MAKE} distribution)
2531.155Sthorpej.endif
2541.200Slukem.if !defined(NO_SENDMAIL)
2551.133Stron	(cd ../gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
2561.90Skim.endif
2571.1Scgd
2581.204Slukemdistrib-dirs: check_DESTDIR
2591.202Slukem	${INSTALL_DIR} -o root -g wheel -m 755 ${DESTDIR}
2601.192Sperry	${MTREE} -def mtree/NetBSD.dist -p ${DESTDIR}/ -U ${UNPRIVED:D-W}
2611.189Sperry	rm -f ${DESTDIR}/sys
2621.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 usr/src/sys ${DESTDIR}/sys
2631.200Slukem
2641.204Slukemrelease snapshot: check_DESTDIR check_RELEASEDIR .WAIT \
2651.218Ssommerfe    distribution .WAIT snap_pre snap_md_pre .WAIT snap_kern .WAIT snap_md_post
2661.141Sthorpej	(cd ../distrib/sets; ${MAKE} sets)
2671.206Sbjh21	${MAKESUMS} -t ${RELEASEDIR}/binary/kernel '*.gz'
2681.161Shubertf
2691.161Shubertf# Standalone target to create a CDROM image after the release
2701.161Shubertf# was composed. Should be run after "make build" in both src and xsrc
2711.204Slukemiso-image: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_post
2721.161Shubertf
2731.204Slukemiso-image_mi: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_pre
2741.161Shubertf	@if ${MKISOFS} --version; then \
2751.161Shubertf		mkdir -p ${RELEASEDIR}/installation/cdrom ; \
2761.161Shubertf		${MKISOFS} ${MKISOFS_FLAGS} \
2771.161Shubertf			-o ${RELEASEDIR}/installation/cdrom/netbsd-${MACHINE}.iso \
2781.161Shubertf			${RELEASEDIR} ; \
2791.206Sbjh21		${MAKESUMS} -t ${RELEASEDIR}/installation/cdrom '*.iso' ; \
2801.161Shubertf	else \
2811.161Shubertf		echo "install pkgsrc/sysutils/cdrecord and type 'make iso-image'." ; \
2821.161Shubertf	fi
2831.161Shubertf
2841.161Shubertf# Setup the $RELEASEDIR to produce a bootable CD image:
2851.204Slukemiso-image_md_pre: check_DESTDIR check_RELEASEDIR
2861.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
2871.161Shubertf
2881.161Shubertf# Fixup the  CD-image to be bootable
2891.204Slukemiso-image_md_post: check_DESTDIR check_RELEASEDIR .WAIT iso-image_mi
2901.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
2911.41Scgd
2921.204Slukemsnap_pre: check_DESTDIR check_RELEASEDIR
2931.168Sjmc# Could be a mount point, ignore the errors
2941.167Sjmc	-/bin/rm -rf ${RELEASEDIR}
2951.202Slukem	${INSTALL} -d -m 755 ${RELEASEDIR}
2961.117Ssimonb.for dir in ${INSTALLATION_DIRS}
2971.202Slukem	${INSTALL} -d -m 755 ${RELEASEDIR}/${dir}
2981.117Ssimonb.endfor
2991.96Scjs
3001.196Sthorpej# This target builds the kernels specified by each port.  A port may
3011.196Sthorpej# specify the following kernels:
3021.196Sthorpej#
3031.196Sthorpej#	KERNEL_SETS		The list of kernels that will be
3041.196Sthorpej#				packaged into sets, named
3051.196Sthorpej#				kern-${kernel}.tgz.  These kernels
3061.203Schs#				are also placed in the binary/kernel
3071.196Sthorpej#				area of the release package as
3081.196Sthorpej#				netbsd-${kernel}.gz.
3091.196Sthorpej#
3101.196Sthorpej#	EXTRA_KERNELS		Additional kernels to place in the
3111.203Schs#				binary/kernel area of the release
3121.196Sthorpej#				package as netbsd-${kernel}.gz, but
3131.196Sthorpej#				which are not placed into sets. This
3141.196Sthorpej#				allows a port to provide e.g. a netbootable
3151.196Sthorpej#				installation kernel containing a ramdisk.
3161.196Sthorpej#
3171.196Sthorpej#	BUILD_KERNELS		Additional kernels to build which are
3181.196Sthorpej#				not placed into sets nor into the
3191.203Schs#				binary/kernel area of the release
3201.196Sthorpej#				package.  These are typically kernels
3211.196Sthorpej#				that are built for inclusion only in
3221.196Sthorpej#				installation disk/CD-ROM/tape images.
3231.116Sfair#
3241.197Sthorpej# A port may also specify KERNEL_SUFFIXES, which is an optional list
3251.197Sthorpej# of filename suffixes for kernels to include in the kernel sets and
3261.203Schs# in the binary/kernel area of the release package (e.g. "netbsd" vs.
3271.197Sthorpej# "netbsd.ecoff" and "netbsd.srec").  It is not an error if kernels
3281.197Sthorpej# with these suffixes do not exist in the kernel build directory.
3291.197Sthorpej#
3301.116SfairGETKERNELAWK=	awk '/^config/ {print $$2; found=1} \
3311.116Sfair		END{ if (found == 0) print "netbsd"; }'
3321.96Scjs#
3331.118Sgwr.if !target(snap_kern)
3341.204Slukemsnap_kern: check_DESTDIR check_RELEASEDIR
3351.201Slukem.if !defined(KERNELS_DONE)						# {
3361.196Sthorpej.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
3371.125Ssommerfe	cd ${KERNCONFDIR} && ${CONFIG} \
3381.179Smrg		-b ${KERNOBJDIR}/${configfile:C/.*\///} -s ${KERNSRCDIR} ${configfile}
3391.201Slukem.if !defined(UPDATE)
3401.200Slukem	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean
3411.96Scjs.endif
3421.218Ssommerfe	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE}
3431.196Sthorpej.endfor # build kernels
3441.203Schs.endif # KERNELS_DONE							# }
3451.196Sthorpej.for configfile in ${KERNEL_SETS}
3461.197Sthorpej	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \
3471.197Sthorpej	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
3481.207Sbjh21	kernsuffixes="${KERNEL_SUFFIXES}"; \
3491.210Slukem	cd $${kerndir} && ( \
3501.214Slukem		echo "/set uname=${BINOWN} gname=${BINGRP}"; \
3511.214Slukem		echo ". type=dir optional"; \
3521.210Slukem		for kernel in $${kernlist}; do \
3531.214Slukem			echo "./$${kernel} type=file"; \
3541.207Sbjh21			for s in $${kernsuffixes}; do \
3551.197Sthorpej				if [ -f $${kernel}.$${s} ]; then \
3561.214Slukem					echo "./$${kernel}.$${s} type=file"; \
3571.197Sthorpej				fi; \
3581.197Sthorpej			done; \
3591.216Slukem		done ) | GZIP=-9 ${PAX} -zw \
3601.216Slukem		    -M ${UNPRIVED:D-N${NETBSDSRCDIR}/etc} \
3611.210Slukem		    -f ${RELEASEDIR}/binary/sets/kern-${configfile}.tgz
3621.196Sthorpej.endfor # make kernel sets
3631.196Sthorpej.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS}
3641.197Sthorpej	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \
3651.197Sthorpej	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
3661.207Sbjh21	kernsuffixes="${KERNEL_SUFFIXES}"; \
3671.197Sthorpej	cd $${kerndir} &&	\
3681.197Sthorpej		gziplist=`for kernel in $${kernlist}; do \
3691.197Sthorpej			echo "$${kernel}"; \
3701.207Sbjh21			for s in $${kernsuffixes}; do \
3711.197Sthorpej				if [ -f $${kernel}.$${s} ]; then \
3721.197Sthorpej					echo "$${kernel}.$${s}"; \
3731.197Sthorpej				fi; \
3741.197Sthorpej			done; \
3751.197Sthorpej		done`; \
3761.197Sthorpej		for kernel in $${gziplist} ; do \
3771.114Sfair		gzip -c -9 < $${kernel} > \
3781.201Slukem		    ${RELEASEDIR}/binary/kernel/$${kernel}-${configfile:C/.*\///}.gz ; done
3791.196Sthorpej.endfor # place KERNEL_SETS kernels + EXTRA_KERNELS in binary/kernel/...
3801.118Sgwr.endif # no target(snap_kern)
3811.108Sdrochner
3821.204Slukemsnap_md_pre: check_DESTDIR check_RELEASEDIR
3831.117Ssimonb# nothing here -- look in the machine-dependent Makefile.inc
3841.117Ssimonb
3851.204Slukemsnap_md_post: check_DESTDIR check_RELEASEDIR
3861.41Scgd# nothing here -- look in the machine-dependent Makefile.inc
3871.7Scgd
3881.1Scgd.include <bsd.prog.mk>
389