annotate gcc/makefile-body @ 93:26237514cae7

configure-gcc.sh: created
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 21 Jul 2018 00:32:56 +0000
parents 081dd22ca6a2
children e5cbc745543b
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
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 LIBC_A= `${CC} -print-file-name=libc.a -mthumb-interwork`
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 LIBGCC_A= `${CC} -print-file-name=libgcc.a -mthumb-interwork`
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 LIBM_T= `${CC} -print-file-name=libc.a -mthumb-interwork -mthumb`
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 all: fwimage.bin flash-script
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 ram: ramimage.srec
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 ${SUBDIR}: FRC
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 cd $@; ${MAKE} ${MFLAGS}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 ${LIBS}: ${SUBDIR}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 @true
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 bootentry-flash.o: ../src/cs/system/main/gcc/bootentry.S
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 ${CC} -c -mthumb-interwork -DFLASH -Iconfig -I../src/nucleus/gcc $<
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 bootentry-xram.o: ../src/cs/system/main/gcc/bootentry.S
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 ${CC} -c -mthumb-interwork -DXRAM -Iconfig -I../src/nucleus/gcc $<
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 ramvecs.o: ../src/cs/system/main/gcc/ramvecs.S
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 ${CC} -c -mthumb-interwork $<
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 build_date.c: ${LIBS} bootentry-flash.o bootentry-xram.o ramvecs.o
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 ../helpers/build-date gcc > $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 build_date.o: build_date.c
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 ${CC} -c -mthumb-interwork build_date.c
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 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
34 m4 $^ > $@
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.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
37 ${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
38 ramvecs.o build_date.o --start-group ${LIBS} --end-group \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 ${LIBM_T} ${LIBC_A} ${LIBGCC_A}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 fwimage.bin: fwimage.elf
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 ${OBJCOPY} -O binary $< $@
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 flash-script: fwimage.bin
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 ../helpers/mk-flash-script $< ${FLASH_BASE_ADDR} ${FLASH_SECTOR_SIZE} \
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
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 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
49 m4 $^ > $@
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.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
52 ${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
53 ramvecs.o build_date.o --start-group ${LIBS} --end-group \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 ${LIBM_T} ${LIBC_A} ${LIBGCC_A}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 ramimage.srec: ramimage.elf
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 ${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
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 clean: FRC
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 rm -f fwimage.* ramimage.* bootentry-*.o ramvecs.o
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 rm -f build_date.* flash-script
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 FRC: