changeset 94:e5cbc745543b

gcc/makefile-body: a few fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 21 Jul 2018 01:03:53 +0000
parents 26237514cae7
children a23e6e011264
files gcc/makefile-body
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gcc/makefile-body	Sat Jul 21 00:32:56 2018 +0000
+++ b/gcc/makefile-body	Sat Jul 21 01:03:53 2018 +0000
@@ -2,9 +2,11 @@
 LD=	arm-elf-ld
 OBJCOPY=arm-elf-objcopy
 
+CFLAGS=	-mthumb-interwork
+
 LIBC_A=		`${CC} -print-file-name=libc.a -mthumb-interwork`
 LIBGCC_A=	`${CC} -print-file-name=libgcc.a -mthumb-interwork`
-LIBM_T=		`${CC} -print-file-name=libc.a -mthumb-interwork -mthumb`
+LIBM_T=		`${CC} -print-file-name=libm.a -mthumb-interwork -mthumb`
 
 all:	fwimage.bin flash-script
 ram:	ramimage.srec
@@ -16,19 +18,19 @@
 	@true
 
 bootentry-flash.o:	../src/cs/system/main/gcc/bootentry.S
-	${CC} -c -mthumb-interwork -DFLASH -Iconfig -I../src/nucleus/gcc $<
+	${CC} -c -o $@ ${CFLAGS} -DFLASH -Iconfig -I../src/nucleus/gcc $<
 
 bootentry-xram.o:	../src/cs/system/main/gcc/bootentry.S
-	${CC} -c -mthumb-interwork -DXRAM -Iconfig -I../src/nucleus/gcc $<
+	${CC} -c -o $@ ${CFLAGS} -DXRAM -Iconfig -I../src/nucleus/gcc $<
 
 ramvecs.o:	../src/cs/system/main/gcc/ramvecs.S
-	${CC} -c -mthumb-interwork $<
+	${CC} -c ${CFLAGS} $<
 
-build_date.c:	${LIBS} bootentry-flash.o bootentry-xram.o ramvecs.o
+build_date.c:	${LIBS} bootentry-flash.o bootentry-xram.o ramvecs.o Makefile
 	../helpers/build-date gcc > $@
 
 build_date.o:	build_date.c
-	${CC} -c -mthumb-interwork build_date.c
+	${CC} -c ${CFLAGS} build_date.c
 
 fwimage.ld:	../targets/${TARGET}.m4 ../gcc/flash.m4 ../gcc/ld-script.src
 	m4 $^ > $@
@@ -57,7 +59,7 @@
 	${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
 
 clean:	FRC
-	rm -f fwimage.* ramimage.* bootentry-*.o ramvecs.o
+	rm -f fwimage.* ramimage.* bootentry*.o ramvecs.o
 	rm -f build_date.* flash-script
 	for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done