1 Star 0 Fork 1

Joel/HaiHe_Project

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 10.82 KB
一键复制 编辑 原始数据 按行查看 历史
Joel 提交于 2022-12-01 15:21 . add taihe online and heart analysis
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [3.4.0] date: [Fri Nov 22 10:13:09 CST 2019]
##########################################################################################################################
# ------------------------------------------------
# Generic Makefile (based on gcc)
#
# ChangeLog :
# 2022-02-10 - Support HaiHe_Project
# 2017-02-10 - Several enhancements + project update mode
# 2015-07-22 - first version
# ------------------------------------------------
######################################
# target
######################################
TARGET = vs_code_gd103
# LITEOS_Support
NO_OS = 0
# LITEOS_Support
LITEOS = 0
# FREERTOS_Support
FREERTOS = 1
######################################
# building variables
######################################
# debug build?
DEBUG = 1
RTT_PRINTF = 0
SYSTEM_VIEW = 1
# optimization
OPT = -Og
#######################################
# paths
#######################################
# Build path
BUILD_DIR = build
######################################
# source
######################################
# C sources
C_SOURCES = \
user_app/main.c\
######################################
# board_driver C files
######################################
# C sources
C_SOURCES += \
board_driver/rtc.c \
board_driver/time_slice.c \
board_driver/user_timer.c \
board_driver/linklist.c \
board_driver/user_fwdgt.c \
board_driver/key.c \
board_driver/led.c \
board_driver/drv_flash.c \
board_driver/beep.c \
board_driver/relay.c \
board_driver/power_monitor.c \
board_driver/crc.c \
board_driver/sensor.c \
board_driver/oxygen_sensor.c \
board_driver/hlw8012.c \
board_driver/new_g4_cat1.c\
board_driver/taihe_client.c \
######################################
# GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral
######################################
# C sources
C_SOURCES += \
GD32F10x_Firmware_Library_V2.2.3/Utilities/gd32f10x_eval.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_adc.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_bkp.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_can.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_crc.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dac.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dbg.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_dma.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_enet.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exmc.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_exti.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fmc.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_fwdgt.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_gpio.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_i2c.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_misc.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_pmu.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rcu.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_rtc.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_sdio.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_spi.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_timer.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_usart.c \
GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Source/gd32f10x_wwdgt.c \
# driver sources
ifeq ($(RTT_PRINTF),1)
C_SOURCES += \
$(wildcard jlink_rtt/*.c)
endif
# driver sources
ifeq ($(SYSTEM_VIEW),1)
C_SOURCES += \
SystemView/Src/SEGGER/Syscalls/SEGGER_RTT_Syscalls_GCC.c\
SystemView/Src/SEGGER/SEGGER_RTT_printf.c\
SystemView/Src/SEGGER/SEGGER_RTT.c\
SystemView/Src/SEGGER/SEGGER_SYSVIEW.c\
SystemView/Src/Sample/FreeRTOSV10.4/Config/Cortex-M/SEGGER_SYSVIEW_Config_FreeRTOS.c\
SystemView/Src/Sample/FreeRTOSV10.4/SEGGER_SYSVIEW_FreeRTOS.c
endif
######################################
# GD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral
######################################
# C sources
C_SOURCES += \
GD32F10x_Firmware_Library_V2.2.3/Firmware/CMSIS/GD/GD32F10x/Source/system_gd32f10x.c \
GD32F10x_Firmware_Library_V2.2.3/Template/gd32f10x_it.c \
GD32F10x_Firmware_Library_V2.2.3/Template/systick.c \
# liteOs sources
# C_SOURCES 新添加的文件
ifeq ($(LITEOS),1)
C_SOURCES += \
rtos/app_liteos_task.c \
LiteOS/arch/arm/arm_m/cortex-m3/los_exc.c \
$(wildcard LiteOS/arch/arm/arm_m/src/*.c)\
$(wildcard LiteOS/kernel/base/core/*.c)\
$(wildcard LiteOS/kernel/base/ipc/*.c)\
LiteOS/kernel/base/mem/bestfit_little/los_heap.c \
LiteOS/kernel/base/mem/bestfit_little/los_memory.c \
$(wildcard LiteOS/kernel/base/mem/common/*.c)\
LiteOS/kernel/base/mem/membox/los_membox.c \
LiteOS/kernel/base/misc/los_misc.c \
LiteOS/kernel/base/om/los_err.c \
LiteOS/kernel/extended/tickless/los_tickless.c \
LiteOS/kernel/los_init.c \
LiteOS/osdepends/liteos/cmsis/cmsis_liteos.c
endif
# freertos sources
# C_SOURCES 新添加的文件
ifeq ($(FREERTOS),1)
C_SOURCES += \
rtos/app_freertos_task.c \
$(wildcard FreeRTOS/Source/*.c) \
FreeRTOS/Source/portable/MemMang/heap_3.c \
FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
endif
# ASM sources
ASM_SOURCES = \
mcu_setting/startup_gd32f103xb.s
ifeq ($(LITEOS),1)
ASM_SOURCES += \
rtos/LiteOS/los_dispatch_gcc.s
endif
ifeq ($(SYSTEM_VIEW),1)
ASM_SOURCES_S = \
SystemView/Src/SEGGER/SEGGER_RTT_ASM_ARMv7M.S
endif
#######################################
# binaries mcu_setting/context_gcc.s \
#######################################
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-m3
# fpu
# NONE for Cortex-M0/M0+/M3
# float-abi
# mcu
MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI)
# macros for gcc
# AS defines
AS_DEFS =
# C defines
C_DEFS = \
-DUSE_STDPERIPH_DRIVER \
-DGD32F10X_HD
ifeq ($(NO_OS),1)
C_DEFS += \
-DNO_OS
endif
ifeq ($(LITEOS),1)
C_DEFS += \
-DLITEOS
endif
ifeq ($(FREERTOS),1)
C_DEFS += \
-DFREERTOS
endif
ifeq ($(RTT_PRINTF),1)
C_DEFS += \
-DRTT_PRINTF
endif
ifeq ($(SYSTEM_VIEW),1)
C_DEFS += \
-DSYSTEM_VIEW
endif
# AS includes
AS_INCLUDES =
# C includes
C_INCLUDES = \
-Iuser_app \
-Iboard_driver \
-Irtos \
-IGD32F10x_Firmware_Library_V2.2.3/Firmware/GD32F10x_standard_peripheral/Include \
-IGD32F10x_Firmware_Library_V2.2.3/Firmware/CMSIS/GD/GD32F10x/Include \
-IGD32F10x_Firmware_Library_V2.2.3/Template \
-IGD32F10x_Firmware_Library_V2.2.3/Utilities \
-IGD32F10x_Firmware_Library_V2.2.3/Firmware/CMSIS \
# C includes RTT_PRINTF
ifeq ($(RTT_PRINTF),1)
C_INCLUDES += \
-Ijlink_rtt \
-Ijlink_rtt/Config
endif
# C includes SYSTEM_VIEW
ifeq ($(SYSTEM_VIEW),1)
C_INCLUDES += \
-ISystemView/Src/Sample/FreeRTOSV10.4 \
-ISystemView/Src/Config\
-ISystemView/Src/SEGGER
endif
# C includes LITEOS
ifeq ($(LITEOS),1)
C_INCLUDES += \
-ILiteOS/arch/arm/arm_m/cortex-m3 \
-ILiteOS/arch/arm/arm_m/include \
-ILiteOS/arch/arm/common/cmsis \
-ILiteOS/kernel/base/include \
-ILiteOS/kernel/extended/include \
-ILiteOS/kernel/include \
-ILiteOS/osdepends/liteos/cmsis \
-ILiteOS/OS_CONFIG
endif
# C includes FREERTOS
ifeq ($(FREERTOS),1)
C_INCLUDES += \
-IFreeRTOS/OS_CONFIG \
-IFreeRTOS/Source/include \
-IFreeRTOS/Source/portable/GCC/ARM_CM3
endif
# 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 = mcu_setting/gd32F103RBTX_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)))
ifeq ($(SYSTEM_VIEW),1)
OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES_S:.S=.o)))
vpath %.S $(sort $(dir $(ASM_SOURCES_S)))
$(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)
$(AS) -c $(CFLAGS) $< -o $@
endif
$(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 $(BUILD_DIR)
#######################################
# dependencies # -rm -fR $(BUILD_DIR)
#######################################
-include $(wildcard $(BUILD_DIR)/*.d)
# *** EOF ***
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/YIJia_Kitchen_Bath/HaiHe_Source_Code.git
git@gitee.com:YIJia_Kitchen_Bath/HaiHe_Source_Code.git
YIJia_Kitchen_Bath
HaiHe_Source_Code
HaiHe_Project
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385