1 # $NetBSD: Makefile,v 1.3 2005/12/11 12:17:06 christos Exp $
3 S
= ${.CURDIR
}/..
/..
/..
/..
5 CC
= ${TOOLDIR}/bin
/arm--netbsdelf-gcc
6 OBJCOPY
= ${TOOLDIR}/bin
/arm--netbsdelf-objcopy
8 CFLAGS
= -W
-Wall
-mlittle-endian
9 CFLAGS
+= -O3
-mcpu
=arm7tdmi
10 CFLAGS
+= -fomit-frame-pointer
-funroll-loops
-finline-functions
12 #AFLAGS = -mcpu=arm7tdmi -mthumb -mthumb-interwork -mapcs-32
16 aica_armcode.h
: aica_armcode.elf
17 ${OBJCOPY} -O binary aica_armcode.elf aica_armcode.bin
18 echo
'/* $$'NetBSD
'$$ */' > ${.TARGET
}.tmp
19 echo
'static uint32_t aica_armcode[] = {' >> ${.TARGET
}.tmp
20 hexdump
-v
-e
'" /* %04.4_ax */\t" 1/4 "0x%08x, " "\n"' \
21 aica_armcode.bin
>> ${.TARGET
}.tmp
22 echo
' 0 };' >> ${.TARGET
}.tmp
23 mv
${.TARGET
}.tmp
${.TARGET
}
25 aica_armcode.elf
: aica_arm_locore.o aica_arm.o
26 ${CC} ${CFLAGS} -Wl
,-Ttext
,0 -Wl
,-T ldscript
-nostdlib
-e
0 \
27 -o aica_armcode.elf aica_arm_locore.o aica_arm.o
30 # rm -f aica_armcode.h
33 rm -f
*.o aica_armcode.elf aica_armcode.bin aica_armcode.h.tmp