1 ##########################################################################################################################
2 # File automatically-generated by tool: [projectgenerator] version: [2.27.0] date: [Wed Aug 08 11:17:04 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 \
60 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c \
61 /Src/system_stm32f1xx.c \
63 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c \
64 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c \
65 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
66 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
67 Src/stm32f1xx_hal_msp.c \
68 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
69 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
70 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c \
71 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
72 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
73 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
74 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
75 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
76 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
77 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
78 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c \
79 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
80 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c \
81 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c \
82 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_tim.c \
83 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usart.c
90 ######################################
92 ######################################
96 #######################################
98 #######################################
100 PREFIX = arm-none-eabi-
101 CC = $(BINPATH)/$(PREFIX)gcc
102 AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
103 CP = $(BINPATH)/$(PREFIX)objcopy
104 AR = $(BINPATH)/$(PREFIX)ar
105 SZ = $(BINPATH)/$(PREFIX)size
107 BIN = $(CP) -O binary -S
109 #######################################
111 #######################################
113 CPU = -mcpu=cortex-m3
116 # NONE for Cortex-M0/M0+/M3
122 MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
130 -DUSE_FULL_LL_DRIVER \
141 -I/aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Inc \
142 -I/aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy \
143 -I/aux/misc/stm/F1-package/Drivers/CMSIS/Include \
144 -I/aux/misc/stm/F1-package/Drivers/CMSIS/Device/ST/STM32F1xx/Include
148 ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
150 CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
153 CFLAGS += -g -gdwarf-2
157 # Generate dependency information
158 CFLAGS += -MMD -MF"$(@:%.o=%.d)"
161 #######################################
163 #######################################
165 LDSCRIPT = STM32F103C8Tx_FLASH.ld
168 LIBS = -lc -lm -lnosys
170 LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
172 # default action: build all
173 all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
176 ../bin/st-flash write $(BUILD_DIR)/$(TARGET).bin 0x8000000
178 #######################################
179 # build the application
180 #######################################
182 OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
183 vpath %.c $(sort $(dir $(C_SOURCES)))
184 # list of ASM program objects
185 OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
186 vpath %.s $(sort $(dir $(ASM_SOURCES)))
188 $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
189 $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
191 $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
192 $(AS) -c $(CFLAGS) $< -o $@
194 $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
195 $(CC) $(OBJECTS) $(LDFLAGS) -o $@
198 $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
201 $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
207 #######################################
209 #######################################
213 #######################################
215 #######################################
216 -include $(wildcard $(BUILD_DIR)/*.d)