forked from Ralim/IronOS-dfu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (31 loc) · 1.05 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
GIT_VERSION := $(shell git describe --abbrev=8 --dirty --always --tags)
build_type ?= runtime
model ?= unknown
ifeq ($(build_type), runtime)
VECTOR_TABLE_OFFSET := 0x4000
SRC_LD = src/stm32f103_runtime.ld
BIN = runtime
else
VECTOR_TABLE_OFFSET := 0x0000
SRC_LD = src/stm32f103.ld
BIN = bootloader
endif
# For MHP30 override the runtime to offset to 32k
ifeq ($(model),"MHP30")
SRC_LD = stm32f103_32k_runtime.ld
endif
INC = -I src
SRC_C += $(wildcard src/*.c)
# Defines required by included libraries
DEF = -DSTM32F030x8 -DVERSION=\"$(GIT_VERSION)\" -DVECTOR_TABLE_OFFSET=${VECTOR_TABLE_OFFSET} -DMODEL_${model}=1
# OpenOCD setup
JLINK_DEVICE = STM32F103C8
include cm-makefile/config.mk
include cm-makefile/rules.mk
include cm-makefile/jlink.mk
WARNFLAGS += -Wno-undef -Wno-conversion -Wall -pedantic -Werror
OPTFLAGS = -Os -flto -finline-small-functions \
-findirect-inlining -fdiagnostics-color \
-ffunction-sections -fdata-sections -Wno-overlength-strings -ggdb -nostartfiles
ARCHFLAGS = -mcpu=cortex-m3 -mthumb -DSTM32F1 -std=c11
DBGFLAGS =