blob: 912dce291b40c9184d57008eac3cc7e68fc8bf7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# $NetBSD: Makefile,v 1.6 2022/09/25 21:19:20 ryo Exp $
S = ${.CURDIR}/../../../..
TOOLDIR ?= /usr/pkg/cross-arm-none-eabi
CC = ${TOOLDIR}/bin/arm-none-eabi-gcc
OBJCOPY = ${TOOLDIR}/bin/arm-none-eabi-objcopy
CFLAGS = -W -Wall -mlittle-endian
CFLAGS += -O3 -mcpu=arm7
CFLAGS += -fomit-frame-pointer -funroll-loops -finline-functions
CFLAGS += -I${S}
all: aica_armcode.h
aica_armcode.h: aica_armcode.elf
${OBJCOPY} -O binary aica_armcode.elf aica_armcode.bin
echo '/* $$'NetBSD'$$ */' > ${.TARGET}.tmp
echo 'static uint32_t aica_armcode[] = {' >> ${.TARGET}.tmp
hexdump -v -e '" /* %04.4_ax */\t" 1/4 "0x%08x, " "\n"' \
aica_armcode.bin >> ${.TARGET}.tmp
echo ' 0 };' >> ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
aica_armcode.elf: aica_arm_locore.o aica_arm.o
${CC} ${CFLAGS} -Wl,-Ttext,0 -Wl,-T ldscript -nostdlib -e 0 \
-o aica_armcode.elf aica_arm_locore.o aica_arm.o
clean: clean-tmp
# rm -f aica_armcode.h
clean-tmp:
rm -f *.o aica_armcode.elf aica_armcode.bin aica_armcode.h.tmp
|