Makefile.cats.inc revision 1.21
1#	$NetBSD: Makefile.cats.inc,v 1.21 2008/06/07 19:22:43 he Exp $
2
3MACHINE_ARCH=	arm
4CPPFLAGS+=	-D${MACHINE}
5
6.if (${OBJECT_FMT} == "ELF")
7
8.if defined(ABLEELF) && (${ABLEELF} == "1")
9# use a standard ELF format, adjusted to align areas
10LINKFLAGS=	-T ${THISARM}/conf/ldscript.elf
11
12.else
13# Need to convert the kernel from ELF to a.out so that the firmware
14# can load it.
15
16LINKFLAGS=	-T ldscript
17
18SYSTEM_LD_HEAD_EXTRA+=; \
19	( cat ${ARM}/conf/kern.ldscript.head ; \
20	  OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
21		${SYSTEM_OBJ} ; \
22	  cat ${ARM}/conf/kern.ldscript.tail ) > ldscript
23
24SYSTEM_LD_TAIL_EXTRA+=; \
25	echo \
26	 "${OBJCOPY} -O a.out-arm-netbsd \
27		-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
28		-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
29		-R .debug_frame -R .debug_loc -R .debug_pubnames \
30		-R .debug_aranges \
31		$@ $@.aout"; \
32	${OBJCOPY} -O a.out-arm-netbsd \
33		-R .ident -R .arm.atpcs -R .comment -R .note.netbsd.ident \
34		-R .debug_abbrev -R .debug_info -R .debug_line -R .debug_str \
35		-R .debug_frame -R .debug_loc -R .debug_pubnames \
36		-R .debug_aranges \
37		$@ $@.aout
38.endif
39.endif
40