view 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
line wrap: on
line source

CC=	arm-elf-gcc
CFLAGS=	-Os -fno-builtin
LD=	arm-elf-ld
OBJCOPY=arm-elf-objcopy

OBJS=	crt0.o main.o serio.o serwait.o
PRINTF=	libprintf/libprintf.a

TC_LIBS=`${CC} -print-file-name=libc.a` \
	`${CC} -print-file-name=libgcc.a`

all:	loadagent.bin loadagent.srec

loadagent.elf:	${OBJS} ${PRINTF} loadagent.lds
	${LD} -N -T loadagent.lds -o $@ ${OBJS} ${PRINTF} \
		--start-group ${TC_LIBS} --end-group

loadagent.bin:	loadagent.elf
	${OBJCOPY} -O binary $< $@

loadagent.srec:	loadagent.elf
	${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@

${PRINTF}:	FRC
	cd libprintf; make ${MFLAGS}

clean:
	rm -f *.o *errs *core *.elf *.bin *.srec
	cd libprintf; make clean

FRC: