################################################################################
# Automatically-generated file. Do not edit!
################################################################################
TARGET=S32K312
-include config.mk
-include ../makefile.init
-include ../partno.mk

RM := $(CWD)/rm -rf

################################################################################
# All of the sources participating in the build are defined here
################################################################################
-include sources.mk
-include src/app/template/subdir.mk
-include src/app/Log/subdir.mk
-include src/app/Shell/subdir.mk
-include src/service/template/subdir.mk
-include src/subdir.mk
-include src/gpio/subdir.mk
-include generate/src/subdir.mk
-include board/subdir.mk
-include rtd/src/subdir.mk
-include project_settings/Startup_Code/subdir.mk
-include FreeRTOS/Source/portable/MemMang/subdir.mk
-include FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/subdir.mk
-include FreeRTOS/Source/subdir.mk
-include src/log_manager_task/subdir.mk
-include src/monitor_task/subdir.mk
-include src/service/taskcreate/subdir.mk
-include src/service/seqproc/subdir.mk
-include src/service/I2c/subdir.mk
-include src/service/Uart/subdir.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
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 += \
$(TARGET).srec \

SECONDARY_LIST += \
$(TARGET).lst \

SECONDARY_SIZE += \
$(TARGET).siz \

ALL_TARGET= \
$(TARGET).srec \
$(TARGET).lst \
$(TARGET).siz \
$(TARGET).elf \
$(TARGET).map \

################################################################################
# All Target
################################################################################
all: $(TARGET).elf secondary-outputs
ifeq ($(PROJECT_CONFIG),RELEASE_BLOCK0)
#	$(Q)$(SREC_PATH)/srec_cat.exe $(OUT)/$(TARGET).srec $(OUT)/$(BOOT).srec -o $(OUT)/$@1.hex
	$(Q)$(CWD)/cp $(OUT)/$(TARGET).srec $(OUT)/$@1.hex
	@$(PRT) -e '[ BLOCK0 ]\n $@1.hex created! '
endif
ifeq ($(PROJECT_CONFIG),RELEASE_BLOCK1)
#	$(Q)$(SREC_PATH)/srec_cat.exe $(OUT)/$(TARGET).srec $(OUT)/$(BOOT).srec -o $(OUT)/$@2.hex
	$(Q)$(CWD)/cp $(OUT)/$(TARGET).srec $(OUT)/$@2.hex
	@$(PRT) -e '[ BLOCK1 ]\n $@2.hex created! '
endif
ifeq ($(PROJECT_CONFIG),DEBUG_SWLM0)
	@$(PRT) '[ DEBUG_SWLM0 ]'
endif
ifeq ($(PROJECT_CONFIG),DEBUG_SWLM1)
	@$(PRT) '[ DEBUG_SWLM1 ]'
endif
	$(Q)$(call DONE,$(OUT)/$<)
	@$(PRT) ' '
	@$(wtime)
	@$(PRT) ' '

$(RELEASE): $(RELEASE).vbb credirs all
	$(Q)$(SREC_PATH)/srec_cat.exe $(OUT)/all1.hex $(OUT)/all2.hex -o $(OUT)/all.hex
	$(Q)$(call RDONE,$(OUT)/all.hex)
