comparison gcc/makefile-body @ 8:727914266f28

gcc: adapted from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 15 May 2020 03:13:51 +0000
parents
children
comparison
equal deleted inserted replaced
7:d0c841cb75c7 8:727914266f28
1 CC= arm-elf-gcc
2 LD= arm-elf-ld
3 OBJCOPY=arm-elf-objcopy
4
5 CFLAGS= -mthumb-interwork
6
7 LIBC_A= `${CC} -print-file-name=libc.a -mthumb-interwork`
8 LIBGCC_A= `${CC} -print-file-name=libgcc.a -mthumb-interwork`
9 LIBM_T= `${CC} -print-file-name=libm.a -mthumb-interwork -mthumb`
10
11 all: ramimage.srec
12
13 ${SUBDIR}: FRC
14 cd $@; ${MAKE} ${MFLAGS}
15
16 ${LIBS}: ${SUBDIR}
17 @true
18
19 bootentry.o: ../src/cs/system/main/gcc/bootentry.S
20 ${CC} -c -o $@ ${CFLAGS} -DXRAM -Iconfig -I../src/nucleus/gcc $<
21
22 ramvecs.o: ../src/cs/system/main/gcc/ramvecs.S
23 ${CC} -c ${CFLAGS} $<
24
25 ramimage.ld: ../gcc/xram.m4 ../gcc/memlimits.m4 ../gcc/ld-script.src
26 m4 $^ > $@
27
28 ramimage.elf: ${LIBS} bootentry.o ramvecs.o ramimage.ld
29 ${LD} -N -T ramimage.ld -o $@ -Map ramimage.map bootentry.o ramvecs.o \
30 --start-group ${LIBS} --end-group \
31 ${LIBM_T} ${LIBC_A} ${LIBGCC_A}
32
33 ramimage.srec: ramimage.elf
34 ${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
35
36 clean: FRC
37 rm -f fwimage.* ramimage.* bootentry*.o ramvecs.o
38 rm -f build_date.* flash-script
39 for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done
40
41 FRC: