diff target-utils/helloapp/Makefile @ 516:8bdbae4c0e53

target-utils/helloapp: build boot-ROM-based and fixed-UART versions
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 29 May 2019 05:40:51 +0000
parents 58d3a0634272
children bfddfecc52b2
line wrap: on
line diff
--- a/target-utils/helloapp/Makefile	Wed May 29 05:05:25 2019 +0000
+++ b/target-utils/helloapp/Makefile	Wed May 29 05:40:51 2019 +0000
@@ -4,24 +4,36 @@
 LD=	arm-elf-ld
 OBJCOPY=arm-elf-objcopy
 
-PROG=	helloapp
-OBJS=	crt0.o cmdtab.o main.o mygetchar.o
+BOOTROM_OBJS=	crt0.o cmdtab.o main-bootrom.o mygetchar.o
+IRDA_OBJS=	crt0.o cmdtab.o main-fixeduart.o mygetchar.o uartbase-irda.o
+MODEM_OBJS=	crt0.o cmdtab.o main-fixeduart.o mygetchar.o uartbase-modem.o
+
 LIBS=	../libcommon/libcommon.a ../libprintf/libprintf.a ../libbase/libbase.a \
 	../libc/libc.a
 LIBGCC=	`${CC} -print-file-name=libgcc.a`
 LDS=	../env/iram.lds
 
-all:	${PROG}.srec
+all:	helloapp-bootrom.srec helloapp-irda.srec helloapp-modem.srec
+
+.SUFFIXES: .elf .srec
+
+.elf.srec:
+	${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
 
 crt0.S:
 	ln -s ../env/crt0.S .
 
-${PROG}.elf:	${OBJS} ${LIBS} ${LDS}
+helloapp-bootrom.elf:	${BOOTROM_OBJS} ${LIBS} ${LDS}
 	${LD} -N --defsym Base_addr=0x800750 --defsym stack_bottom=0x83FFFC \
-		-T ${LDS} -o $@ ${OBJS} ${LIBS} ${LIBGCC}
+		-T ${LDS} -o $@ ${BOOTROM_OBJS} ${LIBS} ${LIBGCC}
 
-${PROG}.srec:	${PROG}.elf
-	${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
+helloapp-irda.elf:	${IRDA_OBJS} ${LIBS} ${LDS}
+	${LD} -N --defsym Base_addr=0x820000 --defsym stack_bottom=0x83FFFC \
+		-T ${LDS} -o $@ ${IRDA_OBJS} ${LIBS} ${LIBGCC}
+
+helloapp-modem.elf:	${MODEM_OBJS} ${LIBS} ${LDS}
+	${LD} -N --defsym Base_addr=0x820000 --defsym stack_bottom=0x83FFFC \
+		-T ${LDS} -o $@ ${MODEM_OBJS} ${LIBS} ${LIBGCC}
 
 clean:
 	rm -f *.o *errs *core *.elf *.bin *.srec crt0.S