#	$(Q)$(CWD)/cp $(OUT)/all.hex $(dir_s3)/$(PART_NUMBER).hex
#	$(Q)$(CWD)/cp $(OUT)/$(TARGET).elf $(dir_mcu_elf)/$(TARGET).elf
#	$(Q)$(CWD)/cp $(OUT)/$(TARGET).map $(dir_mcu_r_ver)/$(TARGET).map
ifneq ($(GEEA_VERSION),)
#	echo ""
#	$(VBFCONVERT) $(OUT)/$<
#	@if [ ! -f $(OUT)/$(TARGET).vbf ]; then echo "$(TARGET).vbf	error created!!!"; else echo "$(TARGET).vbf	created!"; fi
#	$(VBF_SIGN_TOOLS) $(OUT)/$(TARGET).vbf $(dir_geea_sbl)/$(PART_NUMBER).$(VBFCONVERT_SUFFIX) DontCreate $(VBF_SIGN_PATH_WHOLE)/Private_key_Req_1609_rev_5.xml
#	$(REPLACE_TOOLS) $(dir_geea_sbl)/$(PART_NUMBER).$(VBFCONVERT_SUFFIX) $(REPLACE_STRING) $(REPLACED_STRING)
#	@$(RM) $(OUT)/$(TARGET).vbf $(OUT)/$<
else
#	@-$(RM) $(OUT)/$(TARGET).vbf $(OUT)/$<
#	@echo "$(TARGET).vbf not created!!!"
endif
	@$(PRT) ' '
	@$(wtime)
	@$(PRT) ' '

$(DEVELOP): $(DEVELOP).vbb credirs all
	$(Q)$(SREC_PATH)/srec_cat.exe $(OUT)/all1.hex $(OUT)/all2.hex -o $(OUT)/all.hex
	$(Q)$(call DDONE,$(OUT)/all.hex)
#	$(Q)$(CWD)/cp $(OUT)/all.hex $(dir_s3)/$(PART_NUMBER).hex
#	$(Q)$(CWD)/cp $(OUT)/$(TARGET).elf $(dir_mcu_elf)/$(TARGET).elf
#	$(Q)$(CWD)/cp $(OUT)/$(TARGET).map $(dir_mcu_r_ver)/$(TARGET).map
ifneq ($(GEEA_VERSION),)
#	$(VBFCONVERT) $(OUT)/$<
#	@if [ ! -f $(OUT)/$(TARGET).vbf ]; then echo "$(TARGET).vbf	error created!!!"; else echo "$(TARGET).vbf	created!"; fi
#	$(VBF_SIGN_TOOLS) $(OUT)/$(TARGET).vbf $(dir_geea_sbl)/$(PART_NUMBER).$(VBFCONVERT_SUFFIX) DontCreate $(VBF_SIGN_PATH_WHOLE)/Private_key_Req_1609_rev_5.xml
#	$(REPLACE_TOOLS) $(dir_geea_sbl)/$(PART_NUMBER).$(VBFCONVERT_SUFFIX) $(REPLACE_STRING) $(REPLACED_STRING)
#	@$(RM) $(OUT)/$(TARGET).vbf $(OUT)/$<
else
#	@-$(RM) $(OUT)/$(TARGET).vbf $(OUT)/$<
#	@echo "$(TARGET).vbf not created!!!"
endif
	@$(PRT) ' '
	@$(wtime)
	@$(PRT) ' '

vbf: $(TARGET).vbf
	@$(PRT) ' '
	@$(wtime)
	@$(PRT) ' '

out:
	@$(call create_dir,$@)
################################################################################
# Tool invocations
################################################################################
$(TARGET).elf: $(OBJS) $(LDFILE) $(USER_OBJS) $(OUT)
	@$(CC) $(LDFLAGS) -o $(OUT)/$@ $(OBJS) $(APP_OBJS) $(USER_OBJS) $(LIBS)

$(TARGET).srec: $(TARGET).elf
	@$(OBJCOPY) -O srec $(OUT)/$< $(OUT)/$@

$(TARGET).lst: $(TARGET).elf
	@$(OBJDUMP) --source --all-headers --demangle --line-numbers --wide $(OUT)/$< > $(OUT)/$@

$(TARGET).siz: $(TARGET).elf
	@$(PRT) ' '
	@$(SIZE) --format=berkeley $(OUT)/$<
	@$(PRT) ' '


delfiles:
	@$(PRT) "deleting vbfiles!!!!"
	@-$(RM) $(OUT)/$(F_DEV) $(OUT)/$(F_VBF)

