xref: /netbsd-src/distrib/ews4800mips/floppies/instkernel/Makefile (revision 98121728dfd8e2716e21f80fd533318f48e44eab)
1#	$NetBSD: Makefile,v 1.9 2020/06/14 05:10:33 tsutsui Exp $
2
3.include <bsd.own.mk>
4.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
5
6RAMDISKDIR!=	cd ${.CURDIR}/../ramdisk && ${PRINTOBJDIR}
7RAMDISK=	${RAMDISKDIR}/ramdisk.fs
8
9MDSETTARGETS=		RAMDISK ${RAMDISK} -
10MDSET_RELEASEDIR=	binary/kernel
11MDSET_STRIPSECTIONS=	-R .MIPS.abiflags -R .gnu.attributes -R .pdr -R .reginfo
12
13.include "${DISTRIBDIR}/common/Makefile.mdset"
14
15BOOT_RAMDISK=		boot-RAMDISK
16BOOT_RELEASEDIR=	installation/boot
17
18all realall:	${BOOT_RAMDISK}.gz
19
20${BOOT_RAMDISK}.gz:	netbsd-RAMDISK.gz ${DESTDIR}/usr/mdec/boot_kernel.gz
21	@echo "Creating a bootloader binary with embedded RAMDISK kernel"
22	gunzip -c ${DESTDIR}/usr/mdec/boot_kernel.gz > ${BOOT_RAMDISK}.tmp
23	${TOOL_MDSETIMAGE} -v ${BOOT_RAMDISK}.tmp netbsd-RAMDISK.gz
24	${MIPS_ELF2ECOFF} ${BOOT_RAMDISK}.tmp ${BOOT_RAMDISK}.coff
25	${TOOL_GZIP_N} -9c ${BOOT_RAMDISK}.coff > ${.TARGET}
26
27CLEANFILES+=	${BOOT_RAMDISK}.tmp ${BOOT_RAMDISK}.coff ${BOOT_RAMDISK}.gz
28
29release::	check_RELEASEDIR .WAIT ${BOOT_RAMDISK}.gz
30	${RELEASE_INSTALL} ${BOOT_RAMDISK}.gz \
31	    ${RELEASEDIR}/${RELEASEMACHINEDIR}/${BOOT_RELEASEDIR}
32
33.include <bsd.prog.mk>
34