comparison loadagent/Makefile @ 6:5eaafa83be60

loadagent: generate binary and srec images
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 29 Apr 2013 19:30:43 +0000
parents 4a7a325ed1b6
children
comparison
equal deleted inserted replaced
5:4a7a325ed1b6 6:5eaafa83be60
1 CC= arm-elf-gcc 1 CC= arm-elf-gcc
2 CFLAGS= -Os -fno-builtin 2 CFLAGS= -Os -fno-builtin
3 LD= arm-elf-ld 3 LD= arm-elf-ld
4 OBJCOPY=arm-elf-objcopy
4 5
5 OBJS= crt0.o main.o serio.o serwait.o 6 OBJS= crt0.o main.o serio.o serwait.o
6 PRINTF= libprintf/libprintf.a 7 PRINTF= libprintf/libprintf.a
7 8
8 TC_LIBS=`${CC} -print-file-name=libc.a` \ 9 TC_LIBS=`${CC} -print-file-name=libc.a` \
9 `${CC} -print-file-name=libgcc.a` 10 `${CC} -print-file-name=libgcc.a`
10 11
11 all: loadagent.elf 12 all: loadagent.bin loadagent.srec
12 13
13 loadagent.elf: ${OBJS} ${PRINTF} loadagent.lds 14 loadagent.elf: ${OBJS} ${PRINTF} loadagent.lds
14 ${LD} -N -T loadagent.lds -o $@ ${OBJS} ${PRINTF} \ 15 ${LD} -N -T loadagent.lds -o $@ ${OBJS} ${PRINTF} \
15 --start-group ${TC_LIBS} --end-group 16 --start-group ${TC_LIBS} --end-group
17
18 loadagent.bin: loadagent.elf
19 ${OBJCOPY} -O binary $< $@
20
21 loadagent.srec: loadagent.elf
22 ${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
16 23
17 ${PRINTF}: FRC 24 ${PRINTF}: FRC
18 cd libprintf; make ${MFLAGS} 25 cd libprintf; make ${MFLAGS}
19 26
20 clean: 27 clean: