1 2TOOLCHAIN := /toolchain/arm-eabi-10.2.0/bin/arm-eabi- 3OBJCOPY := $(TOOLCHAIN)objcopy 4OBJDUMP := $(TOOLCHAIN)objdump 5CC := $(TOOLCHAIN)gcc 6 7CFLAGS := -mcpu=cortex-m0 -mthumb 8CFLAGS += -fno-builtin -nostdlib 9LFLAGS := -Wl,--script=fw-m0sub.ld -Wl,-Ttext=0x18000000 10 11all: zero.bin zero.lst fw-m0sub.h 12 13zero.elf: fw-m0sub.S 14 $(CC) $(CFLAGS) $(LFLAGS) -o $@ $< 15 16zero.lst: zero.elf 17 $(OBJDUMP) -D $< > $@ 18 19zero.bin: zero.elf 20 $(OBJCOPY) -O binary $< $@ 21 22fw-m0sub.h: zero.bin 23 xxd -i $< > $@ 24 25clean: 26 rm -f zero.bin zero.lst zero.elf 27