Makefile revision 1.244
1#	$NetBSD: Makefile,v 1.244 2003/01/09 16:57:45 mrg Exp $
2#	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
3
4# Environment variables without default values:
5#   DESTDIR must be set before anything in this file will work.
6#   RELEASEDIR is where the tarred up stuff for a snapshot or
7#	release will be placed.
8#
9# Environment variables with default values:
10#   LOCALTIME will set the default local time for the system you
11#	build; it determines what /etc/localtime is symlink'd to.
12#   KERNSRCDIR points to kernel source; it is set by default to ../sys,
13#	but can be overridden.
14#   KERNOBJDIR is the kernel build directory, it defaults to
15#	${KERNSRCDIR}/arch/${MACHINE}/compile, but can be overridden.
16#   KERNCONFDIR is where the configuration files for kernels are found;
17#	default is ${KERNSRCDIR}/arch/${MACHINE}/conf but can be overridden.
18#   UPDATE is normally undefined; if defined, don't do a 'make clean'
19#	before kernel compile
20#   NO_SENDMAIL is normally undefined; if defined, it will not do a
21#	`make distribution' in the sendmail config file source directory.
22#
23# Targets:
24#    distribution: makes a full NetBSD distribution in DESTDIR. If
25#	INSTALL_DONE is set, it will not do a `make install.'
26#	if DISTRIBUTION_DONE is set, it will not do anything.
27#    distrib-dirs: creates an empty NetBSD directory tree in DESTDIR.
28#	Called by distribution.
29#    snapshot: calls distribution, above, and then tars up the files
30#	into a release(7) format in RELEASEDIR/${MACHINE}.
31#	Any port-dependent stuff for this target is found in
32#	etc.${MACHINE}/Makefile.inc.
33#    release: a synonym for `snapshot'
34#
35
36# For NO_SENDMAIL, INSTPRIV, MKCRYPTO
37#
38.include <bsd.own.mk>
39
40# For KERNSRCDIR, KERNOBJDIR, ...
41#
42.include <bsd.kernobj.mk>
43
44
45.MAKEOVERRIDES+=	USETOOLS
46
47TZDIR=		/usr/share/zoneinfo
48LOCALTIME?=	UTC
49PWD_MKDB?=	pwd_mkdb
50MAKESUMS=	CKSUM=${CKSUM:Q} sh ${NETBSDSRCDIR}/distrib/sets/makesums
51
52# Flags for creating ISO CDROM image
53# mkisofs is expected to be in $PATH, install via pkgsrc/sysutils/cdrecord
54# Note: At least mkisofs 2.0 should be used.
55#
56MKISOFS?=	mkisofs
57DISTRIBREV!=	sh ${KERNSRCDIR}/conf/osrelease.sh -s
58# ISO 9660 volume ID.  Note that this can only contain [A-Z0-9_].
59ISO_VOLID!=	echo NETBSD_${MACHINE}_${DISTRIBREV} | tr a-z A-Z
60MKISOFS_FLAGS+= -J -l \
61		-r -T -v \
62		-V ${ISO_VOLID} \
63		-P "The NetBSD Project" \
64		-m "${RELEASEDIR}/${MACHINE}/installation/cdrom"
65
66# MD Makefile.inc may append MD targets to BIN[123].  Make sure all
67# are empty, to preserve the old semantics of setting them below with "=".
68#
69BIN1=
70BIN2=
71BIN3=
72
73# Directories to build in ${RELEASEDIR}/${MACHINE}.
74# MD Makefile.inc files can add to this.
75# NOTE: Parent directories must be listed before subdirectories.
76#
77INSTALLATION_DIRS=	binary binary/sets binary/kernel installation
78
79.if exists(etc.${MACHINE}/Makefile.inc)
80.include "etc.${MACHINE}/Makefile.inc"
81.endif
82
83# -rw-r--r--
84BINOWN= root
85BINGRP= wheel
86UTMPGRP= utmp
87BIN1+=	bootptab changelist csh.cshrc csh.login csh.logout daily \
88	daily.conf dm.conf floppytab ftpchroot ftpusers \
89	gettytab group hosts hosts.lpd inetd.conf lkm.conf \
90	mailer.conf man.conf monthly monthly.conf mrouted.conf \
91	netconfig networks newsyslog.conf nsswitch.conf ntp.conf \
92	passwd.conf phones printcap profile protocols rbootd.conf rc rc.conf \
93	rc.lkm rc.local rc.subr rc.shutdown remote rpc \
94	security security.conf services shells sysctl.conf syslog.conf \
95	weekly weekly.conf wscons.conf \
96	etc.${MACHINE}/ttys
97
98# Use machine-specific disktab if it exists, or the MI one otherwise
99.if exists(etc.${MACHINE}/disktab)
100BIN1+=	etc.${MACHINE}/disktab
101.else
102BIN1+=	disktab
103.endif
104
105.if exists(etc.${MACHINE}/ld.so.conf)
106BIN1+=	etc.${MACHINE}/ld.so.conf
107.endif
108
109.if exists(etc.${MACHINE}/ttyaction)
110BIN1+=	etc.${MACHINE}/ttyaction
111.endif
112
113# -rw-rw-r--
114BIN2+=	motd
115
116# -rw-------
117BIN3+=	hosts.equiv
118
119ETC_PKG=-T etc_pkg
120BASE_PKG=-T base_pkg
121ETC_INSTALL_FILE=cd ${.CURDIR} && ${INSTALL_FILE} ${ETC_PKG}
122ETC_INSTALL_LINK=cd ${.CURDIR} && ${INSTALL_LINK} ${ETC_PKG}
123ETC_INSTALL_SYMLINK=cd ${.CURDIR} && ${INSTALL_SYMLINK} ${ETC_PKG}
124
125NAMEDB=	127 root.cache named.conf localhost loopback.v6
126
127.if make(install-etc-files)						# {
128.include <bsd.endian.mk>
129.if ${TARGET_ENDIANNESS} == "1234"
130TARGET_ENDIANNESS=	-L
131.elif ${TARGET_ENDIANNESS} == "4321"
132TARGET_ENDIANNESS=	-B
133.else
134TARGET_ENDIANNESS=
135.endif
136.endif	# install-etc-files						# }
137
138
139# distribution --
140#	Build a distribution
141#
142distribution: check_DESTDIR .WAIT distrib-dirs
143.if !defined(DISTRIBUTION_DONE)
144.if !defined(INSTALL_DONE)
145	(cd ${NETBSDSRCDIR}; ${MAKE} _DISTRIB= includes)
146	(cd ${NETBSDSRCDIR}; ${MAKE} _DISTRIB= install)
147.endif	# !INSTALL_DONE
148	(cd ${.CURDIR}; ${MAKE} install-etc-files)
149.endif	# !DISTRIBUTION_DONE
150
151
152# install-etc-files --
153#	Install etc (config) files; not performed by "make build"
154#
155install-etc-files: check_DESTDIR
156	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
157	    ${BIN1} ${DESTDIR}/etc
158	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 \
159	    ${BIN2} ${DESTDIR}/etc
160	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
161	    ${BIN3} ${DESTDIR}/etc
162	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
163	    aliases ${DESTDIR}/etc/mail
164	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
165	    /dev/null ${DESTDIR}/etc/mail/local-host-names
166	${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
167	    crontab ${DESTDIR}/var/cron/tabs/root
168	${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
169	    master.passwd ${DESTDIR}/etc
170	${PWD_MKDB} -p ${TARGET_ENDIANNESS} -d ${DESTDIR}/ \
171	    ${DESTDIR}/etc/master.passwd
172.if defined(UNPRIVED)
173	( \
174	    echo "./etc/passwd type=file mode=0644 uname=root gname=wheel tags=etc_pkg"; \
175	    echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel tags=etc_pkg"; \
176	    echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel tags=etc_pkg"; \
177	) | ${METALOG.add}
178.endif	# UNPRIVED
179	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \
180	    MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
181	${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
182	    minfree ${DESTDIR}/var/crash
183.for file in cshrc login profile shrc
184	${ETC_INSTALL_FILE} -o root -g wheel -m 644 \
185	    root/dot.${file} ${DESTDIR}/root/.${file}
186.endfor
187	${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
188	    root/dot.klogin ${DESTDIR}/root/.klogin
189	rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile
190	${ETC_INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
191	${ETC_INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
192	(cd ${.CURDIR}/defaults; ${MAKE} install)
193	(cd ${.CURDIR}/mtree; ${MAKE} install)
194.for file in ${NAMEDB}
195	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
196	    namedb/${file} ${DESTDIR}/etc/namedb
197.endfor
198	(cd ${.CURDIR}/rc.d; ${MAKE} install)
199	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
200	    postinstall ${DESTDIR}/etc
201	${ETC_INSTALL_SYMLINK} -o root -g wheel -m 755 \
202	    ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
203	${ETC_INSTALL_SYMLINK} -o root -g wheel -m 755 \
204	    /usr/sbin/rmt ${DESTDIR}/etc/rmt
205	${ETC_INSTALL_FILE} -o ${BINOWN} -g operator -m 664 \
206	    /dev/null ${DESTDIR}/etc/dumpdates
207	${ETC_INSTALL_FILE} -o ${BINOWN} -g operator -m 600 \
208	    /dev/null ${DESTDIR}/etc/skeykeys
209	${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
210	    /dev/null ${DESTDIR}/var/at/at.deny
211	${ETC_INSTALL_FILE} -o root -g wheel -m 600 \
212	    /dev/null ${DESTDIR}/var/cron/log
213	${ETC_INSTALL_FILE} -o nobody -g ${BINGRP} -m 664 \
214	    /dev/null ${DESTDIR}/var/db/locate.database
215	${ETC_INSTALL_FILE} -o uucp -g dialer -m 640 \
216	    /dev/null ${DESTDIR}/var/log/aculog
217	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
218	    /dev/null ${DESTDIR}/var/log/authlog
219	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 664 \
220	    /dev/null ${DESTDIR}/var/log/lastlog
221	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 640 \
222	    /dev/null ${DESTDIR}/var/log/lpd-errs
223	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
224	    /dev/null ${DESTDIR}/var/log/maillog
225	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
226	    /dev/null ${DESTDIR}/var/log/messages
227	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
228	    /dev/null ${DESTDIR}/var/log/secure
229	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
230	    /dev/null ${DESTDIR}/var/log/sendmail.st
231	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
232	    /dev/null ${DESTDIR}/var/log/wtmp
233	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 644 \
234	    /dev/null ${DESTDIR}/var/log/wtmpx
235	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 600 \
236	    /dev/null ${DESTDIR}/var/log/xferlog
237	${ETC_INSTALL_FILE} -o daemon -g staff -m 664 \
238	    /dev/null ${DESTDIR}/var/msgs/bounds
239	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 \
240	    /dev/null ${DESTDIR}/var/run/utmp
241	${ETC_INSTALL_FILE} -o ${BINOWN} -g ${UTMPGRP} -m 664 \
242	    /dev/null ${DESTDIR}/var/run/utmpx
243	${ETC_INSTALL_FILE} -o games -g games -m 664 \
244	    /dev/null ${DESTDIR}/var/games/atc_scores
245	${ETC_INSTALL_FILE} -o games -g games -m 664 \
246	    /dev/null ${DESTDIR}/var/games/battlestar.log
247	${ETC_INSTALL_FILE} -o games -g games -m 664 \
248	    /dev/null ${DESTDIR}/var/games/cfscores
249	${ETC_INSTALL_FILE} -o games -g games -m 664 \
250	    /dev/null ${DESTDIR}/var/games/criblog
251	${ETC_INSTALL_FILE} -o games -g games -m 660 \
252	    /dev/null ${DESTDIR}/var/games/hackdir/perm
253	${ETC_INSTALL_FILE} -o games -g games -m 660 \
254	    /dev/null ${DESTDIR}/var/games/hackdir/record
255	${ETC_INSTALL_FILE} -o games -g games -m 664 \
256	    /dev/null ${DESTDIR}/var/games/larn/llog12.0
257	${ETC_INSTALL_FILE} -o games -g games -m 664 \
258	    /dev/null ${DESTDIR}/var/games/larn/lscore12.0
259	${ETC_INSTALL_FILE} -o games -g games -m 664 \
260	    /dev/null ${DESTDIR}/var/games/larn/playerids
261	${ETC_INSTALL_FILE} -o games -g games -m 664 \
262	    /dev/null ${DESTDIR}/var/games/robots_roll
263	${ETC_INSTALL_FILE} -o games -g games -m 664 \
264	    /dev/null ${DESTDIR}/var/games/rogue.scores
265	${ETC_INSTALL_FILE} -o games -g games -m 664 \
266	    /dev/null ${DESTDIR}/var/games/saillog
267	${ETC_INSTALL_FILE} -o games -g games -m 664 \
268	    /dev/null ${DESTDIR}/var/games/snakerawscores
269	${ETC_INSTALL_FILE} -o games -g games -m 664 \
270	    /dev/null ${DESTDIR}/var/games/snake.log
271	${ETC_INSTALL_FILE} -o games -g games -m 664 \
272	    /dev/null ${DESTDIR}/var/games/tetris.scores
273	(cd ${.CURDIR}/skel; ${MAKE} distribution)
274	(cd ${NETBSDSRCDIR}/usr.bin/mail; ${MAKE} distribution)
275	(cd ${NETBSDSRCDIR}/gnu/usr.sbin/postfix/; ${MAKE} distribution)
276.if (${MKCRYPTO} != "no")
277	(cd ${NETBSDSRCDIR}/usr.bin/ssh; ${MAKE} distribution)
278.endif
279.if !defined(NO_SENDMAIL) || ${NO_SENDMAIL} == "no"
280	(cd ${NETBSDSRCDIR}/gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
281.endif
282
283
284# distrib-dirs --
285#	Populate $DESTDIR with directories needed by NetBSD
286#
287distrib-dirs: check_DESTDIR
288	${INSTALL_DIR} -o root -g wheel -m 755 ${BASE_PKG} ${DESTDIR}
289	${MTREE} -def ${.CURDIR}/mtree/NetBSD.dist -N ${.CURDIR} \
290	    -p ${DESTDIR}/ -U ${UNPRIVED:D-W}
291
292
293# release, snapshot --
294#	Build a full distribution including kernels & install media.
295#
296release snapshot: check_DESTDIR check_RELEASEDIR .WAIT \
297		    distribution .WAIT \
298		    snap_pre .WAIT snap_kern .WAIT \
299		    snap_post .WAIT snap_md_post
300	(cd ${NETBSDSRCDIR}/distrib/sets; ${MAKE} sets)
301	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/binary/kernel '*.gz'
302
303
304# iso-image --
305#	Standalone target to create a CDROM image after the release
306#	was composed.  Should be run after "make release" in src and xsrc.
307#
308#
309CDROM.image=${RELEASEDIR}/${MACHINE}/installation/cdrom/netbsd-${MACHINE}.iso
310CDROM.dir=	cdrom.dir
311CDROM.pathlist=	cdrom.pathlist
312
313iso-image: check_DESTDIR check_RELEASEDIR .WAIT iso-image_md_post
314#	empty target
315
316iso-image_setup: check_RELEASEDIR
317	rm -f ${CDROM.pathlist}
318	echo "${MACHINE}=${RELEASEDIR}/${MACHINE}" >> ${CDROM.pathlist}
319	mkdir -p ${CDROM.dir}
320	mkdir -p ${RELEASEDIR}/${MACHINE}/installation/cdrom
321
322# iso-image_mi --
323#	Create the image after the MD operations have completed.
324iso-image_mi: check_DESTDIR check_RELEASEDIR .WAIT \
325		iso-image_setup .WAIT iso-image_md_pre
326	@if ! ${MKISOFS} --version; then \
327		echo "install pkgsrc/sysutils/cdrecord and run 'make iso-image'." ; \
328		false; \
329	fi
330	${MKISOFS} ${MKISOFS_FLAGS} -graft-points -path-list ${CDROM.pathlist} \
331	    -o ${CDROM.image} ${CDROM.dir}
332	${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/installation/cdrom '*.iso'
333
334# iso-image_md_pre --
335#	Setup ${CDROM.dir} to produce a bootable CD image.
336#	Overridden by etc.$MACHINE/Makefile.inc
337#
338iso-image_md_pre: check_DESTDIR check_RELEASEDIR
339#	(empty -- look in the machine-dependent Makefile.inc)
340
341# iso-image_md_post --
342#	Fixup the CD-image to be bootable.
343#	Overridden by etc.$MACHINE/Makefile.inc
344#
345iso-image_md_post: check_DESTDIR check_RELEASEDIR .WAIT iso-image_mi
346#	(empty -- look in the machine-dependent Makefile.inc)
347
348
349# snap_pre --
350#	Create ${RELEASEDIR} and necessary subdirectories.
351#
352snap_pre: check_DESTDIR check_RELEASEDIR
353	${INSTALL} -d -m 755 ${RELEASEDIR}
354.ifndef UPDATE
355# Could be a mount point, ignore the errors
356	-/bin/rm -rf ${RELEASEDIR}/${MACHINE}
357.endif
358	${INSTALL} -d -m 755 ${RELEASEDIR}/${MACHINE}
359.for dir in ${INSTALLATION_DIRS}
360	${INSTALL} -d -m 755 ${RELEASEDIR}/${MACHINE}/${dir}
361.endfor
362
363# snap_post --
364#	Build the install media and notes from distrib
365#
366snap_post: check_DESTDIR check_RELEASEDIR
367.ifndef UPDATE
368	cd ${NETBSDSRCDIR}/distrib && ${MAKE} cleandir
369.endif
370	cd ${NETBSDSRCDIR}/distrib && ${MAKE} depend && ${MAKE} && \
371	    ${MAKE} release
372
373# snap_kern --
374#	This target builds the kernels specified by each port.
375#	A port may specify the following kernels:
376#
377#	KERNEL_SETS		The list of kernels that will be
378#				packaged into sets, named
379#				kern-${kernel}.tgz.  These kernels
380#				are also placed in the binary/kernel
381#				area of the release package as
382#				netbsd-${kernel}.gz.
383#
384#	EXTRA_KERNELS		Additional kernels to place in the
385#				binary/kernel area of the release
386#				package as netbsd-${kernel}.gz, but
387#				which are not placed into sets. This
388#				allows a port to provide e.g. a netbootable
389#				installation kernel containing a ramdisk.
390#
391#	BUILD_KERNELS		Additional kernels to build which are
392#				not placed into sets nor into the
393#				binary/kernel area of the release
394#				package.  These are typically kernels
395#				that are built for inclusion only in
396#				installation disk/CD-ROM/tape images.
397#
398#	A port may also specify KERNEL_SUFFIXES, which is an optional list
399#	of filename suffixes for kernels to include in the kernel sets and
400#	in the binary/kernel area of the release package (e.g. "netbsd" vs.
401#	"netbsd.ecoff" and "netbsd.srec").  It is not an error if kernels
402#	with these suffixes do not exist in the kernel build directory.
403#
404#
405# A list of all the kernels to build, which can be overridden from
406# external sources (such as make(1)'s environment or command line)
407#
408ALL_KERNELS?=	${KERNEL_SETS} ${EXTRA_KERNELS} ${BUILD_KERNELS}
409
410GETKERNELAWK=	awk '/^config/ {print $$2; found=1} \
411		END{ if (found == 0) print "netbsd"; }'
412
413.if !target(snap_kern)						# {
414
415# build_kernels --
416#	Configure & compile kernels listed in ${ALL_KERNELS}
417#
418.if !defined(KERNELS_DONE)						# {
419.for configfile in ${ALL_KERNELS}					# {
420_KERNELS_TO_BUILD+=kern-${configfile}
421kern-${configfile}:
422	cd ${KERNCONFDIR} && ${CONFIG} -s ${KERNSRCDIR} \
423	    -b ${KERNOBJDIR}/${configfile:C/.*\///} ${configfile}
424.if !defined(UPDATE)
425	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} distclean
426.endif
427	cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE}
428.endfor	# ALL_KERNELS							# }
429.endif	# KERNELS_DONE							# }
430
431build_kernels: ${_KERNELS_TO_BUILD}
432
433# build_kernelsets --
434#	Create kernel sets from ${KERNEL_SETS} into
435#	${RELEASEDIR}/${MACHINE}/binary/sets
436#
437.for configfile in ${KERNEL_SETS}					# {
438_KERNELSETS_TO_BUILD+=kernset-${configfile}
439kernset-${configfile}:
440	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \
441	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
442	kernsuffixes="${KERNEL_SUFFIXES}"; \
443	cd $${kerndir} && ( \
444		echo "/set uname=${BINOWN} gname=${BINGRP}"; \
445		echo ". type=dir optional"; \
446		for kernel in $${kernlist}; do \
447			echo "./$${kernel} type=file"; \
448			for s in $${kernsuffixes}; do \
449				if [ -f $${kernel}.$${s} ]; then \
450					echo "./$${kernel}.$${s} type=file"; \
451				fi; \
452			done; \
453		done ) | GZIP=-9 ${PAX} -O -zw \
454		    -M -N ${NETBSDSRCDIR}/etc \
455		    -f ${RELEASEDIR}/${MACHINE}/binary/sets/kern-${configfile}.tgz
456.endfor	# KERNEL_SETS							# }
457
458build_kernelsets: ${_KERNELSETS_TO_BUILD}
459
460# build_releasekernels --
461#	Build kernel.gz from ${KERNEL_SETS} ${EXTRA_KERNELS} into
462#	${RELEASEDIR}/${MACHINE}/binary/kernel
463#
464.for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS}			# {
465_RELEASEKERNELS_TO_BUILD+=releasekern-${configfile}
466releasekern-${configfile}:
467	kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \
468	kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
469	kernsuffixes="${KERNEL_SUFFIXES}"; \
470	cd $${kerndir} &&	\
471		gziplist=`for kernel in $${kernlist}; do \
472			echo "$${kernel}"; \
473			for s in $${kernsuffixes}; do \
474				if [ -f $${kernel}.$${s} ]; then \
475					echo "$${kernel}.$${s}"; \
476				fi; \
477			done; \
478		done`; \
479		for kernel in $${gziplist} ; do \
480		gzip -c -9 < $${kernel} > \
481		    ${RELEASEDIR}/${MACHINE}/binary/kernel/$${kernel}-${configfile:C/.*\///}.gz ; done
482.endfor	# KERNEL_SETS EXTRA_KERNELS					# }
483
484build_releasekernels: ${_RELEASEKERNELS_TO_BUILD}
485
486# snap_kern --
487#	build the kernels, then the sets & release kernels
488#
489snap_kern: check_DESTDIR check_RELEASEDIR .WAIT \
490	    build_kernels .WAIT \
491	    build_kernelsets build_releasekernels
492
493.endif # !target(snap_kern)					# }
494
495
496# snap_md_post --
497#	Machine dependent distribution media operations.
498#	Overridden by etc.$MACHINE/Makefile.inc
499#
500snap_md_post: check_DESTDIR check_RELEASEDIR
501#	(empty -- look in the machine-dependent Makefile.inc)
502
503
504clean:
505	-rm -rf ${CDROM.dir} ${CDROM.pathlist}
506
507.include <bsd.prog.mk>
508