Makefile revision 1.2
1#	$NetBSD: Makefile,v 1.2 2002/02/13 06:01:36 gmcgarry Exp $
2
3TOP=	${.CURDIR}/..
4
5.include <bsd.kernobj.mk>
6.include <bsd.own.mk>
7
8RAMDISKS=	RAMDISK	ramdisk
9
10.for V F in ${RAMDISKS}
11${V}!=		cd ${TOP}/${F}/; \
12	        printf "xxx: .MAKE\n\t@echo \$${.OBJDIR}/${F}.fs\n" | \
13		${MAKE} -s -f-
14.endfor
15
16#	create netbsd.*.gz targets
17#
18#	TARGETS is a list of:
19#		KERNEL_name	fs-image	"nocluster" disables clustering
20#
21TARGETS=	RAMDISK		${RAMDISK}	-
22
23.for K R E in ${TARGETS}
24_E:=${E}			# work around obscure issue in make(1)
25KERNELS+=	netbsd.${K}.gz
26KERNELSYMS+=	netbsd.${K}.symbols
27netbsd.${K}.gz: .NOTMAIN ${KERNOBJDIR}/${K}/netbsd ${R}
28	@echo "Populating ${K} with ${R}"
29	cp ${KERNOBJDIR}/${K}/netbsd netbsd.tmp
30.if ${_E} == "nocluster"
31	gdb --write -batch -x ${.CURDIR}/nocluster.gdb netbsd.tmp </dev/null
32.endif
33	${MDSETIMAGE} -v netbsd.tmp ${R}
34	${NM} netbsd.tmp > netbsd.${K}.symbols
35	${STRIP} netbsd.tmp
36	gzip -9 netbsd.tmp
37	mv netbsd.tmp.gz ${.TARGET}
38.endfor
39
40#	do the work
41#
42all: ${KERNELS}
43
44release:
45	-mkdir -p ${RELEASEDIR}/binary/kernel
46	cp -p ${KERNELS} ${KERNELSYMS} ${RELEASEDIR}/binary/kernel
47
48clean cleandir distclean:
49	rm -f *.core netbsd.tmp ${KERNELS} ${KERNELSYMS}
50
51.include <bsd.obj.mk>
52.include <bsd.prog.mk>
53