diff nuc-fw/finlink/Makefile @ 92:f459043fae0c

nuc-fw config: ld script generation implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 25 Aug 2013 21:20:20 +0000
parents 147861b15cda
children 789a9a95533f
line wrap: on
line diff
--- a/nuc-fw/finlink/Makefile	Sun Aug 25 20:13:24 2013 +0000
+++ b/nuc-fw/finlink/Makefile	Sun Aug 25 21:20:20 2013 +0000
@@ -24,8 +24,14 @@
 xipcode.o:	${EXT_PIECES}
 	${LD} -r -o $@ ${EXT_PIECES}
 
-ramImage.elf:	iramcode.o xipcode.o ${LOCAL_LIBS} xram.lds
-	${LD} -N -T xram.lds -o $@ -Map ramImage.map iramcode.o xipcode.o \
+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 \
 		--start-group ${LOCAL_LIBS} --end-group \
 		--start-group ${LIBC_A} ${LIBGCC_A} --end-group
 
@@ -33,6 +39,6 @@
 	${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
 
 clean:
-	rm -f *.o *errs *core *.elf *.bin *.srec
+	rm -f *.o *errs *core *.elf *.bin *.srec *.ld *.map
 
 FRC: