Advertisement
Guest User

Error in Makefile

a guest
Nov 2nd, 2017
1,266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 6.47 KB | None | 0 0
  1. ##########################################################################################################################
  2. # File automatically-generated by tool: [projectgenerator] version: [2.26.0] date: [Thu Nov 02 16:02:31 CET 2017]
  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 = test107
  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. # source path
  32. SOURCES_DIR =  \
  33. Middlewares \
  34. Middlewares/FreeRTOS \
  35. Application/MAKEFILE \
  36. Application/User/Src/stm32f1xx_hal_timebase_TIM.c \
  37. Application/User/Src \
  38. Drivers \
  39. Application/User \
  40. Application/User/Src/main.c \
  41. Drivers/STM32F1xx_HAL_Driver \
  42. Drivers/CMSIS \
  43. Application/User/Src/stm32f1xx_hal_msp.c \
  44. Application/User/Src/freertos.c \
  45. Application \
  46. Application/User/Src/stm32f1xx_it.c
  47.  
  48. # firmware library path
  49. PERIFLIB_PATH =
  50.  
  51. # Build path
  52. BUILD_DIR = build
  53.  
  54. ######################################
  55. # source
  56. ######################################
  57. # C sources
  58. C_SOURCES =  \
  59. Src/stm32f1xx_hal_msp.c \
  60. Src/freertos.c \
  61. Src/stm32f1xx_it.c \
  62. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
  63. Src/main.c \
  64. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c \
  65. Src/main.c \
  66. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c \
  67. Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c \
  68. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
  69. Middlewares/Third_Party/FreeRTOS/Source/croutine.c \
  70. Src/stm32f1xx_hal_timebase_TIM.c \
  71. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
  72. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
  73. Src/stm32f1xx_hal_timebase_TIM.c \
  74. Middlewares/Third_Party/FreeRTOS/Source/list.c \
  75. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
  76. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_crc.c \
  77. Middlewares/Third_Party/FreeRTOS/Source/queue.c \
  78. Middlewares/Third_Party/FreeRTOS/Source/tasks.c \
  79. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
  80. Src/system_stm32f1xx.c \
  81. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
  82. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_eth.c \
  83. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
  84. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
  85. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
  86. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
  87. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
  88. Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c \
  89. Middlewares/Third_Party/FreeRTOS/Source/event_groups.c \
  90. Middlewares/Third_Party/FreeRTOS/Source/timers.c \
  91. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c \
  92. Src/stm32f1xx_it.c \
  93. Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c \
  94. Src/freertos.c \
  95. Src/stm32f1xx_hal_msp.c  
  96.  
  97. # ASM sources
  98. ASM_SOURCES =  \
  99. startup_stm32f107xc.s
  100.  
  101.  
  102. ######################################
  103. # firmware library
  104. ######################################
  105. PERIFLIB_SOURCES =
  106.  
  107.  
  108. #######################################
  109. # binaries
  110. #######################################
  111. BINPATH =
  112. PREFIX = arm-none-eabi-
  113. CC = $(BINPATH)/$(PREFIX)gcc
  114. AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
  115. CP = $(BINPATH)/$(PREFIX)objcopy
  116. AR = $(BINPATH)/$(PREFIX)ar
  117. SZ = $(BINPATH)/$(PREFIX)size
  118. HEX = $(CP) -O ihex
  119. BIN = $(CP) -O binary -S
  120.  
  121. #######################################
  122. # CFLAGS
  123. #######################################
  124. # cpu
  125. CPU = -mcpu=cortex-m3
  126.  
  127. # fpu
  128. # NONE for Cortex-M0/M0+/M3
  129.  
  130. # float-abi
  131.  
  132.  
  133. # mcu
  134. MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
  135.  
  136. # macros for gcc
  137. # AS defines
  138. AS_DEFS =
  139.  
  140. # C defines
  141. C_DEFS =  \
  142. -DUSE_HAL_DRIVER \
  143. -DSTM32F107xC
  144.  
  145.  
  146. # AS includes
  147. AS_INCLUDES =  \
  148. -IInc
  149.  
  150. # C includes
  151. C_INCLUDES =  \
  152. -IInc \
  153. -IDrivers/STM32F1xx_HAL_Driver/Inc \
  154. -IDrivers/STM32F1xx_HAL_Driver/Inc/Legacy \
  155. -IMiddlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM3 \
  156. -IDrivers/CMSIS/Device/ST/STM32F1xx/Include \
  157. -IMiddlewares/Third_Party/FreeRTOS/Source/include \
  158. -IMiddlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS \
  159. -IDrivers/CMSIS/Include
  160.  
  161.  
  162. # compile gcc flags
  163. ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  164.  
  165. CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  166.  
  167. ifeq ($(DEBUG), 1)
  168. CFLAGS += -g -gdwarf-2
  169. endif
  170.  
  171.  
  172. # Generate dependency information
  173. CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
  174.  
  175.  
  176. #######################################
  177. # LDFLAGS
  178. #######################################
  179. # link script
  180. LDSCRIPT = STM32F107RBTx_FLASH.ld
  181.  
  182. # libraries
  183. LIBS = -lc -lm -lnosys
  184. LIBDIR =
  185. LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
  186.  
  187. # default action: build all
  188. all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
  189.  
  190.  
  191. #######################################
  192. # build the application
  193. #######################################
  194. # list of objects
  195. OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
  196. vpath %.c $(sort $(dir $(C_SOURCES)))
  197. # list of ASM program objects
  198. OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
  199. vpath %.s $(sort $(dir $(ASM_SOURCES)))
  200.  
  201. $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
  202.     $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
  203.  
  204. $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
  205.     $(AS) -c $(CFLAGS) $< -o $@
  206.  
  207. $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
  208.     $(CC) $(OBJECTS) $(LDFLAGS) -o $@
  209.     $(SZ) $@
  210.  
  211. $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  212.     $(HEX) $< $@
  213.    
  214. $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  215.     $(BIN) $< $@   
  216.    
  217. $(BUILD_DIR):
  218.     mkdir $@       
  219.  
  220. #######################################
  221. # clean up
  222. #######################################
  223. clean:
  224.     -rm -fR .dep $(BUILD_DIR)
  225.  
  226. #######################################
  227. # dependencies
  228. #######################################
  229. -include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
  230.  
  231. # *** EOF ***
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement