view gsm-fw/finlink/Makefile @ 489:2a26785fb5a2

gsm-fw: GPF included in the build with feature gpf, link successful
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 29 Jun 2014 22:37:29 +0000
parents 083f262b7bbe
children 06ab60fec942
line wrap: on
line source

CC=	arm-elf-gcc
LD=	arm-elf-ld
OBJCOPY=arm-elf-objcopy

RAM_TARGET=	ramImage.srec

LIBC_A=		`${CC} -print-file-name=libc.a -mthumb-interwork`
LIBC_T=		`${CC} -print-file-name=libc.a -mthumb-interwork -mthumb`
LIBGCC_A=	`${CC} -print-file-name=libgcc.a -mthumb-interwork`
LIBGCC_T=	`${CC} -print-file-name=libgcc.a -mthumb-interwork -mthumb`

sinclude ../include/config.mk

LOCAL_LIBS=	../riviera/librv.a ../nucleus/libplus.xip.a \
		../nucleus/libplus.iram.a ../sprintf/libsprintf.a
COND_LOCAL_LIBS=

ifeq (${CONFIG_GPF},1)
COND_LOCAL_LIBS+=	--start-group ../gpf/libs/libgpf.xip.a \
				../gpf/libs/libgpf.iram.a --end-group
endif

INT_PIECES=	../bsp/niq32.o
EXT_PIECES=	../bsp/xipcode.o ../serial/xipcode.o ../sysglue/xipcode.o \
		../services/ffs/xipcode.o ../services/dar/xipcode.o
ifeq (${CONFIG_GPF},1)
EXT_PIECES+=	../gpf/conf/xipcode.o
endif
ifeq (${RVM_ETM_SWE},1)
EXT_PIECES+=	../services/etm/xipcode.o
endif

all:		${RAM_TARGET}
ramImage:	${RAM_TARGET}

iramcode.o:	${INT_PIECES}
	${LD} -r -o $@ ${INT_PIECES}

xipcode.o:	${EXT_PIECES}
	${LD} -r -o $@ ${EXT_PIECES}

flashImage.ld:	ld-script.src flash.m4 ../include/config.m4
	m4 flash.m4 ld-script.src > $@

ramImage.ld:	ld-script.src xram.m4 ../include/config.m4
	m4 xram.m4 ld-script.src > $@

ramImage.elf:	iramcode.o xipcode.o ${LOCAL_LIBS} ramImage.ld
	${LD} -N -T ramImage.ld -o $@ -Map ramImage.map iramcode.o xipcode.o \
		${COND_LOCAL_LIBS} ${LOCAL_LIBS} \
		--start-group ${LIBC_A} ${LIBGCC_A} --end-group

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

clean:
	rm -f *.o *errs *core *.elf *.bin *.srec *.ld *.map

FRC: