annotate gcc/makefile-body @ 192:4f40ae165be4

abb.c & init.c: sync with Magnetite for Luna additions These Luna target-specific additions are conditionalized on CONFIG_TARGET_LUNA, a C preprocessor symbol that will never be defined in Selenite, hence this change has exactly zero impact on FC Selenite. However, they are being pulled in as a sync in order to keep the diff between Magnetite and Selenite to a minimum; keeping this diff to a minimum increases our opportunities for possible evolution of future FC firmwares.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 23 May 2020 07:03:46 +0000
parents 767c75e3d2f2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 CC= arm-elf-gcc
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 LD= arm-elf-ld
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 OBJCOPY=arm-elf-objcopy
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
5 CFLAGS= -mthumb-interwork
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
6
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 LIBC_A= `${CC} -print-file-name=libc.a -mthumb-interwork`
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 LIBGCC_A= `${CC} -print-file-name=libgcc.a -mthumb-interwork`
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
9 LIBM_T= `${CC} -print-file-name=libm.a -mthumb-interwork -mthumb`
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 all: fwimage.bin flash-script
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 ram: ramimage.srec
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 ${SUBDIR}: FRC
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 cd $@; ${MAKE} ${MFLAGS}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 ${LIBS}: ${SUBDIR}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 @true
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 bootentry-flash.o: ../src/cs/system/main/gcc/bootentry.S
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
21 ${CC} -c -o $@ ${CFLAGS} -DFLASH -Iconfig -I../src/nucleus/gcc $<
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 bootentry-xram.o: ../src/cs/system/main/gcc/bootentry.S
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
24 ${CC} -c -o $@ ${CFLAGS} -DXRAM -Iconfig -I../src/nucleus/gcc $<
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 ramvecs.o: ../src/cs/system/main/gcc/ramvecs.S
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
27 ${CC} -c ${CFLAGS} $<
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
29 build_date.c: ${LIBS} bootentry-flash.o bootentry-xram.o ramvecs.o Makefile
146
767c75e3d2f2 gcc/makefile-body: same version ID string additions as
Mychaela Falconia <falcon@freecalypso.org>
parents: 106
diff changeset
30 ../helpers/build-date ${CONFIG_NAME} ${TARGET} \
767c75e3d2f2 gcc/makefile-body: same version ID string additions as
Mychaela Falconia <falcon@freecalypso.org>
parents: 106
diff changeset
31 `../scripts/src-version.sh` > $@
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 build_date.o: build_date.c
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
34 ${CC} -c ${CFLAGS} build_date.c
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 fwimage.ld: ../targets/${TARGET}.m4 ../gcc/flash.m4 ../gcc/ld-script.src
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 m4 $^ > $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 fwimage.elf: ${LIBS} bootentry-flash.o ramvecs.o build_date.o fwimage.ld
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 ${LD} -N -T fwimage.ld -o $@ -Map fwimage.map bootentry-flash.o \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 ramvecs.o build_date.o --start-group ${LIBS} --end-group \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 ${LIBM_T} ${LIBC_A} ${LIBGCC_A}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 fwimage.bin: fwimage.elf
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 ${OBJCOPY} -O binary $< $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 flash-script: fwimage.bin
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 ../helpers/mk-flash-script $< ${FLASH_BASE_ADDR} ${FLASH_SECTOR_SIZE} \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 > $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 ramimage.ld: ../targets/${TARGET}.m4 ../gcc/xram.m4 ../gcc/ld-script.src
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 m4 $^ > $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 ramimage.elf: ${LIBS} bootentry-xram.o ramvecs.o build_date.o ramimage.ld
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 ${LD} -N -T ramimage.ld -o $@ -Map ramimage.map bootentry-xram.o \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 ramvecs.o build_date.o --start-group ${LIBS} --end-group \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 ${LIBM_T} ${LIBC_A} ${LIBGCC_A}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 ramimage.srec: ramimage.elf
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 ${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 clean: FRC
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
63 rm -f fwimage.* ramimage.* bootentry*.o ramvecs.o
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 rm -f build_date.* flash-script
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 FRC: