Makefile revision 1.221
11.221Sitojun#	$NetBSD: Makefile,v 1.221 2002/05/30 21:40:47 itojun 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.161ShubertfMKISOFS_FLAGS+= -J -l \
561.161Shubertf		-r -T -v \
571.161Shubertf		-P "The NetBSD Project" \
581.164Shubertf		-m "${RELEASEDIR}/installation/cdrom"
591.1Scgd
601.80Sjonathan# MD Makefile.inc may append MD targets to BIN[123].  Make sure all
611.80Sjonathan# are empty, to preserve the old semantics of setting them below with "=".
621.200SlukemBIN1=
631.80SjonathanBIN2=
641.80SjonathanBIN3=
651.80Sjonathan
661.117Ssimonb# Directories to build in ${RELEASEDIR}.   MD Makefile.inc files can
671.117Ssimonb# add to this.
681.117Ssimonb# NOTE: Parent directories must be listed before subdirectories.
691.217SlukemINSTALLATION_DIRS=	binary binary/sets binary/kernel installation
701.117Ssimonb
711.71Scjs.if exists(etc.${MACHINE}/Makefile.inc)
721.71Scjs.include "etc.${MACHINE}/Makefile.inc"
731.71Scjs.endif
741.32Sjtc
751.21Scgd# -rw-r--r--
761.21ScgdBINOWN= root
771.21ScgdBINGRP= wheel
781.184SlukemBIN1+=	bootptab changelist csh.cshrc csh.login csh.logout daily \
791.131Sveego	daily.conf dm.conf floppytab ftpchroot ftpusers ftpwelcome \
801.131Sveego	gettytab group hosts hosts.lpd inetd.conf lkm.conf \
811.131Sveego	mailer.conf man.conf monthly monthly.conf mrouted.conf \
821.151Sfvdl	netconfig networks newsyslog.conf nsswitch.conf ntp.conf \
831.213Sperry	passwd.conf phones printcap profile protocols rbootd.conf rc rc.conf \
841.159Slukem	rc.lkm rc.local rc.subr rc.shutdown remote rpc \
851.142Stsarna	security security.conf services shells sysctl.conf syslog.conf \
861.142Stsarna	weekly weekly.conf wscons.conf \
871.109Sdrochner	etc.${MACHINE}/ttys etc.${MACHINE}/disktab
881.105Smycroft
891.121Sfvdl.if	(${MACHINE_ARCH} == "m68k") || \
901.105Smycroft	(${MACHINE_ARCH} == "ns32k") || \
911.208Swiz	(${MACHINE_ARCH} == "vax")
921.129SchristosBIN1+=	ld.so.conf
931.129Schristos.elif exists(etc.${MACHINE_ARCH}/ld.so.conf)
941.132SjlamBIN1+=	etc.${MACHINE_ARCH}/ld.so.conf
951.152Sperry.endif
961.152Sperry
971.152Sperry.if exists(etc.${MACHINE_ARCH}/ttyaction)
981.152SperryBIN1+=	etc.${MACHINE_ARCH}/ttyaction
991.105Smycroft.endif
1001.1Scgd
1011.46Sderaadt# -rw-rw-r--
1021.80SjonathanBIN2+=	motd
1031.1Scgd
1041.77Smycroft# -rw-------
1051.80SjonathanBIN3+=	hosts.equiv
1061.77Smycroft
1071.144SthorpejNAMEDB=	127 root.cache named.conf localhost loopback.v6
1081.1Scgd
1091.220Sitojun.if make(install-etc-files)						# {
1101.221Sitojun.include <bsd.endian.mk>
1111.191Stv.if ${TARGET_ENDIANNESS} == "1234"
1121.221SitojunTARGET_ENDIANNESS=	-L
1131.191Stv.elif ${TARGET_ENDIANNESS} == "4321"
1141.221SitojunTARGET_ENDIANNESS=	-B
1151.170Sjdolecek.else
1161.170SjdolecekTARGET_ENDIANNESS=
1171.191Stv.endif
1181.220Sitojun.endif	# install-etc-files						# }
1191.149Ssjg
1201.149Ssjgobj:
1211.149Ssjg	mkdir -p ${KERNOBJDIR}
1221.149Ssjg
1231.204Slukemdistribution: check_DESTDIR .WAIT distrib-dirs
1241.182Schs.if !defined(DISTRIBUTION_DONE)
1251.87Sperry.if !defined(INSTALL_DONE)
1261.107Sscottr	(cd ..; ${MAKE} _DISTRIB= includes)
1271.107Sscottr	(cd ..; ${MAKE} _DISTRIB= install)
1281.200Slukem.endif	# !INSTALL_DONE
1291.193Sthorpej	${MAKE} install-etc-files
1301.200Slukem.endif	# !DISTRIBUTION_DONE
1311.193Sthorpej
1321.204Slukeminstall-etc-files: check_DESTDIR
1331.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
1341.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
1351.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} ${DESTDIR}/etc
1361.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 aliases \
1371.147Sitojun	    ${DESTDIR}/etc/mail
1381.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 crontab \
1391.56Sthorpej	    ${DESTDIR}/var/cron/tabs/root
1401.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
1411.198Sjmc	${PWD_MKDB} -p ${TARGET_ENDIANNESS} -d ${DESTDIR}/ \
1421.171Ssimonb		${DESTDIR}/etc/master.passwd
1431.194Sperry.if defined(UNPRIVED)
1441.194Sperry	echo "${DESTDIR}/etc/passwd type=file mode=0644 uname=root gname=wheel" \
1451.194Sperry		| sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
1461.194Sperry	echo "${DESTDIR}/etc/pwd.db type=file mode=0644 uname=root gname=wheel" \
1471.194Sperry		| sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
1481.194Sperry	echo "${DESTDIR}/etc/spwd.db type=file mode=0600 uname=root gname=wheel" \
1491.194Sperry		| sed -e 's|^/|./|g' -e 's|//|/|g' >>${METALOG}
1501.200Slukem.endif	# UNPRIVED
1511.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
1521.1Scgd	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
1531.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 minfree ${DESTDIR}/var/crash
1541.1Scgd	(cd root; \
1551.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.cshrc \
1561.1Scgd		    ${DESTDIR}/root/.cshrc; \
1571.202Slukem		${INSTALL_FILE} -o root -g wheel -m 600 dot.klogin \
1581.1Scgd		    ${DESTDIR}/root/.klogin; \
1591.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.login \
1601.1Scgd		    ${DESTDIR}/root/.login; \
1611.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.profile \
1621.1Scgd		    ${DESTDIR}/root/.profile; \
1631.202Slukem		${INSTALL_FILE} -o root -g wheel -m 644 dot.shrc \
1641.128Smycroft		    ${DESTDIR}/root/.shrc; \
1651.189Sperry		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
1661.202Slukem		${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
1671.202Slukem		${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
1681.162Slukem	(cd defaults; ${MAKE} install)
1691.83Smrg	(cd mtree; ${MAKE} install)
1701.63Smikel	(cd namedb; \
1711.202Slukem		${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
1721.124Ssimonb		    ${NAMEDB} ${DESTDIR}/etc/namedb)
1731.140Slukem	(cd rc.d; ${MAKE} install)
1741.215Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
1751.215Slukem		postinstall ${DESTDIR}/etc
1761.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 \
1771.188Sperry		${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
1781.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 \
1791.188Sperry		/usr/sbin/rmt ${DESTDIR}/etc/rmt
1801.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g operator -m 664 /dev/null \
1811.32Sjtc		${DESTDIR}/etc/dumpdates
1821.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g operator -m 600 /dev/null \
1831.44Sderaadt		${DESTDIR}/etc/skeykeys
1841.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 /dev/null \
1851.127Sperry		${DESTDIR}/var/at/at.deny
1861.202Slukem	${INSTALL_FILE} -o root -g wheel -m 600 /dev/null \
1871.38Scgd		${DESTDIR}/var/cron/log
1881.202Slukem	${INSTALL_FILE} -o nobody -g ${BINGRP} -m 664 /dev/null \
1891.32Sjtc		${DESTDIR}/var/db/locate.database
1901.202Slukem	${INSTALL_FILE} -o uucp -g dialer -m 640 /dev/null \
1911.113Sfair		${DESTDIR}/var/log/aculog
1921.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
1931.69Sperry		${DESTDIR}/var/log/authlog
1941.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
1951.32Sjtc		${DESTDIR}/var/log/lastlog
1961.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
1971.32Sjtc		${DESTDIR}/var/log/lpd-errs
1981.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
1991.32Sjtc		${DESTDIR}/var/log/maillog
2001.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2011.32Sjtc		${DESTDIR}/var/log/messages
2021.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2031.58Slukem		${DESTDIR}/var/log/secure
2041.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2051.137Smycroft		${DESTDIR}/var/log/sendmail.st
2061.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
2071.32Sjtc		${DESTDIR}/var/log/wtmp
2081.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
2091.69Sperry		${DESTDIR}/var/log/xferlog
2101.202Slukem	${INSTALL_FILE} -o daemon -g staff -m 664 /dev/null \
2111.39Scgd		${DESTDIR}/var/msgs/bounds
2121.202Slukem	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
2131.32Sjtc		${DESTDIR}/var/run/utmp
2141.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2151.81Smrg		${DESTDIR}/var/games/atc_scores
2161.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2171.81Smrg		${DESTDIR}/var/games/battlestar.log
2181.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2191.81Smrg		${DESTDIR}/var/games/cfscores
2201.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2211.82Sperry		${DESTDIR}/var/games/criblog
2221.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2231.81Smrg		${DESTDIR}/var/games/robots_roll
2241.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2251.81Smrg		${DESTDIR}/var/games/rogue.scores
2261.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2271.81Smrg		${DESTDIR}/var/games/saillog
2281.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2291.81Smrg		${DESTDIR}/var/games/snakerawscores
2301.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2311.81Smrg		${DESTDIR}/var/games/snake.log
2321.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2331.81Smrg		${DESTDIR}/var/games/tetris.scores
2341.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2351.81Smrg		${DESTDIR}/var/games/larn/llog12.0
2361.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2371.81Smrg		${DESTDIR}/var/games/larn/lscore12.0
2381.202Slukem	${INSTALL_FILE} -o games -g games -m 664 /dev/null \
2391.81Smrg		${DESTDIR}/var/games/larn/playerids
2401.165Ssimonb	(cd skel; ${MAKE} distribution)
2411.62Sperry	(cd ../usr.bin/mail; ${MAKE} distribution)
2421.143Sperry	(cd ../gnu/usr.sbin/postfix/; ${MAKE} distribution)
2431.155Sthorpej.if (${MKCRYPTO} != "no")
2441.155Sthorpej	(cd ../usr.bin/ssh; ${MAKE} distribution)
2451.155Sthorpej.endif
2461.200Slukem.if !defined(NO_SENDMAIL)
2471.133Stron	(cd ../gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
2481.90Skim.endif
2491.1Scgd
2501.204Slukemdistrib-dirs: check_DESTDIR
2511.202Slukem	${INSTALL_DIR} -o root -g wheel -m 755 ${DESTDIR}
2521.192Sperry	${MTREE} -def mtree/NetBSD.dist -p ${DESTDIR}/ -U ${UNPRIVED:D-W}
2531.189Sperry	rm -f ${DESTDIR}/sys
2541.202Slukem	${INSTALL_SYMLINK} -o root -g wheel -m 755 usr/src/sys ${DESTDIR}/sys
2551.200Slukem
2561.204Slukemrelease snapshot: check_DESTDIR check_RELEASEDIR .WAIT \
2571.218Ssommerfe    distribution .WAIT snap_pre snap_md_pre .WAIT snap_kern .WAIT snap_md_post
2581.141Sthorpej	(cd ../distrib/sets; ${MAKE} sets)
2591.206Sbjh21	${MAKESUMS} -t ${RELEASEDIR}/binary/kernel '*.gz'
2601.161Shubertf
2611.161Shubertf# Standalone target to create a CDROM image after the release
2621.161Shubertf# was composed. Should be run after "make build" in both src and xsrc
2631.204Slukemiso-image: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_post
2641.161Shubertf
2651.204Slukemiso-image_mi: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_pre
2661.161Shubertf	@if ${MKISOFS} --version; then \
2671.161Shubertf		mkdir -p ${RELEASEDIR}/installation/cdrom ; \
2681.161Shubertf		${MKISOFS} ${MKISOFS_FLAGS} \
2691.161Shubertf			-o ${RELEASEDIR}/installation/cdrom/netbsd-${MACHINE}.iso \
2701.161Shubertf			${RELEASEDIR} ; \
2711.206Sbjh21		${MAKESUMS} -t ${RELEASEDIR}/installation/cdrom '*.iso' ; \
2721.161Shubertf	else \
2731.161Shubertf		echo "install pkgsrc/sysutils/cdrecord and type 'make iso-image'." ; \
2741.161Shubertf	fi
2751.161Shubertf
2761.161Shubertf# Setup the $RELEASEDIR to produce a bootable CD image:
2771.204Slukemiso-image_md_pre: check_DESTDIR check_RELEASEDIR
2781.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
2791.161Shubertf
2801.161Shubertf# Fixup the  CD-image to be bootable
2811.204Slukemiso-image_md_post: check_DESTDIR check_RELEASEDIR .WAIT iso-image_mi
2821.161Shubertf# nothing here -- look in the machine-dependent Makefile.inc
2831.41Scgd
2841.204Slukemsnap_pre: check_DESTDIR check_RELEASEDIR
2851.168Sjmc# Could be a mount point, ignore the errors
2861.167Sjmc	-/bin/rm -rf ${RELEASEDIR}
2871.202Slukem	${INSTALL} -d -m 755 ${RELEASEDIR}
2881.117Ssimonb.for dir in ${INSTALLATION_DIRS}
2891.202Slukem	${INSTALL} -d -m 755 ${RELEASEDIR}/${dir}
2901.117Ssimonb.endfor
2911.96Scjs
2921.196Sthorpej# This target builds the kernels specified by each port.  A port may
2931.196Sthorpej# specify the following kernels:
2941.196Sthorpej#
2951.196Sthorpej#	KERNEL_SETS		The list of kernels that will be
2961.196Sthorpej#				packaged into sets, named
2971.196Sthorpej#				kern-${kernel}.tgz.  These kernels
2981.203Schs#				are also placed in the binary/kernel
2991.196Sthorpej#				area of the release package as
3001.196Sthorpej#				netbsd-${kernel}.gz.
3011.196Sthorpej#
3021.196Sthorpej#	EXTRA_KERNELS		Additional kernels to place in the
3031.203Schs#				binary/kernel area of the release
3041.196Sthorpej#				package as netbsd-${kernel}.gz, but
3051.196Sthorpej#				which are not placed into sets. This
3061.196Sthorpej#				allows a port to provide e.g. a netbootable
3071.196Sthorpej#				installation kernel containing a ramdisk.
3081.196Sthorpej#
3091.196Sthorpej#	BUILD_KERNELS		Additional kernels to build which are
3101.196Sthorpej#				not placed into sets nor into the
3111.203Schs#				binary/kernel area of the release
3121.196Sthorpej#				package.  These are typically kernels
3131.196Sthorpej#				that are built for inclusion only in
3141.196Sthorpej#				installation disk/CD-ROM/tape images.
3151.116Sfair#
3161.197Sthorpej# A port may also specify KERNEL_SUFFIXES, which is an optional list
3171.197Sthorpej# of filename suffixes for kernels to include in the kernel sets and
3181.203Schs# in the binary/kernel area of the release package (e.g. "netbsd" vs.
3191.197Sthorpej# "netbsd.ecoff" and "netbsd.srec").  It is not an error if kernels
3201.197Sthorpej# with these suffixes do not exist in the kernel build directory.
3211.197Sthorpej#
3221.116SfairGETKERNELAWK=	awk '/^config/ {print $$2; found=1} \
3231.116Sfair		END{ if (found == 0) print "netbsd"; }'
3241.96Scjs#
3251.118Sgwr.if !target(snap_kern)
3261.204Slukemsnap_kern: check_DESTDIR check_RELEASEDIR
3271.201Slukem.if !defined(KERNELS_DONE)						# {
3281.196Sthorpej.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
3291.125Ssommerfe	cd ${KERNCONFDIR} && ${CONFIG} \
3301.179Smrg		-b ${KERNOBJDIR}/${configfile:C/.*\///} -s ${KERNSRCDIR} ${configfile}
3311.201Slukem.if !defined(UPDATE)
3321.200Slukem	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean
3331.96Scjs.endif
3341.218Ssommerfe	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE}
3351.196Sthorpej.endfor # build kernels
3361.203Schs.endif # KERNELS_DONE							# }
3371.196Sthorpej.for configfile in ${KERNEL_SETS}
3381.197Sthorpej	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \
3391.197Sthorpej	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
3401.207Sbjh21	kernsuffixes="${KERNEL_SUFFIXES}"; \
3411.210Slukem	cd $${kerndir} && ( \
3421.214Slukem		echo "/set uname=${BINOWN} gname=${BINGRP}"; \
3431.214Slukem		echo ". type=dir optional"; \
3441.210Slukem		for kernel in $${kernlist}; do \
3451.214Slukem			echo "./$${kernel} type=file"; \
3461.207Sbjh21			for s in $${kernsuffixes}; do \
3471.197Sthorpej				if [ -f $${kernel}.$${s} ]; then \
3481.214Slukem					echo "./$${kernel}.$${s} type=file"; \
3491.197Sthorpej				fi; \
3501.197Sthorpej			done; \
3511.216Slukem		done ) | GZIP=-9 ${PAX} -zw \
3521.216Slukem		    -M ${UNPRIVED:D-N${NETBSDSRCDIR}/etc} \
3531.210Slukem		    -f ${RELEASEDIR}/binary/sets/kern-${configfile}.tgz
3541.196Sthorpej.endfor # make kernel sets
3551.196Sthorpej.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS}
3561.197Sthorpej	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \
3571.197Sthorpej	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
3581.207Sbjh21	kernsuffixes="${KERNEL_SUFFIXES}"; \
3591.197Sthorpej	cd $${kerndir} &&	\
3601.197Sthorpej		gziplist=`for kernel in $${kernlist}; do \
3611.197Sthorpej			echo "$${kernel}"; \
3621.207Sbjh21			for s in $${kernsuffixes}; do \
3631.197Sthorpej				if [ -f $${kernel}.$${s} ]; then \
3641.197Sthorpej					echo "$${kernel}.$${s}"; \
3651.197Sthorpej				fi; \
3661.197Sthorpej			done; \
3671.197Sthorpej		done`; \
3681.197Sthorpej		for kernel in $${gziplist} ; do \
3691.114Sfair		gzip -c -9 < $${kernel} > \
3701.201Slukem		    ${RELEASEDIR}/binary/kernel/$${kernel}-${configfile:C/.*\///}.gz ; done
3711.196Sthorpej.endfor # place KERNEL_SETS kernels + EXTRA_KERNELS in binary/kernel/...
3721.118Sgwr.endif # no target(snap_kern)
3731.108Sdrochner
3741.204Slukemsnap_md_pre: check_DESTDIR check_RELEASEDIR
3751.117Ssimonb# nothing here -- look in the machine-dependent Makefile.inc
3761.117Ssimonb
3771.204Slukemsnap_md_post: check_DESTDIR check_RELEASEDIR
3781.41Scgd# nothing here -- look in the machine-dependent Makefile.inc
3791.7Scgd
3801.1Scgd.include <bsd.prog.mk>
381