-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (43 loc) · 1.31 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Compile tools
PREFIX=arm-none-eabi-
AS = $(PREFIX)as
CC = $(PREFIX)gcc
LD = $(PREFIX)gcc
GDB = gdb-multiarch
# Object file to execute
ELFFILE = skinny_STM32.elf
# Include files
INCLUDES += -I./cmsis
INCLUDES += -I./Drivers/Inc/
# Flags
ASFLAGS = -g -mcpu=cortex-m4 -mthumb
LDFLAGS = -g -Tld_ram.lds -nostartfiles -nostdlib
CFLAGS = -g -O1 -Wall -Wextra -mcpu=cortex-m4 -mthumb -ffreestanding -mhard-float $(INCLUDES)
# Path towards other file to compile
VPATH := Drivers/Src Drivers/Clocks Drivers/Cache Implementation/ref Implementation/affine_mask
# Object files
# we don't want to remove the clock.o file!
OBJFILES = crt0.o firmware.o memfuncs.o trigger.o \
led.o uart.o trng.o \
skinny_reference.o \
mask.o skinny_aff.o \
clocks.o \
cache.o \
init.o
####################################################
# Targets
####################################################
.PHONY: all clean build startgdbserver debug
all: clean build
clean:
rm -rf $(ELFFILE) $(OBJFILES)
build: $(ELFFILE)
startgdbserver:
JLinkGDBServer -device STM32L475VG -endian little -if SWD -speed auto -ir -LocalhostOnly
debug:
$(GDB) $(ELFFILE)
####################################################
# Rules
####################################################
$(ELFFILE): $(OBJFILES)
$(LD) $(LDFLAGS) $^ -o $@