changeset 5:4a7a325ed1b6

loadagent: printf hooked in
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 29 Apr 2013 17:53:54 +0000
parents 5c7b3d5d5702
children 5eaafa83be60
files loadagent/Makefile loadagent/main.c
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/loadagent/Makefile	Mon Apr 29 07:19:34 2013 +0000
+++ b/loadagent/Makefile	Mon Apr 29 17:53:54 2013 +0000
@@ -3,15 +3,22 @@
 LD=	arm-elf-ld
 
 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.elf
 
-loadagent.elf:	${OBJS} loadagent.lds
-	${LD} -N -T loadagent.lds -o $@ ${OBJS} \
+loadagent.elf:	${OBJS} ${PRINTF} loadagent.lds
+	${LD} -N -T loadagent.lds -o $@ ${OBJS} ${PRINTF} \
 		--start-group ${TC_LIBS} --end-group
 
+${PRINTF}:	FRC
+	cd libprintf; make ${MFLAGS}
+
 clean:
 	rm -f *.o *errs *core *.elf *.bin *.srec
+	cd libprintf; make clean
+
+FRC:
--- a/loadagent/main.c	Mon Apr 29 07:19:34 2013 +0000
+++ b/loadagent/main.c	Mon Apr 29 17:53:54 2013 +0000
@@ -33,13 +33,11 @@
 main()
 {
 	uart_select_init();
-#if 0
 	printf("FreeCalypso loadagent running\n");
 	printf("Loaded via UART %d (%s) at baud rate #%d\n", rom_vars.uart_id,
 		uart_name, rom_vars.baud_rate_code);
 	printf("TCXO clock input autodetected to be %d MHz\n",
 		rom_vars.clktcxo_13mhz ? 13 : 26);
-#endif
 	/* interactive command mode to be implemented */
 	while (1)
 		;