1 ##########################################################################################################################
2 # File automatically-generated by tool: [projectgenerator] version: [2.27.0] date: [Fri Jun 29 23:59:44 CEST 2018]
3 ##########################################################################################################################
5 # ------------------------------------------------
6 # Generic Makefile (based on gcc)
9 # 2017-02-10 - Several enhancements + project update mode
10 # 2015-07-22 - first version
11 # ------------------------------------------------
13 ######################################
15 ######################################
19 ######################################
21 ######################################
28 #######################################
30 #######################################
34 Application/User/Src/main.c \
35 Application/User/Src \
36 Application/User/Src/stm32f1xx_hal_msp.c \
37 Drivers/STM32F1xx_HAL_Driver \
38 Application/User/Src/stm32f1xx_it.c \
43 # firmware library path
49 ######################################
51 ######################################
54 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_exti.c \
61 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c \
62 /Src/system_stm32f1xx.c \
64 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c \
65 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c \
66 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
67 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
68 Src/stm32f1xx_hal_msp.c \
69 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
70 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
71 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c \
72 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
73 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
74 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
75 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
76 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
77 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
78 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
79 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c \
80 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
81 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c \
82 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c \
83 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_i2c.c \
84 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_tim.c
91 ######################################
93 ######################################
97 #######################################
99 #######################################
101 PREFIX = arm-none-eabi-
102 CC = $(BINPATH)/$(PREFIX)gcc
103 AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
104 CP = $(BINPATH)/$(PREFIX)objcopy
105 AR = $(BINPATH)/$(PREFIX)ar
106 SZ = $(BINPATH)/$(PREFIX)size
108 BIN = $(CP) -O binary -S
110 #######################################
112 #######################################
114 CPU = -mcpu=cortex-m3
117 # NONE for Cortex-M0/M0+/M3
123 MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
131 -DUSE_FULL_LL_DRIVER \
142 -I/aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Inc \
143 -I/aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy \
144 -I/aux/misc/stm/F1-package/Drivers/CMSIS/Include \
145 -I/aux/misc/stm/F1-package/Drivers/CMSIS/Device/ST/STM32F1xx/Include
149 ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
151 CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
154 CFLAGS += -g -gdwarf-2
158 # Generate dependency information
159 CFLAGS += -MMD -MF"$(@:%.o=%.d)"
162 #######################################
164 #######################################
166 LDSCRIPT = STM32F103C8Tx_FLASH.ld
169 LIBS = -lc -lm -lnosys
171 LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
173 # default action: build all
174 all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
177 ../bin/st-flash write $(BUILD_DIR)/$(TARGET).bin 0x8000000
179 #######################################
180 # build the application
181 #######################################
183 OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
184 vpath %.c $(sort $(dir $(C_SOURCES)))
185 # list of ASM program objects
186 OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
187 vpath %.s $(sort $(dir $(ASM_SOURCES)))
189 $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
190 $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
192 $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
193 $(AS) -c $(CFLAGS) $< -o $@
195 $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
196 $(CC) $(OBJECTS) $(LDFLAGS) -o $@
199 $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
202 $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
208 #######################################
210 #######################################
214 #######################################
216 #######################################
217 -include $(wildcard $(BUILD_DIR)/*.d)