annotate gcc/makefile-body @ 14:4f94a09e0a6a

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