274 lines
		
	
	
		
			8.3 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			274 lines
		
	
	
		
			8.3 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
##########################################################################################################################
 | 
						|
# File automatically-generated by tool: [projectgenerator] version: [2.27.0] date: [Sat Mar 03 17:52:11 CET 2018] 
 | 
						|
##########################################################################################################################
 | 
						|
 | 
						|
# ------------------------------------------------
 | 
						|
# Generic Makefile (based on gcc)
 | 
						|
#
 | 
						|
# ChangeLog :
 | 
						|
#	2017-02-10 - Several enhancements + project update mode
 | 
						|
#   2015-07-22 - first version
 | 
						|
# ------------------------------------------------
 | 
						|
 | 
						|
######################################
 | 
						|
# target
 | 
						|
######################################
 | 
						|
TARGET = ovi40-H7
 | 
						|
 | 
						|
 | 
						|
######################################
 | 
						|
# building variables
 | 
						|
######################################
 | 
						|
# debug build?
 | 
						|
DEBUG = 1
 | 
						|
# optimization
 | 
						|
OPT = -Og
 | 
						|
 | 
						|
 | 
						|
#######################################
 | 
						|
# paths
 | 
						|
#######################################
 | 
						|
# source path
 | 
						|
SOURCES_DIR =  \
 | 
						|
Drivers/CMSIS \
 | 
						|
Drivers \
 | 
						|
Application/User \
 | 
						|
Middlewares \
 | 
						|
Application/MAKEFILE \
 | 
						|
Drivers/STM32H7xx_HAL_Driver \
 | 
						|
Middlewares/FatFs \
 | 
						|
Middlewares/USB_Host_Library \
 | 
						|
Application \
 | 
						|
Middlewares/USB_Device_Library
 | 
						|
 | 
						|
# firmware library path
 | 
						|
PERIFLIB_PATH = 
 | 
						|
 | 
						|
# Build path
 | 
						|
BUILD_DIR = build
 | 
						|
 | 
						|
######################################
 | 
						|
# source
 | 
						|
######################################
 | 
						|
# C sources
 | 
						|
C_SOURCES =  \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ctlreq.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hcd.c \
 | 
						|
Src/usb_device.c \
 | 
						|
Src/stm32h7xx_hal_msp.c \
 | 
						|
Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src/usbd_audio.c \
 | 
						|
Src/usbd_audio_if.c \
 | 
						|
Src/adc.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_fmc.c \
 | 
						|
Src/stm32h7xx_it.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash_ex.c \
 | 
						|
Src/usbh_diskio.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid_keybd.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_mdma.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_flash.c \
 | 
						|
Src/usb_host.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_gpio.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_ioreq.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd_ex.c \
 | 
						|
Middlewares/Third_Party/FatFs/src/ff.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid_parser.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma_ex.c \
 | 
						|
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_i2c_ex.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_sram.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr.c \
 | 
						|
Src/usbd_conf.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c \
 | 
						|
Src/spi.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac_ex.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rtc.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Src/usbh_mtp.c \
 | 
						|
Src/gpio.c \
 | 
						|
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \
 | 
						|
Middlewares/Third_Party/FatFs/src/option/syscall.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_sai.c \
 | 
						|
Src/usbh_conf.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Src/usbh_audio.c \
 | 
						|
Middlewares/Third_Party/FatFs/src/diskio.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rtc_ex.c \
 | 
						|
Src/fatfs.c \
 | 
						|
Src/system_stm32h7xx.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_sai_ex.c \
 | 
						|
Src/dac.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dac.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/CDC/Src/usbh_cdc.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_bot.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/MTP/Src/usbh_mtp_ptp.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid_mouse.c \
 | 
						|
Src/dma.c \
 | 
						|
Src/usbd_desc.c \
 | 
						|
Middlewares/Third_Party/FatFs/src/ff_gen_drv.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pcd.c \
 | 
						|
Src/sai.c \
 | 
						|
Src/tim.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc_ex.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi.c \
 | 
						|
Src/i2c.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_pipes.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c \
 | 
						|
Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \
 | 
						|
Src/fmc.c \
 | 
						|
Src/main.c \
 | 
						|
Src/rtc.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_adc_ex.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c \
 | 
						|
Middlewares/ST/STM32_USB_Host_Library/Class/MSC/Src/usbh_msc_scsi.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_ll_usb.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_spi_ex.c \
 | 
						|
Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_hsem.c
 | 
						|
 | 
						|
# ASM sources
 | 
						|
ASM_SOURCES =  \
 | 
						|
startup_stm32h743xx.s
 | 
						|
 | 
						|
 | 
						|
######################################
 | 
						|
# firmware library
 | 
						|
######################################
 | 
						|
PERIFLIB_SOURCES = 
 | 
						|
 | 
						|
 | 
						|
#######################################
 | 
						|
# binaries
 | 
						|
#######################################
 | 
						|
BINPATH = 
 | 
						|
PREFIX = arm-none-eabi-
 | 
						|
CC = $(BINPATH)/$(PREFIX)gcc
 | 
						|
