1#	$NetBSD: Makefile.inc,v 1.21 2010/12/27 03:38:53 christos Exp $
2#
3#	etc.sgimips/Makefile.inc -- sgimips-specific etc Makefile targets
4#
5
6# If you change the list of distributed kernels, don't forget
7# to update the release documentation in distrib/notes/common/contents
8
9.if ${MACHINE_ARCH} == "mipseb"
10SFX=32
11.else
12SFX=64
13.endif
14
15KERNEL_SETS=		GENERIC${SFX}_IP2x GENERIC${SFX}_IP3x
16.if ${MACHINE_ARCH} == "mipseb"
17KERNEL_SETS+=		GENERIC32_IP12
18KERNEL_SUFFIXES=	ecoff
19.endif
20
21#EXTRA_KERNELS=		NETBOOT
22
23BUILD_KERNELS=		INSTALL${SFX}_IP2x INSTALL${SFX}_IP3x
24
25INSTALLATION_DIRS+=	installation/netboot \
26			installation/diskimage
27
28iso-image-md-pre:
29	cp ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel/netbsd-INSTALL${SFX}_IP2x.gz ${RELEASEDIR}/ip2x
30	cp ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/kernel/netbsd-INSTALL${SFX}_IP3x.gz ${RELEASEDIR}/ip3x
31	echo "ip2x/=${RELEASEDIR}/ip2x/" >> ${CDROM.pathlist}
32	echo "ip3x/=${RELEASEDIR}/ip3x/" >> ${CDROM.pathlist}
33
34SGI.image= ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/cdrom/netbsd-sgimips.img
35
36iso-image-md-post:
37	@SEEK=$$(${TOOL_AWK} '/SGI_BOOT_BLOCK_SIZE_VOLHDR/{print $$3}' \
38		${DESTDIR}/usr/include/sys/bootblock.h) ; \
39	EST=$$(ls -l ${CDROM_IMAGE} \
40		| ${TOOL_AWK} '{ s += $$5 } \
41			END { print int(('$${SEEK}'*512+s)/1024/1024/32+1)*32 \
42			}') ; \
43	echo "Estimated image size: $${EST} MB"; \
44	dd if=/dev/zero of=${SGI.image} bs=1024k count=$${EST}; \
45	${TOOLDIR}/bin/nbsgivol -f -i ${SGI.image}; \
46	${TOOLDIR}/bin/nbsgivol -f -w aoutboot ${DESTDIR}/usr/mdec/aoutboot \
47		${SGI.image}; \
48	${TOOLDIR}/bin/nbsgivol -f -w ip2xboot ${DESTDIR}/usr/mdec/ip2xboot \
49		${SGI.image}; \
50	${TOOLDIR}/bin/nbsgivol -f -w ip3xboot ${DESTDIR}/usr/mdec/ip3xboot \
51		${SGI.image}; \
52	dd if=${CDROM_IMAGE} of=${SGI.image} bs=512 seek=$${SEEK}
53	mv ${SGI.image} ${CDROM_IMAGE}
54	rm -f ${RELEASEDIR}/ip2x ${RELEASEDIR}/ip3x
55