1 ##########################################################################################################################
2 # File automatically-generated by tool: [projectgenerator] version: [2.27.0] date: [Thu Jul 05 23:11:33 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 .DEFAULT_GOAL := flash
15 ######################################
17 ######################################
21 ######################################
23 ######################################
30 #######################################
32 #######################################
35 Drivers/STM32F0xx_HAL_Driver \
37 Application/User/Src/stm32f0xx_it.c \
39 Application/User/Src \
41 Application/User/Src/main.c \
44 # firmware library path
50 ######################################
52 ######################################
57 Src/system_stm32f0xx.c \
59 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_exti.c \
60 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usart.c \
61 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_gpio.c \
62 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_utils.c \
63 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_rcc.c \
64 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_dma.c \
65 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_i2c.c \
66 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_tim.c \
67 /aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_pwr.c
74 ######################################
76 ######################################
80 #######################################
82 #######################################
84 PREFIX = arm-none-eabi-
85 CC = $(BINPATH)/$(PREFIX)gcc
86 AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
87 CP = $(BINPATH)/$(PREFIX)objcopy
88 AR = $(BINPATH)/$(PREFIX)ar
89 SZ = $(BINPATH)/$(PREFIX)size
91 BIN = $(CP) -O binary -S
93 #######################################
95 #######################################
100 # NONE for Cortex-M0/M0+/M3
106 MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
114 -DUSE_FULL_LL_DRIVER \
124 -I/aux/misc/stm/F0-package/Drivers/STM32F0xx_HAL_Driver/Inc \
125 -I/aux/misc/stm/F0-package/Drivers/CMSIS/Device/ST/STM32F0xx/Include \
126 -I/aux/misc/stm/F0-package/Drivers/CMSIS/Include
130 ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
132 CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -Wextra -Wno-parentheses -Wno-unused -fdata-sections -ffunction-sections
135 CFLAGS += -g -gdwarf-2
139 # Generate dependency information
140 CFLAGS += -MMD -MF"$(@:%.o=%.d)"
143 #######################################
145 #######################################
147 LDSCRIPT = STM32F030R8Tx_FLASH.ld
150 LIBS = -lc -lm -lnosys
152 LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
154 # default action: build all
155 all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
158 ../bin/st-flash write $(BUILD_DIR)/$(TARGET).bin 0x8000000
161 #######################################
162 # build the application
163 #######################################
165 OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
166 vpath %.c $(sort $(dir $(C_SOURCES)))
167 # list of ASM program objects
168 OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
169 vpath %.s $(sort $(dir $(ASM_SOURCES)))
171 $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
172 $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
174 $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
175 $(AS) -c $(CFLAGS) $< -o $@
177 $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
178 $(CC) $(OBJECTS) $(LDFLAGS) -o $@
181 $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
184 $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
190 #######################################
192 #######################################
196 #######################################
198 #######################################
199 -include $(wildcard $(BUILD_DIR)/*.d)