ARM7LD arm-linux-gnu-ld ARM7CC arm-linux-gnu-gcc OBJCOPY arm-linux-gnu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ARM7LD = arm-linux-gnu-ld
ARM7CC = arm-linux-gnu-gcc
OBJCOPY = arm-linux-gnu-objcopy
CFLAGS = -c -g3 -Wall -mlittle-endian
CC = $(ARM7CC)
# text = location of the machine code
# data = location of the static RAM
# bss = location of the non-zero data (in RAM)
#
FIXADDR = -Ttext 0x0 -Tdata 0x40000000 -Tbss 0x40001000
all: code.hex
burn:
lpc21isp -PHILIPSARM code.hex /dev/ttyS0 19200 14745
clean:
rm -f *.o code.* core .depend *~
code.hex: code.elf
@$(OBJCOPY) -v -O ihex --remove-section ".comment" code.elf code.hex
code.elf: main.o startup.o
$(ARM7LD) -EL -static $(FIXADDR) -Map code.map \
-o code.elf startup.o main.o
startup.o: startup.S
$(ARM7CC) $(CFLAGS) -c startup.S -mlittle-endian