3 AR=$(TOOLROOT)/arm-none-eabi-ar
5 MKIMG=arm-none-eabi-objcopy
7 LDFLAGS+= -mthumb -mcpu=cortex-m0
8 CFLAGS+= -mcpu=cortex-m3 -mthumb -g
11 $(AS) $(CFLAGS) -o start.o start.asm
14 $(AS) $(CFLAGS) -o start.o start.asm
15 $(CC) $(CFLAGS) -c -I./include -ffreestanding -o main.o main.c
16 $(CC) $(CFLAGS) -c -I./include -ffreestanding -o uart.o uart.c
17 $(CC) $(CFLAGS) -c -I./include -ffreestanding -o ivt.o ivt.c
18 $(CC) $(CFLAGS) -c -I./include -ffreestanding -o systick.o systick.c
19 $(CC) $(CFLAGS) -c -I./include -ffreestanding -o sysinfo.o sysinfo.c
20 $(CC) $(CFLAGS) -c -I./include -ffreestanding -o lib.o lib.c
21 $(CC) $(CFLAGS) -c -I./include -ffreestanding -o mm.o mm.c
22 $(LD) -nostartfiles -T link.ld -o start.out start.o main.o uart.o ivt.o systick.o sysinfo.o lib.o mm.o
23 $(MKIMG) -Obinary -R .data start.out kernel.bin
26 /usr/local/bin/qemu-system-arm -serial stdio -M stm32-f103c8 -kernel kernel.bin
29 arm-none-eabi-objdump -S start.out
32 $(CC) -c $(CFLAGS) $< -o $@
33 $(CC) -MM $(CFLAGS) $< > $*.d
36 $(CC) -c $(CFLAGS) $< -o $@