forked from isenser/0xWS2812
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (93 loc) · 4.48 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
TARGET=main
EXECUTABLE=main.elf
CC=arm-none-eabi-gcc
LD=arm-none-eabi-gcc
AR=arm-none-eabi-ar
AS=arm-none-eabi-as
CP=arm-none-eabi-objcopy
OD=arm-none-eabi-objdump
BIN=$(CP) -O ihex
# Select the appropriate option for your device, the available options are listed below
# with a description copied from stm32f10x.h
# Make sure to set the startup code file to the right device family, too!
#
# STM32F10X_LD STM32F10X_LD: STM32 Low density devices
# STM32F10X_LD_VL STM32F10X_LD_VL: STM32 Low density Value Line devices
# STM32F10X_MD STM32F10X_MD: STM32 Medium density devices
# STM32F10X_MD_VL STM32F10X_MD_VL: STM32 Medium density Value Line devices
# STM32F10X_HD STM32F10X_HD: STM32 High density devices
# STM32F10X_HD_VL STM32F10X_HD_VL: STM32 High density value line devices
# STM32F10X_XL STM32F10X_XL: STM32 XL-density devices
# STM32F10X_CL STM32F10X_CL: STM32 Connectivity line devices
#
# - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
# where the Flash memory density ranges between 16 and 32 Kbytes.
#
# - Low-density value line devices are STM32F100xx microcontrollers where the Flash
# memory density ranges between 16 and 32 Kbytes.
#
# - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
# where the Flash memory density ranges between 64 and 128 Kbytes.
#
# - Medium-density value line devices are STM32F100xx microcontrollers where the
# Flash memory density ranges between 64 and 128 Kbytes.
#
# - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
# the Flash memory density ranges between 256 and 512 Kbytes.
#
# - High-density value line devices are STM32F100xx microcontrollers where the
# Flash memory density ranges between 256 and 512 Kbytes.
#
# - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
# the Flash memory density ranges between 512 and 1024 Kbytes.
#
# - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
#
# HSE_VALUE sets the value of the HSE clock, 8MHz in this case
DEFS = -DUSE_STDPERIPH_DRIVER -DSTM32F10X_MD_VL -DHSE_VALUE=8000000
STARTUP = ../../Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/gcc_ride7/startup_stm32f10x_md_vl.s
MCU = cortex-m3
MCFLAGS = -mcpu=$(MCU) -mthumb -mlittle-endian -mthumb-interwork
STM32_INCLUDES = -I../../Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/ \
-I../../Libraries/CMSIS/CM3/CoreSupport/ \
-I../../Libraries/STM32F10x_StdPeriph_Driver/inc/
OPTIMIZE = -O3
CFLAGS = $(MCFLAGS) $(OPTIMIZE) $(DEFS) -I. -I./ $(STM32_INCLUDES) -Wl,-T,stm32_flash.ld
AFLAGS = $(MCFLAGS)
SRC = main.c \
stm32f10x_it.c \
system_stm32f10x.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/misc.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c \
../../Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.c
OBJDIR = .
OBJ = $(SRC:%.c=$(OBJDIR)/%.o)
OBJ += Startup.o
all: $(TARGET).hex
$(TARGET).hex: $(EXECUTABLE)
$(CP) -O ihex $^ $@
$(EXECUTABLE): $(SRC) $(STARTUP)
$(CC) $(CFLAGS) $^ -lm -lc -lnosys -o $@
clean:
rm -f Startup.lst $(TARGET).lst $(OBJ) $(AUTOGEN) $(TARGET).out $(TARGET).hex $(TARGET).map \
$(TARGET).dmp $(EXECUTABLE)