################################################################################
# 自动生成的文件。不要编辑！
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include libraries/ES32W3120_MD_StdPeriph_Driver/Source/subdir.mk
-include libraries/ES32W3120_ALD_StdPeriph_Driver/Source/subdir.mk
-include libraries/CMSIS/Device/EastSoft/ES32W3120/System/subdir.mk
-include libraries/CMSIS/Device/EastSoft/ES32W3120/Startup/gcc/subdir.mk
-include applications/src/subdir.mk
-include Middlewares/Third_Party/RTT/subdir.mk
-include Middlewares/EastSoft/essemi_swd_print/Source/subdir.mk
-include Middlewares/EastSoft/BLE5.0/Profile/ota/subdir.mk
-include Middlewares/EastSoft/BLE5.0/Profile/led/subdir.mk
-include Middlewares/EastSoft/BLE5.0/Log/Source/subdir.mk
-include Middlewares/EastSoft/BLE5.0/Lib/Source/subdir.mk
-include subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(S_DEPS)),)
-include $(S_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 
SECONDARY_FLASH += \
rtthread.bin \

SECONDARY_SIZE += \
rtthread.siz \


# 所有目标
all: rtthread.elf secondary-outputs

# 工具调用
rtthread.elf: $(OBJS) $(USER_OBJS)
	arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -ffunction-sections -fdata-sections -Wall  -g -gdwarf-2 -T "D:\ESW_SDK\RTT-Studio\linkscripts\ES32W3120NK\link.lds" -Xlinker --gc-sections -Wl,-Map,"rtthread.map" -Xlinker --cref -o "rtthread.elf" $(OBJS) $(USER_OBJS) $(LIBS)
	$(MAKE) --no-print-directory post-build

rtthread.bin: rtthread.elf
	arm-none-eabi-objcopy -O binary "rtthread.elf"  "rtthread.bin"

rtthread.siz: rtthread.elf
	arm-none-eabi-size --format=berkeley "rtthread.elf"

# 其他目标
clean:
	-$(RM) $(OBJS)$(SECONDARY_FLASH)$(SECONDARY_SIZE)$(ASM_DEPS)$(S_DEPS)$(S_UPPER_DEPS)$(C_DEPS) rtthread.elf
	-@echo ' '

post-build:
	-arm-none-eabi-objcopy -O ihex "rtthread.elf" "rtthread.hex"
	-@echo ' '

secondary-outputs: $(SECONDARY_FLASH) $(SECONDARY_SIZE)

.PHONY: all clean dependents post-build

-include ../makefile.targets
