-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathMakefile
34 lines (23 loc) · 879 Bytes
/
Makefile
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
31
32
33
34
CC=arm-none-eabi-gcc
MACH=cortex-m4
CFLAGS= -c -mcpu=$(MACH) -mthumb -mfloat-abi=soft -std=gnu11 -Wall -O0
LDFLAGS= -mcpu=$(MACH) -mthumb -mfloat-abi=soft --specs=nano.specs -T stm32_ls.ld -Wl,-Map=final.map
LDFLAGS_SH= -mcpu=$(MACH) -mthumb -mfloat-abi=soft --specs=rdimon.specs -T stm32_ls.ld -Wl,-Map=final.map
all:main.o led.o stm32_startup.o syscalls.o final.elf
semi:main.o led.o stm32_startup.o syscalls.o final_sh.elf
main.o:main.c
$(CC) $(CFLAGS) -o $@ $^
led.o:led.c
$(CC) $(CFLAGS) -o $@ $^
stm32_startup.o:stm32_startup.c
$(CC) $(CFLAGS) -o $@ $^
syscalls.o:syscalls.c
$(CC) $(CFLAGS) -o $@ $^
final.elf: main.o led.o stm32_startup.o syscalls.o
$(CC) $(LDFLAGS) -o $@ $^
final_sh.elf: main.o led.o stm32_startup.o
$(CC) $(LDFLAGS_SH) -o $@ $^
clean:
rm -rf *.o *.elf
load:
openocd -f board/stm32f4discovery.cfg