-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (28 loc) · 831 Bytes
/
Makefile
File metadata and controls
36 lines (28 loc) · 831 Bytes
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
35
36
# Compiler settings. Only edit CFLAGS to include other header files.
CC=arm-none-eabi-gcc
AS=arm-none-eabi-as
LD=arm-none-eabi-ld
OBJCOPY=arm-none-eabi-objcopy
# Compiler flags
CFLAGS = -Wall -Wextra -Werror
CFLAGS += -mthumb -march=armv7-m
CFLAGS += -ffreestanding
CFLAGS += -Iapps -Ios -Iperip
# Assembler flags
ASFLAGS = -Ios
# Linker options
LDFLAGS = -nostdlib -Tlinker.ld
vpath %.c apps os perip startup stdlib
vpath %.s os
vpath %.h apps os perip
all: sos.elf
$(OBJCOPY) -O ihex sos.elf sos.hex
$(OBJCOPY) -O binary sos.elf sos.bin
sos.elf: startup.o main.o gpio.o rcc.o uart.o os.o apps.o terminal.o armv7-m.o
sos.elf: printf.o memory.o thread_list.o mutex.o thread.o
$(LD) $(LDFLAGS) $^ -o sos.elf
clean:
rm -f *.o sos.elf sos.hex sos.bin
# Flash the STM32F4
flash:
st-flash --reset write sos.bin 0x08000000