-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.mk
31 lines (18 loc) · 891 Bytes
/
main.mk
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
CC = arm-none-eabi-gcc
SIZE = arm-none-eabi-size
COMMON_FLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -g
OPT = -Os
DEFINES = -DSTM32L1XX_MDP -DUSE_STDPERIPH_DRIVER
INCLUDE += -I CMSIS/Device/ST/STM32L1xx/Include -I CMSIS/Include -I./ -I STM32L1xx_StdPeriph_Driver/inc
CFLAGS := $(COMMON_FLAGS) $(INCLUDE) $(DEFINES) $(OPT) -std=gnu11 -Wall -pipe -ffunction-sections -fdata-sections
SUBMAKEFILES := main/main.mk startup_code/startup_code.mk SEGGER/SEGGER.mk STM32L1xx_StdPeriph_Driver/library.mk
BUILD_DIR := build
TARGET_DIR := .
LIBC_SPECS = --specs=nano.specs
#LIBC_SPECS = --specs=nosys.specs #see newlib documentation if you need more functionality
LDFLAGS = $(COMMON_FLAGS) $(LIBC_SPECS) -T linker_script/STM32_flash.ld -Wl,--gc-sections
TARGET := main.elf
SOURCES := \
CMSIS/Device/ST/STM32L1xx/Source/Templates/system_stm32l1xx.c
size: main.elf
$(SIZE) main.elf