credirs: delfiles
	@$(foreach dir,$(sort $(sbl_dir)),$(call create_dir,${dir}))


# Create input file to create vbf
$(RELEASE).vbb:
	@echo -e '[VBF1]\r\nSourceFile=$(OUT)/$(RELEASE).hex\r\nTargetFile=$(OUT)/$(TARGET).vbf\r\nVBFVersion=2.6\r\nSwType=EXE\r\nCompressed=0\r\nCreateVerificationBlock=1\r\nVerificationBlockStartAddr=005F3E00\r\nAlign=1\r\nAlignBlockSize=100\r\nAlignFillData=FF\r\nSort=1\r\nGroup=0\r\nSwPartNum=$(PART_NUMBER_VBB)\r\nECUaddr=$(ecu_address)\r\nSwVersion=$(GEEA_VERSION)\r\nEraseStart=00400000\r\nEraseLength=00200000\r\n'> $(OUT)/$@

$(DEVELOP).vbb:
	@echo -e '[VBF1]\r\nSourceFile=$(OUT)/$(DEVELOP).hex\r\nTargetFile=$(OUT)/$(TARGET).vbf\r\nVBFVersion=2.6\r\nSwType=EXE\r\nCompressed=0\r\nCreateVerificationBlock=1\r\nVerificationBlockStartAddr=005F3E00\r\nAlign=1\r\nAlignBlockSize=100\r\nAlignFillData=FF\r\nSort=1\r\nGroup=0\r\nSwPartNum=$(PART_NUMBER_VBB)\r\nECUaddr=$(ecu_address)\r\nSwVersion=$(GEEA_VERSION)\r\nEraseStart=00400000\r\nEraseLength=00200000\r\n'> $(OUT)/$@

$(TARGET).vbb:
	@echo -e '[VBF1]\r\nSourceFile=$(OUT)/$(DEVELOP).hex\r\nTargetFile=$(OUT)/$(TARGET).vbf\r\nVBFVersion=2.6\r\nSwType=EXE\r\nCompressed=0\r\nCreateVerificationBlock=1\r\nVerificationBlockStartAddr=005F3E00\r\nAlign=1\r\nAlignBlockSize=100\r\nAlignFillData=FF\r\nSort=1\r\nGroup=0\r\nSwPartNum=$(PART_NUMBER_VBB)\r\nECUaddr=$(ecu_address)\r\nSwVersion=$(GEEA_VERSION)\r\nEraseStart=00400000\r\nEraseLength=00200000\r\n'> $(OUT)/$@


$(TARGET).vbf: $(TARGET).vbb credirs $(TARGET).srec
ifneq ($(GEEA_VERSION),)
	$(VBFCONVERT) $(OUT)/$<
	@if [ ! -f $(OUT)/$@ ]; then echo "$@	error created!!!"; else echo "$@	created!"; fi
	$(VBF_SIGN_TOOLS) $(OUT)/$@ $(dir_geea_sbl)/$(PART_NUMBER).$(VBFCONVERT_SUFFIX) DontCreate $(VBF_SIGN_PATH_WHOLE)/Private_key_Req_1609_rev_5.xml
	$(REPLACE_TOOLS) $(dir_geea_sbl)/$(PART_NUMBER).$(VBFCONVERT_SUFFIX) $(REPLACE_STRING) $(REPLACED_STRING)
	@-$(RM) $(OUT)/$@ $(OUT)/$<
else
	@-$(RM) $(OUT)/$@ $(OUT)/$<
	@echo "$@ not created!!!"
endif

################################################################################
# Other Targets
################################################################################
clean:
	$(Q)$(call del, $(OBJS) $(C_DEPS) $(depfile) $(ALL_TARGET))
	@$(PRT) ' '
	@$(wtime)
	@$(PRT) ' '

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

c:clean

.PHONY: all clean dependents c r d vbf

-include ../makefile.targets
