splash.mk revision 1.5
1# $NetBSD: splash.mk,v 1.5 2015/09/15 00:16:42 uebayasi Exp $
2
3# Makefile for embedding splash image into kernel.
4.include <bsd.endian.mk>
5
6.if (${OBJECT_FMTS:Melf64})
7BFD_ELFTARGET=elf64
8.else
9BFD_ELFTARGET=elf32
10.endif
11
12BFD_ENDIANNESS=${TARGET_ENDIANNESS:S/1234/little/C/4321/big/}
13BFD_CPU=${MACHINE_CPU:S/_/-/}
14
15.if (${BFD_CPU:Maarch64} || ${BFD_CPU:Marm} || ${BFD_CPU:Mmips} || ${BFD_CPU:Mscore})
16BFD_TARGET=${BFD_ELFTARGET}-${BFD_ENDIANNESS}${BFD_CPU}
17.else
18BFD_TARGET=${BFD_ELFTARGET}-${BFD_CPU}
19.endif
20
21.if defined(SPLASHSCREEN_IMAGE)
22splash_image.o:	${SPLASHSCREEN_IMAGE}
23	cp ${SPLASHSCREEN_IMAGE} splash.image
24	${OBJCOPY} -I binary -B ${MACHINE_CPU:C/x86_64/i386/} \
25		-O ${BFD_TARGET} splash.image splash_image.o
26	rm splash.image
27.else
28splash_image.c:
29	echo > $@
30.endif
31