################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf *.lst *.lis *.lpp *.map

# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CC_UPPER_DEPS)),)
-include $(CC_UPPER_DEPS)
endif
ifneq ($(strip $(C++_UPPER_DEPS)),)
-include $(C++_UPPER_DEPS)
endif
ifneq ($(strip $(CXX_UPPER_DEPS)),)
-include $(CXX_UPPER_DEPS)
endif
ifneq ($(strip $(CPP_UPPER_DEPS)),)
-include $(CPP_UPPER_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(SRC_UPPER_DEPS)),)
-include $(SRC_UPPER_DEPS)
endif
ifneq ($(strip $(S_DEPS)),)
-include $(S_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(SRC_DEPS)),)
-include $(SRC_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 
LIBRARY_GENERATOR_OUTPUTTYPE_OUTPUTS += \
libOPH5000EN.a \

LINKER_OUTPUT_OUTPUTS += \
OPH5000EN.x \


# All Target
# Main-build Target
all: OPH5000EN.mot
	@echo 'Build complete.'

# Tool invocations
OPH5000EN.mot: $(LINKER_OUTPUT_OUTPUTS)
	@echo 'Invoking: Objcopy'
	rx-elf-objcopy -O srec -I elf32-rx-be-ns  $(LINKER_OUTPUT_OUTPUTS)"OPH5000EN.mot"
	@echo 'Finished building target:'
	@echo.
	$(MAKE) --no-print-directory post-build

libOPH5000EN.a: 
	@echo 'Invoking: Library Generator'
	rx-elf-libgen --select-lib=optlib --header-files=all --compiler-options=-mcpu=rx610,-mlittle-endian-data,-Os,-ffunction-sections,-fdata-sections,-fno-function-cse,-fsection-anchors,-free,-flto-compression-level=0,-fno-cse-follow-jumps,-fno-jump-tables,-fno-guess-branch-probability,-fno-move-loop-invariants --assembler-options=--mlittle-endian-data -o "libOPH5000EN.a"
	@echo 'Finished building:'
	@echo.

OPH5000EN.x: $(OBJS) $(LIBRARY_GENERATOR_OUTPUTTYPE_OUTPUTS) $(ALL_ASMS)
	@echo 'Invoking: Linker'
	@echo 'Building target:'
	rx-elf-ld -o "OPH5000EN.x" -T"C:\e2_workspace\OPH5000EN\Release\OPH5000EN_Release_auto.gsi" -T"C:\e2_workspace\OPH5000EN\Release\LinkerSubCommand.tmp" $(USER_OBJS) $(LIBS) $(LIBRARY_GENERATOR_OUTPUTTYPE_OUTPUTS) -warn-common -warn-once -L"C:\e2_workspace\OPH5000EN\Release" --start-group -lOPH5000EN --end-group -M=OPH5000EN.map
	@echo 'Finished building:'
	@echo.

# Other Targets
clean:
	-$(RM) $(LINKER_OUTPUT_OUTPUTS)$(LIBRARY_GENERATOR_OUTPUTTYPE_OUTPUTS)$(OBJCOPY_OUTPUTTYPE_OUTPUTS)
	rm -rf ./"src"/*.o ./"src"/*.d  OPH5000EN.mot
	@echo.
	@echo 'Clean complete.'

post-build:
	@echo.
	-copy ..\rx_checksum.exe .  
	@echo.
	- rx-elf-nm -n OPH5000EN.x > OPH5000EN.sym 
	@echo.
	- rx-elf-objdump -h -S OPH5000EN.x > OPH5000EN.lss 
	@echo.
	- rx-elf-objcopy -O ihex OPH5000EN.x OPH5000EN.hex 
	@echo.
	- rx_checksum -m OPH5000i OPH5000EN.hex 
	@echo.
	- rx-elf-objcopy -I ihex -O binary --gap-fill  0xff  OPH5000EN.hex OPH5000EN.bin
	@echo.

.PHONY: all clean dependents
.SECONDARY: post-build

-include ../makefile.targets
