annotate gcc/makefile-body @ 106:5ba0bee90efa

build system: new configuration naming mechanism
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 23 Jul 2018 16:38:50 +0000
parents e5cbc745543b
children 767c75e3d2f2
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
106
5ba0bee90efa build system: new configuration naming mechanism
Mychaela Falconia <falcon@freecalypso.org>
parents: 94
diff changeset
30 ../helpers/build-date ${CONFIG_NAME} > $@
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 build_date.o: build_date.c
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
33 ${CC} -c ${CFLAGS} build_date.c
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 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
36 m4 $^ > $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 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
39 ${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
40 ramvecs.o build_date.o --start-group ${LIBS} --end-group \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 ${LIBM_T} ${LIBC_A} ${LIBGCC_A}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 fwimage.bin: fwimage.elf
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 ${OBJCOPY} -O binary $< $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 flash-script: fwimage.bin
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 ../helpers/mk-flash-script $< ${FLASH_BASE_ADDR} ${FLASH_SECTOR_SIZE} \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 > $@
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 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
51 m4 $^ > $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 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
54 ${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
55 ramvecs.o build_date.o --start-group ${LIBS} --end-group \
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 ${LIBM_T} ${LIBC_A} ${LIBGCC_A}
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 ramimage.srec: ramimage.elf
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 ${OBJCOPY} -O srec --srec-forceS3 --srec-len=30 $< $@
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 clean: FRC
94
e5cbc745543b gcc/makefile-body: a few fixes
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
62 rm -f fwimage.* ramimage.* bootentry*.o ramvecs.o
91
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 rm -f build_date.* flash-script
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 for i in ${SUBDIR}; do (cd $$i; ${MAKE} ${MFLAGS} clean); done
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65
081dd22ca6a2 gcc/makefile-body: created
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 FRC: