11.37Srin#	$NetBSD: Makefile.cats.inc,v 1.37 2023/07/26 02:31:27 rin Exp $
21.13Sthorpej
31.26SmattMACHINE_ARCH?=	arm
41.13SthorpejCPPFLAGS+=	-D${MACHINE}
51.3Schris
61.15Schris.if defined(ABLEELF) && (${ABLEELF} == "1")
71.15Schris# use a standard ELF format, adjusted to align areas
81.32SuebayasiKERNLDSCRIPT=	${THISARM}/conf/ldscript.elf
91.15Schris
101.15Schris.else
111.12Schris# Need to convert the kernel from ELF to a.out so that the firmware
121.5Sthorpej# can load it.
131.3Schris
141.27SskrllCFLAGS+=	-fno-unwind-tables
151.27Sskrll
161.31SskrllLOADADDRESS=	0xF0000020
171.16Schs
181.32SuebayasiKERNLDSCRIPT=	ldscript
191.32SuebayasiEXTRA_CLEAN+=	${KERNLDSCRIPT}
201.32Suebayasi
211.34Suebayasi${KERNLDSCRIPT}: \
221.32Suebayasi    ${ARM}/conf/kern.ldscript.head \
231.32Suebayasi    ${ARM}/conf/kern.ldscript.tail \
241.32Suebayasi    $S/conf/mkldscript.sh \
251.32Suebayasi    ${SYSTEM_OBJ}
261.16Schs	( cat ${ARM}/conf/kern.ldscript.head ; \
271.18Stsutsui	  OBJDUMP=${OBJDUMP} ${HOST_SH} $S/conf/mkldscript.sh \
281.16Schs		${SYSTEM_OBJ} ; \
291.34Suebayasi	  cat ${ARM}/conf/kern.ldscript.tail ) > $@
301.36SchristosSYSTEM_LD_TAIL_EXTRA+=; \
311.36Schristos	echo "${ARM_ELF2AOUT} $@ $@.aout"; \
321.36Schristos	${ARM_ELF2AOUT} $@ $@.aout
331.36Schristos.endif
341.32Suebayasi
35