Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. ##########################################################################################################################
  2. # File automatically-generated by tool: [projectgenerator] version: [3.4.0] date: [Mon Nov 18 14:24:25 CET 2019]
  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 = pierwszy
  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. # Build path
  32. BUILD_DIR = build
  33.  
  34. ######################################
  35. # source
  36. ######################################
  37. # C sources
  38. C_SOURCES = \
  39. ../Src/main.c \
  40. ../Src/stm32f4xx_it.c \
  41. ../Src/stm32f4xx_hal_msp.c \
  42. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \
  43. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \
  44. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \
  45. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \
  46. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \
  47. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \
  48. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \
  49. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \
  50. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \
  51. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \
  52. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \
  53. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \
  54. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \
  55. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \
  56. ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \
  57. ../Src/system_stm32f4xx.c
  58.  
  59. # ASM sources
  60. ASM_SOURCES = \
  61. startup_stm32f411xe.s
  62.  
  63.  
  64. #######################################
  65. # binaries
  66. #######################################
  67. PREFIX = arm-none-eabi-
  68. # The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
  69. # either it can be added to the PATH environment variable.
  70. ifdef GCC_PATH
  71. CC = $(GCC_PATH)/$(PREFIX)gcc
  72. AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp
  73. CP = $(GCC_PATH)/$(PREFIX)objcopy
  74. SZ = $(GCC_PATH)/$(PREFIX)size
  75. else
  76. CC = $(PREFIX)gcc
  77. AS = $(PREFIX)gcc -x assembler-with-cpp
  78. CP = $(PREFIX)objcopy
  79. SZ = $(PREFIX)size
  80. endif
  81. HEX = $(CP) -O ihex
  82. BIN = $(CP) -O binary -S
  83.  
  84. #######################################
  85. # CFLAGS
  86. #######################################
  87. # cpu
  88. CPU = -mcpu=cortex-m4
  89.  
  90. # fpu
  91. FPU = -mfpu=fpv4-sp-d16
  92.  
  93. # float-abi
  94. FLOAT-ABI = -mfloat-abi=hard
  95.  
  96. # mcu
  97. MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
  98.  
  99. # macros for gcc
  100. # AS defines
  101. AS_DEFS =
  102.  
  103. # C defines
  104. C_DEFS = \
  105. -DUSE_HAL_DRIVER \
  106. -DSTM32F411xE \
  107. -DUSE_HAL_DRIVER \
  108. -DSTM32F411xE
  109.  
  110.  
  111. # AS includes
  112. AS_INCLUDES =
  113.  
  114. # C includes
  115. C_INCLUDES = \
  116. -I../Inc \
  117. -I../Drivers/STM32F4xx_HAL_Driver/Inc \
  118. -I../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy \
  119. -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include \
  120. -I../Drivers/CMSIS/Include \
  121. -I../Drivers/CMSIS/Include
  122.  
  123.  
  124. # compile gcc flags
  125. ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  126.  
  127. CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  128.  
  129. ifeq ($(DEBUG), 1)
  130. CFLAGS += -g -gdwarf-2
  131. endif
  132.  
  133.  
  134. # Generate dependency information
  135. CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
  136.  
  137.  
  138. #######################################
  139. # LDFLAGS
  140. #######################################
  141. # link script
  142. LDSCRIPT = STM32F411RETx_FLASH.ld
  143.  
  144. # libraries
  145. LIBS = -lc -lm -lnosys
  146. LIBDIR =
  147. LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
  148.  
  149. # default action: build all
  150. all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
  151.  
  152.  
  153. #######################################
  154. # build the application
  155. #######################################
  156. # list of objects
  157. OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
  158. vpath %.c $(sort $(dir $(C_SOURCES)))
  159. # list of ASM program objects
  160. OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
  161. vpath %.s $(sort $(dir $(ASM_SOURCES)))
  162.  
  163. $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
  164. $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
  165.  
  166. $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
  167. $(AS) -c $(CFLAGS) $< -o $@
  168.  
  169. $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
  170. $(CC) $(OBJECTS) $(LDFLAGS) -o $@
  171. $(SZ) $@
  172.  
  173. $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  174. $(HEX) $< $@
  175.  
  176. $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  177. $(BIN) $< $@
  178.  
  179. $(BUILD_DIR):
  180. mkdir $@
  181.  
  182. #######################################
  183. # clean up
  184. #######################################
  185. clean:
  186. -rm -fR $(BUILD_DIR)
  187.  
  188. #######################################
  189. # dependencies
  190. #######################################
  191. -include $(wildcard $(BUILD_DIR)/*.d)
  192.  
  193. # *** EOF ***
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement