Subversion Repositories LedShow

Rev

Rev 8 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
##########################################################################################################################
9 mjames 2
# File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Tue Dec 15 16:34:23 GMT 2020] 
2 mjames 3
##########################################################################################################################
4
 
5
# ------------------------------------------------
6
# Generic Makefile (based on gcc)
7
#
8
# ChangeLog :
9
#	2017-02-10 - Several enhancements + project update mode
10
#   2015-07-22 - first version
11
# ------------------------------------------------
12
 
13
######################################
14
# target
15
######################################
16
TARGET = DigitalLeds
17
 
18
 
19
######################################
20
# building variables
21
######################################
22
# debug build?
23
DEBUG = 1
24
# optimization
25
OPT = -Og
26
 
27
 
28
#######################################
29
# paths
30
#######################################
31
# Build path
32
BUILD_DIR = build
33
 
34
######################################
35
# source
36
######################################
37
# C sources
38
C_SOURCES =  \
39
Src/main.c \
40
Src/usb_device.c \
41
Src/usbd_conf.c \
42
Src/usbd_desc.c \
43
Src/usbd_cdc_if.c \
44
Src/stm32f1xx_it.c \
45
Src/stm32f1xx_hal_msp.c \
8 mjames 46
Src/sendLeds.c \
6 mjames 47
Src/dmx.c \
2 mjames 48
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
49
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c \
50
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c \
51
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c \
52
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c \
53
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
54
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
55
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c \
56
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
57
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
58
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
59
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
60
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
61
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
62
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
63
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
64
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
65
Src/system_stm32f1xx.c \
66
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \
67
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \
68
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \
9 mjames 69
Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c \
70
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c
2 mjames 71
 
72
# ASM sources
73
ASM_SOURCES =  \
74
startup_stm32f103xb.s
75
 
76
 
77
#######################################
78
# binaries
79
#######################################
80
PREFIX = arm-none-eabi-
81
# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
82
# either it can be added to the PATH environment variable.
83
ifdef GCC_PATH
84
CC = $(GCC_PATH)/$(PREFIX)gcc
85
AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp
86
CP = $(GCC_PATH)/$(PREFIX)objcopy
87
SZ = $(GCC_PATH)/$(PREFIX)size
88
else
89
CC = $(PREFIX)gcc
90
AS = $(PREFIX)gcc -x assembler-with-cpp
91
CP = $(PREFIX)objcopy
92
SZ = $(PREFIX)size
93
endif
94
HEX = $(CP) -O ihex
95
BIN = $(CP) -O binary -S
96
 
97
#######################################
98
# CFLAGS
99
#######################################
100
# cpu
101
CPU = -mcpu=cortex-m3
102
 
103
# fpu
104
# NONE for Cortex-M0/M0+/M3
105
 
106
# float-abi
107
 
108
 
109
# mcu
110
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
111
 
112
# macros for gcc
113
# AS defines
114
AS_DEFS = 
115
 
116
# C defines
117
C_DEFS =  \
118
-DUSE_HAL_DRIVER \
119
-DSTM32F103xB
120
 
121
 
122
# AS includes
123
AS_INCLUDES = 
124
 
125
# C includes
126
C_INCLUDES =  \
127
-IInc \
128
-IDrivers/STM32F1xx_HAL_Driver/Inc \
129
-IDrivers/STM32F1xx_HAL_Driver/Inc/Legacy \
130
-IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc \
131
-IMiddlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc \
132
-IDrivers/CMSIS/Device/ST/STM32F1xx/Include \
133
-IDrivers/CMSIS/Include
9 mjames 134
###################################################################
135
######################################################################################################################################
136
HAL=stm32_hal
137
LIBWS2812=../libWS2812
138
include $(LIBWS2812)/libWS2812.mk
2 mjames 139
 
9 mjames 140
#####################################################################
2 mjames 141
 
142
# compile gcc flags
143
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
144
 
145
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
146
 
147
ifeq ($(DEBUG), 1)
148
CFLAGS += -g -gdwarf-2
149
endif
150
 
151
 
152
# Generate dependency information
153
CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
154
 
155
 
156
#######################################
157
# LDFLAGS
158
#######################################
159
# link script
160
LDSCRIPT = STM32F103C8Tx_FLASH.ld
161
 
162
# libraries
163
LIBS = -lc -lm -lnosys 
164
LIBDIR = 
165
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
166
 
167
# default action: build all
168
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
169
 
170
 
171
#######################################
172
# build the application
173
#######################################
174
# list of objects
175
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
176
vpath %.c $(sort $(dir $(C_SOURCES)))
177
# list of ASM program objects
178
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
179
vpath %.s $(sort $(dir $(ASM_SOURCES)))
180
 
181
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 
182
	$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
183
 
184
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
185
	$(AS) -c $(CFLAGS) $< -o $@
186
 
187
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
188
	$(CC) $(OBJECTS) $(LDFLAGS) -o $@
189
	$(SZ) $@
190
 
191
$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
192
	$(HEX) $< $@
193
 
194
$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
195
	$(BIN) $< $@	
196
 
197
$(BUILD_DIR):
198
	mkdir $@		
199
 
200
#######################################
201
# clean up
202
#######################################
203
clean:
204
	-rm -fR $(BUILD_DIR)
205
 
206
#######################################
207
# dependencies
208
#######################################
209
-include $(wildcard $(BUILD_DIR)/*.d)
210
 
211
# *** EOF ***