1 ##########################################################################################################################
2 # File automatically-generated by tool: [projectgenerator] version: [2.27.0] date: [Fri Jun 22 20:50:06 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 \
56 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_rcc.c \
57 /Src/system_stm32f1xx.c \
59 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_utils.c \
60 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_gpio.c \
61 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
62 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
63 Src/stm32f1xx_hal_msp.c \
64 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
65 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
66 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.c \
67 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
68 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
69 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
70 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
71 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
72 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
73 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
74 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_dma.c \
75 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
76 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c \
77 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.c \
78 /aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_i2c.c
85 ######################################
87 ######################################
91 #######################################
93 #######################################
95 PREFIX = arm-none-eabi-
96 CC = $(BINPATH)/$(PREFIX)gcc
97 AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
98 CP = $(BINPATH)/$(PREFIX)objcopy
99 AR = $(BINPATH)/$(PREFIX)ar
100 SZ = $(BINPATH)/$(PREFIX)size
102 BIN = $(CP) -O binary -S
104 #######################################
106 #######################################
108 CPU = -mcpu=cortex-m3
111 # NONE for Cortex-M0/M0+/M3
117 MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
125 -DUSE_FULL_LL_DRIVER \
136 -I/aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Inc \
137 -I/aux/misc/stm/F1-package/Drivers/STM32F1xx_HAL_Driver/Inc/Legacy \
138 -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include
142 ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
144 CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
147 CFLAGS += -g -gdwarf-2
151 # Generate dependency information
152 CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
155 #######################################
157 #######################################
159 LDSCRIPT = STM32F103C8Tx_FLASH.ld
162 LIBS = -lc -lm -lnosys
164 LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
166 # default action: build all
167 all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
170 LD_LIBRARY_PATH=../stlink ../stlink/st-flash write $(BUILD_DIR)/$(TARGET).bin 0x8000000
172 #######################################
173 # build the application
174 #######################################
176 OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
177 vpath %.c $(sort $(dir $(C_SOURCES)))
178 # list of ASM program objects
179 OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
180 vpath %.s $(sort $(dir $(ASM_SOURCES)))
182 $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
183 $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
185 $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
186 $(AS) -c $(CFLAGS) $< -o $@
188 $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
189 $(CC) $(OBJECTS) $(LDFLAGS) -o $@
192 $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
195 $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
201 #######################################
203 #######################################
205 -rm -fR .dep $(BUILD_DIR)
207 #######################################
209 #######################################
210 -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)