Root/
| 1 | PREFIX = arm-linux-gnueabi- |
| 2 | |
| 3 | CC = $(PREFIX)gcc |
| 4 | OBJCOPY = $(PREFIX)objcopy |
| 5 | OBJDUMP = $(PREFIX)objdump |
| 6 | |
| 7 | CFLAGS = -Wall -mcpu=cortex-m0 -march=armv6-m -mthumb \ |
| 8 | -nostdlib |
| 9 | LDFLAGS = -Tlpc1112fxx2xx.lds |
| 10 | |
| 11 | OBJS = test.o |
| 12 | |
| 13 | .PHONY: dump clean |
| 14 | |
| 15 | test.bin: test.elf |
| 16 | $(OBJCOPY) -j .text -j .data -O binary $< $@ || \ |
| 17 | { rm -f $@; exit 1; } |
| 18 | |
| 19 | test.elf: $(OBJS) |
| 20 | $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) |
| 21 | |
| 22 | dump: test.elf |
| 23 | $(OBJDUMP) -d test.elf |
| 24 | |
| 25 | clean: |
| 26 | rm -f $(OBJS) test.elf test.bin |
| 27 |
Branches:
master
