1# $NetBSD: Makefile,v 1.4 2006/03/04 02:00:16 uwe Exp $ 2 3S = ${.CURDIR}/../../../.. 4 5CC = ${TOOLDIR}/bin/arm--netbsdelf-gcc 6OBJCOPY = ${TOOLDIR}/bin/arm--netbsdelf-objcopy 7 8CFLAGS = -W -Wall -mlittle-endian 9CFLAGS += -O3 -mcpu=arm7tdmi 10CFLAGS += -fomit-frame-pointer -funroll-loops -finline-functions 11CFLAGS += -I${S} 12#AFLAGS = -mcpu=arm7tdmi -mthumb -mthumb-interwork -mapcs-32 13 14all: aica_armcode.h 15 16aica_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} 24 25aica_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 28 29clean: clean-tmp 30# rm -f aica_armcode.h 31 32clean-tmp: 33 rm -f *.o aica_armcode.elf aica_armcode.bin aica_armcode.h.tmp 34 35