diff gsm-fw/finlink/Makefile @ 490:06ab60fec942

gsm-fw/gpf/tst_pei/tst_pei.c: use FFS_O_RDONLY when reading tracemask file gsm-fw/finlink/Makefile: proper dependency logic for GPF libraries
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 30 Jun 2014 05:04:35 +0000
parents 2a26785fb5a2
children 3b4dce7dac06
line wrap: on
line diff
--- a/gsm-fw/finlink/Makefile	Sun Jun 29 22:37:29 2014 +0000
+++ b/gsm-fw/finlink/Makefile	Mon Jun 30 05:04:35 2014 +0000
@@ -11,15 +11,19 @@
 
 sinclude ../include/config.mk
 
-LOCAL_LIBS=	../riviera/librv.a ../nucleus/libplus.xip.a \
+BASE_LIBS=	../riviera/librv.a ../nucleus/libplus.xip.a \
 		../nucleus/libplus.iram.a ../sprintf/libsprintf.a
-COND_LOCAL_LIBS=
+LIB_DEPEND=	${BASE_LIBS}
 
 ifeq (${CONFIG_GPF},1)
-COND_LOCAL_LIBS+=	--start-group ../gpf/libs/libgpf.xip.a \
-				../gpf/libs/libgpf.iram.a --end-group
+GPF_LIBS=	../gpf/libs/libgpf.xip.a ../gpf/libs/libgpf.iram.a
+LIB_LINK_ORDER+=	--start-group ${GPF_LIBS} --end-group
+LIB_DEPEND+=	${GPF_LIBS}
 endif
 
+LIB_LINK_ORDER+=	${BASE_LIBS}
+LIB_LINK_ORDER+=	--start-group ${LIBC_A} ${LIBGCC_A} --end-group
+
 INT_PIECES=	../bsp/niq32.o
 EXT_PIECES=	../bsp/xipcode.o ../serial/xipcode.o ../sysglue/xipcode.o \
 		../services/ffs/xipcode.o ../services/dar/xipcode.o
@@ -45,10 +49,9 @@
 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
+ramImage.elf:	iramcode.o xipcode.o ${LIB_DEPEND} 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
+		${LIB_LINK_ORDER}
 
 ramImage.srec:	ramImage.elf
 	${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@