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