| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- ##########################################################################################################################
- # File automatically-generated by tool: [projectgenerator] version: [3.19.2] date: [Mon Apr 15 16:54:52 CST 2024]
- ##########################################################################################################################
- # ------------------------------------------------
- # Generic Makefile (based on gcc)
- #
- # ChangeLog :
- # 2017-02-10 - Several enhancements + project update mode
- # 2015-07-22 - first version
- # ------------------------------------------------
- ######################################
- # target
- ######################################
- TARGET = V9_AG_PMU_APP_EFTZ_
- ######################################
- # building variables
- ######################################
- # debug build?
- DEBUG = 1
- # optimization
- OPT = -O0
- #######################################
- # paths
- #######################################
- # Build path
- BUILD_DIR = build
- BIN_FILE = binfile
- ######################################
- # source
- ######################################
- # C sources
- STD_LIB = \
- Core/Src/main.c \
- Core/Src/stm32f4xx_it.c \
- Core/Src/stm32f4xx_hal_msp.c \
- Core/Src/stm32f4xx_hal_timebase_tim.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_adc.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c \
- Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \
- Core/Src/system_stm32f4xx.c \
- Middlewares/Third_Party/RealThread_RTOS/src/clock.c \
- Middlewares/Third_Party/RealThread_RTOS/src/components.c \
- Middlewares/Third_Party/RealThread_RTOS/src/cpu.c \
- Middlewares/Third_Party/RealThread_RTOS/src/idle.c \
- Middlewares/Third_Party/RealThread_RTOS/src/ipc.c \
- Middlewares/Third_Party/RealThread_RTOS/src/irq.c \
- Middlewares/Third_Party/RealThread_RTOS/src/kservice.c \
- Middlewares/Third_Party/RealThread_RTOS/src/mem.c \
- Middlewares/Third_Party/RealThread_RTOS/src/memheap.c \
- Middlewares/Third_Party/RealThread_RTOS/src/mempool.c \
- Middlewares/Third_Party/RealThread_RTOS/src/object.c \
- Middlewares/Third_Party/RealThread_RTOS/src/scheduler.c \
- Middlewares/Third_Party/RealThread_RTOS/src/slab.c \
- Middlewares/Third_Party/RealThread_RTOS/src/thread.c \
- Middlewares/Third_Party/RealThread_RTOS/src/timer.c \
- Middlewares/Third_Party/RealThread_RTOS/libcpu/arm/cortex-m4/cpuport.c \
- Middlewares/Third_Party/RealThread_RTOS/bsp/_template/cubemx_config/board.c \
- Middlewares/Third_Party/RealThread_RTOS/components/finsh/cmd.c \
- Middlewares/Third_Party/RealThread_RTOS/components/finsh/finsh_port.c \
- Middlewares/Third_Party/RealThread_RTOS/components/finsh/msh.c \
- Middlewares/Third_Party/RealThread_RTOS/components/finsh/shell.c \
- Middlewares/Third_Party/RealThread_RTOS/components/device/device.c
- USER_SOURCES += $(wildcard user_src/*.c)
- C_SOURCES = $(STD_LIB)
- C_SOURCES += $(USER_SOURCES)
- # ASM sources
- ASM_SOURCES = \
- startup_stm32f405xx.s \
- Middlewares/Third_Party/RealThread_RTOS/libcpu/arm/cortex-m4/context_gcc.s
- #######################################
- # binaries
- #######################################
- PREFIX = arm-none-eabi-
- # The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx)
- # either it can be added to the PATH environment variable.
- ifdef GCC_PATH
- CC = $(GCC_PATH)/$(PREFIX)gcc
- AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp
- CP = $(GCC_PATH)/$(PREFIX)objcopy
- SZ = $(GCC_PATH)/$(PREFIX)size
- else
- CC = $(PREFIX)gcc
- AS = $(PREFIX)gcc -x assembler-with-cpp
- CP = $(PREFIX)objcopy
- SZ = $(PREFIX)size
- endif
- HEX = $(CP) -O ihex
- BIN = $(CP) -O binary -S
-
- #######################################
- # CFLAGS
- #######################################
- # cpu
- CPU = -mcpu=cortex-m4
- # fpu
- FPU = -mfpu=fpv4-sp-d16
- # float-abi
- #FLOAT-ABI = -mfloat-abi=hard
- FLOAT-ABI = -mfloat-abi=soft
- # mcu
- MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
- # macros for gcc
- # AS defines
- AS_DEFS =
- # C defines
- C_DEFS = \
- -DUSE_HAL_DRIVER \
- -DSTM32F405xx
- # AS includes
- AS_INCLUDES =
- # C includes
- C_INCLUDES = \
- -IRT-Thread \
- -ICore/Inc \
- -IDrivers/STM32F4xx_HAL_Driver/Inc \
- -IDrivers/STM32F4xx_HAL_Driver/Inc/Legacy \
- -IDrivers/CMSIS/Device/ST/STM32F4xx/Include \
- -IDrivers/CMSIS/Include \
- -IMiddlewares/Third_Party/RealThread_RTOS/include/ \
- -IMiddlewares/Third_Party/RealThread_RTOS/bsp/_template/cubemx_config \
- -IMiddlewares/Third_Party/RealThread_RTOS/finsh/ \
- -IMiddlewares/Third_Party/RealThread_RTOS/components/finsh \
- -Iuser_inc \
- # 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)"
- #######################################
- # LDFLAGS
- #######################################
- # link script
- LDSCRIPT = STM32F405RGTx_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 $@
- @echo $(notdir $(<:.c=.o))
- $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
- @$(AS) -c $(CFLAGS) $< -o $@
- @echo $(notdir $(<:.s=.o))
- $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
- @$(CC) $(OBJECTS) $(LDFLAGS) -o $@
- @echo linking...
- $(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 $(BUILD_DIR)
-
- #######################################
- # dependencies
- #######################################
- -include $(wildcard $(BUILD_DIR)/*.d)
- # *** EOF ***
|