代码拉取完成,页面将自动刷新
##########################################################################################################################
# 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 :
# 2017-02-10 - Several enhancements + project update mode
# 2015-07-22 - first version
# ------------------------------------------------
######################################
# target
######################################
TARGET = vscode_gd3x0
# choose one of (NO_OS,FREERTOS,LITEOS,TENOS)
# NO_OS Support
NO_OS = 0
# FREERTOS_Support
FREERTOS = 0
# LITEOS_Support
LITEOS = 1
# TENCENTOS_Support
TENOS = 0
######################################
# building variables
######################################
# debug build?
DEBUG = 1
RTT_PRINTF = 1
# optimization
OPT = -Og
#######################################
# paths
#######################################
# Build path
BUILD_DIR = build
######################################
# source
######################################
# C sources
######################################
# GD32F3x0_Firmware_Library_V2.2.1/Firmware/GD32F3x0_standard_peripheral
######################################
# C sources
C_SOURCES += \
$(wildcard Documents/GD32F3x0_Demo_Suites_V2.2.0/GD32F3x0_Firmware_Library/GD32F3x0_standard_peripheral/Source/*.c)\
# driver sources
ifeq ($(RTT_PRINTF),1)
C_SOURCES += \
$(wildcard jlink_rtt/*.c)
endif
######################################
# GD32F3x0_Firmware_Library_V2.2.1/Firmware/GD32F3x0_standard_peripheral
######################################
# C sources
C_SOURCES += \
Documents/GD32F3x0_Demo_Suites_V2.2.0/GD32F3x0_Firmware_Library/CMSIS/GD/GD32F3x0/Source/system_gd32f3x0.c \
######################################
# Board_driver
######################################
# C sources
C_SOURCES += \
$(wildcard board_driver/*.c)
# FREERTOS sources
# C_SOURCES 新添加的文件
ifeq ($(FREERTOS),1)
C_SOURCES += \
app_rtos/app_freertos_task.c \
$(wildcard FreeRTOS/Source/*.c) \
FreeRTOS/Source/portable/MemMang/heap_4.c \
FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
endif
# liteOs sources
# C_SOURCES 新添加的文件
ifeq ($(LITEOS),1)
C_SOURCES += \
app_rtos/app_liteos_task.c \
LiteOS/arch/arm/arm_m/cortex-m4/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
# tencentOS sources
ifeq ($(TENOS),1)
C_SOURCES += \
app_rtos/app_tencentos_task.c\
$(wildcard tencent_os/arch/arm/arm-v7m/cortex-m4/gcc/*.c)\
$(wildcard tencent_os/arch/arm/arm-v7m/common/*.c)\
$(wildcard tencent_os/osal/cmsis_os/cmsis_os.c)\
$(wildcard tencent_os/kernel/core/*.c)\
$(wildcard tencent_os/kernel/core/pm/*.c)
endif
# ASM sources
ifeq ($(LITEOS),1)
ASM_SOURCES = \
Documents/GCC/gd32_los_dispatch_gcc.s \
Documents/GCC/los_dispatch_gcc.s
endif
ifeq ($(FREERTOS),1)
ASM_SOURCES = \
Documents/GCC/freertos.s
endif
ifeq ($(NO_OS),1)
ASM_SOURCES = \
Documents/GCC/startup_gd32f3x0_gcc.s
endif
# ASM TencentOS
ifeq ($(TENOS),1)
ASM_SOURCES = \
Documents/GCC/startup_gd32f3x0_gcc.s
ASM_SOURCES_S = \
tencent_os/arch/arm/arm-v7m/cortex-m4/gcc/port_s.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-m4
# fpu
FPU = -mfpu=fpv4-sp-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_STDPERIPH_DRIVER \
-DGD32F310
ifeq ($(NO_OS),1)
C_DEFS += \
-DNO_OS
endif
ifeq ($(FREERTOS),1)
C_DEFS += \
-DFREERTOS
endif
ifeq ($(LITEOS),1)
C_DEFS += \
-DLITEOS
endif
ifeq ($(TENOS),1)
C_DEFS += \
-DTENCENTOS
endif
ifeq ($(RTT_PRINTF),1)
C_DEFS += \
-DRTT_PRINTF
endif
# AS includes
AS_INCLUDES =
# C includes
C_INCLUDES = \
-IDocuments/GD32F3x0_Demo_Suites_V2.2.0/GD32F3x0_Firmware_Library/CMSIS/GD/GD32F3x0/Include \
-IDocuments/GD32F3x0_Demo_Suites_V2.2.0/GD32F3x0_Firmware_Library/GD32F3x0_standard_peripheral/Include \
-IDocuments/GD32F3x0_Demo_Suites_V2.2.0/GD32F3x0_Firmware_Library/CMSIS \
# C includes Board_driver
C_INCLUDES += \
-Iboard_driver \
# C includes RTT_PRINTF
ifeq ($(RTT_PRINTF),1)
C_INCLUDES += \
-Ijlink_rtt \
-Ijlink_rtt/Config
endif
# C includes FREERTOS
ifeq ($(FREERTOS),1)
C_INCLUDES += \
-Iapp_rtos \
-IFreeRTOS/OS_CONFIG \
-IFreeRTOS/Source/include \
-IFreeRTOS/Source/portable/GCC/ARM_CM4F
endif
# C includes LITEOS
ifeq ($(LITEOS),1)
C_INCLUDES += \
-Iapp_rtos \
-ILiteOS/arch/arm/arm_m/cortex-m4 \
-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 TENOS
ifeq ($(TENOS),1)
C_INCLUDES += \
-Iapp_rtos \
-Itencent_os/kernel/core/include \
-Itencent_os/kernel/pm/include \
-Itencent_os/arch/arm/arm-v7m/common/include \
-Itencent_os/arch/arm/arm-v7m/cortex-m4/gcc \
-Itencent_os/TOS_CONFIG \
-Itencent_os/osal/cmsis_os
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
ifeq ($(LITEOS),1)
LDSCRIPT = Documents/GCC/liteos.ld
endif
# link script
ifeq ($(FREERTOS),1)
LDSCRIPT = Documents/GCC/freertos.ld
endif
# link script
ifeq ($(TENOS),1)
LDSCRIPT = Documents/GCC/gd32f3x0.ld
endif
# link script
ifeq ($(NO_OS),1)
LDSCRIPT = Documents/GCC/gd32f3x0.ld
endif
# 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)))
# list of ASM program objects .S
ifeq ($(TENOS),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 ***
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。