AS = $(BINPATH)/$(PREFIX)gcc -x assembler-with-cpp
 | 
						|
CP = $(BINPATH)/$(PREFIX)objcopy
 | 
						|
AR = $(BINPATH)/$(PREFIX)ar
 | 
						|
SZ = $(BINPATH)/$(PREFIX)size
 | 
						|
HEX = $(CP) -O ihex
 | 
						|
BIN = $(CP) -O binary -S
 | 
						|
 
 | 
						|
#######################################
 | 
						|
# CFLAGS
 | 
						|
#######################################
 | 
						|
# cpu
 | 
						|
CPU = -mcpu=cortex-m7
 | 
						|
 | 
						|
# fpu
 | 
						|
FPU = -mfpu=fpv5-d16
 | 
						|
 | 
						|
# float-abi
 | 
						|
FLOAT-ABI = -mfloat-abi=hard
 | 
						|
 | 
						|
# mcu
 | 
						|
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
 | 
						|
 | 
						|
# macros for gcc
 | 
						|
# AS defines
 | 
						|
AS_DEFS = 
 | 
						|
 | 
						|
# C defines
 | 
						|
C_DEFS =  \
 | 
						|
-DUSE_HAL_DRIVER \
 | 
						|
-DSTM32H743xx
 | 
						|
 | 
						|
 | 
						|
# AS includes
 | 
						|
AS_INCLUDES = 
 | 
						|
 | 
						|
# C includes
 | 
						|
C_INCLUDES =  \
 | 
						|
-IInc \
 | 
						|
-IDrivers/STM32H7xx_HAL_Driver/Inc \
 | 
						|
-IDrivers/STM32H7xx_HAL_Driver/Inc/Legacy \
 | 
						|
-IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc \
 | 
						|
-IMiddlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc \
 | 
						|
-IMiddlewares/ST/STM32_USB_Host_Library/Core/Inc \
 | 
						|
-IMiddlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Inc \
 | 
						|
-IMiddlewares/ST/STM32_USB_Host_Library/Class/CDC/Inc \
 | 
						|
-IMiddlewares/ST/STM32_USB_Host_Library/Class/HID/Inc \
 | 
						|
-IMiddlewares/ST/STM32_USB_Host_Library/Class/MSC/Inc \
 | 
						|
-IMiddlewares/ST/STM32_USB_Host_Library/Class/MTP/Inc \
 | 
						|
-IDrivers/CMSIS/Device/ST/STM32H7xx/Include \
 | 
						|
-IMiddlewares/Third_Party/FatFs/src \
 | 
						|
-IDrivers/CMSIS/Include
 | 
						|
 | 
						|
 | 
						|
# compile gcc flags
 | 
						|
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
 | 
						|
 | 
						|
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
 | 
						|
 | 
						|
ifeq ($(DEBUG), 1)
 | 
						|
CFLAGS += -g -gdwarf-2
 | 
						|
endif
 | 
						|
 | 
						|
 | 
						|
# Generate dependency information
 | 
						|
CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)"
 | 
						|
 | 
						|
 | 
						|
#######################################
 | 
						|
# LDFLAGS
 | 
						|
#######################################
 | 
						|
# link script
 | 
						|
LDSCRIPT = STM32H743ZITx_FLASH.ld
 | 
						|
 | 
						|
# libraries
 | 
						|
LIBS = -lc -lm -lnosys
 | 
						|
LIBDIR =
 | 
						|
LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
 | 
						|
 | 
						|
# default action: build all
 | 
						|
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
 | 
						|
 | 
						|
 | 
						|
#######################################
 | 
						|
# build the application
 | 
						|
#######################################
 | 
						|
# list of objects
 | 
						|
OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o)))
 | 
						|
vpath %.c $(sort $(dir $(C_SOURCES)))
 | 
						|
# list of ASM program objects
 | 
						|
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o)))
 | 
						|
vpath %.s $(sort $(dir $(ASM_SOURCES)))
 | 
						|
 | 
						|
$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 
 | 
						|
	$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
 | 
						|
 | 
						|
$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
 | 
						|
	$(AS) -c $(CFLAGS) $< -o $@
 | 
						|
 | 
						|
$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
 | 
						|
	$(CC) $(OBJECTS) $(LDFLAGS) -o $@
 | 
						|
	$(SZ) $@
 | 
						|
 | 
						|
$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
 | 
						|
	$(HEX) $< $@
 | 
						|
	
 | 
						|
$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR)
 | 
						|
	$(BIN) $< $@	
 | 
						|
	
 | 
						|
$(BUILD_DIR):
 | 
						|
	mkdir $@		
 | 
						|
 | 
						|
#######################################
 | 
						|
# clean up
 | 
						|
#######################################
 | 
						|
clean:
 | 
						|
	-rm -fR .dep $(BUILD_DIR)
 | 
						|
  
 | 
						|
#######################################
 | 
						|
# dependencies
 | 
						|
#######################################
 | 
						|
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
 | 
						|
 | 
						|
# *** EOF ***
 |