You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
5.8 KiB

  1. ##########################################################################################################################
  2. # File automatically-generated by tool: [projectgenerator] version: [3.10.0-B14] date: [Sat Oct 24 17:35:54 CEST 2020]
  3. ##########################################################################################################################
  4. # ------------------------------------------------
  5. # Generic Makefile (based on gcc)
  6. #
  7. # ChangeLog :
  8. # 2017-02-10 - Several enhancements + project update mode
  9. # 2015-07-22 - first version
  10. # ------------------------------------------------
  11. ######################################
  12. # target
  13. ######################################
  14. TARGET = OtterClock
  15. ######################################
  16. # building variables
  17. ######################################
  18. # debug build?
  19. DEBUG = 1
  20. # optimization
  21. OPT = -Og
  22. #######################################
  23. # paths
  24. #######################################
  25. # Build path
  26. BUILD_DIR = build
  27. ######################################
  28. # source
  29. ######################################
  30. # C sources
  31. C_SOURCES = \
  32. Core/Src/main.c \
  33. Core/Src/stm32f7xx_it.c \
  34. Core/Src/stm32f7xx_hal_msp.c \
  35. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_cortex.c \
  36. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rcc.c \
  37. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rcc_ex.c \
  38. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_flash.c \
  39. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_flash_ex.c \
  40. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_gpio.c \
  41. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma.c \
  42. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dma_ex.c \
  43. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pwr.c \
  44. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_pwr_ex.c \
  45. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal.c \
  46. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2c.c \
  47. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_i2c_ex.c \
  48. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_exti.c \
  49. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_ltdc.c \
  50. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_ltdc_ex.c \
  51. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_dsi.c \
  52. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_qspi.c \
  53. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rtc.c \
  54. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_rtc_ex.c \
  55. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_sdmmc.c \
  56. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_sd.c \
  57. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_spi.c \
  58. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_spi_ex.c \
  59. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_tim.c \
  60. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_tim_ex.c \
  61. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart.c \
  62. Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_hal_uart_ex.c \
  63. Core/Src/system_stm32f7xx.c
  64. # ASM sources
  65. ASM_SOURCES = \
  66. startup_stm32f750xx.s
  67. #######################################
  68. # binaries
  69. #######################################
  70. PREFIX = arm-none-eabi-
  71. # The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
  72. # either it can be added to the PATH environment variable.
  73. ifdef GCC_PATH
  74. CC = $(GCC_PATH)/$(PREFIX)gcc
  75. AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp
  76. CP = $(GCC_PATH)/$(PREFIX)objcopy
  77. SZ = $(GCC_PATH)/$(PREFIX)size
  78. else
  79. CC = $(PREFIX)gcc
  80. AS = $(PREFIX)gcc -x assembler-with-cpp
  81. CP = $(PREFIX)objcopy
  82. SZ = $(PREFIX)size
  83. endif
  84. HEX = $(CP) -O ihex
  85. BIN = $(CP) -O binary -S
  86. #######################################
  87. # CFLAGS
  88. #######################################
  89. # cpu
  90. CPU = -mcpu=cortex-m7
  91. # fpu
  92. FPU = -mfpu=fpv5-sp-d16
  93. # float-abi
  94. FLOAT-ABI = -mfloat-abi=hard
  95. # mcu
  96. MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
  97. # macros for gcc
  98. # AS defines
  99. AS_DEFS =
  100. # C defines
  101. C_DEFS = \
  102. -DUSE_HAL_DRIVER \
  103. -DSTM32F750xx
  104. # AS includes
  105. AS_INCLUDES =
  106. # C includes
  107. C_INCLUDES = \
  108. -ICore/Inc \
  109. -IDrivers/STM32F7xx_HAL_Driver/Inc \
  110. -IDrivers/STM32F7xx_HAL_Driver/Inc/Legacy \
  111. -IDrivers/CMSIS/Device/ST/STM32F7xx/Include \
  112. -IDrivers/CMSIS/Include
  113. -IDrivers/CMSIS/Include
  114. # compile gcc flags
  115. ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  116. CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  117. ifeq ($(DEBUG), 1)
  118. CFLAGS += -g -gdwarf-2
  119. endif
  120. # Generate dependency information
  121. CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
  122. #######################################
  123. # LDFLAGS
  124. #######################################
  125. # link script
  126. LDSCRIPT = STM32F750Z8Tx_FLASH.ld
  127. # libraries
  128. LIBS = -lc -lm -lnosys
  129. LIBDIR =
  130. LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
  131. # default action: build all
  132. all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
  133. #######################################
  134. # build the application
  135. #######################################
  136. # list of objects
  137. OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
  138. vpath %.c $(sort $(dir $(C_SOURCES)))
  139. # list of ASM program objects
  140. OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
  141. vpath %.s $(sort $(dir $(ASM_SOURCES)))
  142. $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
  143. $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
  144. $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
  145. $(AS) -c $(CFLAGS) $< -o $@
  146. $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
  147. $(CC) $(OBJECTS) $(LDFLAGS) -o $@
  148. $(SZ) $@
  149. $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  150. $(HEX) $< $@
  151. $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  152. $(BIN) $< $@
  153. $(BUILD_DIR):
  154. mkdir $@
  155. #######################################
  156. # clean up
  157. #######################################
  158. clean:
  159. -rm -fR $(BUILD_DIR)
  160. #######################################
  161. # dependencies
  162. #######################################
  163. -include $(wildcard $(BUILD_DIR)/*.d)
  164. # *** EOF ***