Advertisement
_BadWolf33

Untitled

Nov 8th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.09 KB | None | 0 0
  1. ##########################################################################################################################
  2. # File automatically-generated by tool: [projectgenerator] version: [3.1.0] date: [Thu Nov 07 01:25:26 EET 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 = LCD_TEST2
  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.cpp \
  40. Src/Print.cpp \
  41. Src/ILI9486Driver.cpp \
  42. Src/wirish_math.cpp \
  43. Src/stm32f1xx_it.c \
  44. Src/stm32f1xx_hal_msp.c \
  45. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
  46. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \
  47. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \
  48. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c \
  49. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c \
  50. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c \
  51. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c \
  52. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c \
  53. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c \
  54. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c \
  55. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c \
  56. Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \
  57. Src/system_stm32f1xx.c  
  58.  
  59. # ASM sources
  60. ASM_SOURCES =  \
  61. startup_stm32f103xb.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-m3
  89.  
  90. # fpu
  91. # NONE for Cortex-M0/M0+/M3
  92.  
  93. # float-abi
  94.  
  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. -DSTM32F103xB
  107.  
  108.  
  109. # AS includes
  110. AS_INCLUDES =
  111.  
  112. # C includes
  113. C_INCLUDES =  \
  114. -IInc \
  115. -IDrivers/STM32F1xx_HAL_Driver/Inc \
  116. -IDrivers/STM32F1xx_HAL_Driver/Inc/Legacy \
  117. -IDrivers/CMSIS/Device/ST/STM32F1xx/Include \
  118. -IDrivers/CMSIS/Include \
  119. -IDrivers/CMSIS/Include
  120.  
  121.  
  122. # compile gcc flags
  123. ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  124.  
  125. CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
  126.  
  127. ifeq ($(DEBUG), 1)
  128. CFLAGS += -g -gdwarf-2
  129. endif
  130.  
  131.  
  132. # Generate dependency information
  133. CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
  134.  
  135.  
  136. #######################################
  137. # LDFLAGS
  138. #######################################
  139. # link script
  140. LDSCRIPT = STM32F103C8Tx_FLASH.ld
  141.  
  142. # libraries
  143. LIBS = -lc -lm -lnosys
  144. LIBDIR =
  145. LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections -Wl,--print-memory-usage
  146.  
  147. # default action: build all
  148. all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
  149.  
  150.  
  151. #######################################
  152. # build the application
  153. #######################################
  154. # list of objects
  155. OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
  156. vpath %.c $(sort $(dir $(C_SOURCES)))
  157. # list of ASM program objects
  158. OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
  159. vpath %.s $(sort $(dir $(ASM_SOURCES)))
  160.  
  161. $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR)
  162.     $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
  163.  
  164. $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
  165.     $(AS) -c $(CFLAGS) $< -o $@
  166.  
  167. $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
  168.     $(CC) $(OBJECTS) $(LDFLAGS) -o $@
  169.     $(SZ) $@
  170.  
  171. $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  172.     $(HEX) $< $@
  173.    
  174. $(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
  175.     $(BIN) $< $@   
  176.    
  177. $(BUILD_DIR):
  178.     mkdir $@       
  179.  
  180. #######################################
  181. # clean up
  182. #######################################
  183. clean:
  184.     -rm -fR $(BUILD_DIR)
  185.  
  186. #######################################
  187. # dependencies
  188. #######################################
  189. -include $(wildcard $(BUILD_DIR)/*.d)
  190.  
  191. # *** EOF ***
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement