################################################################################
# Automatically-generated file. Do not edit!
# Toolchain: GNU Tools for STM32 (14.3.rel1)
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include Drivers/STM32N6xx_HAL_Driver/subdir.mk
-include Drivers/CMSIS/subdir.mk
-include Drivers/BSP/STM32N6xx_Nucleo/subdir.mk
-include Doc/subdir.mk
-include Application/User/subdir.mk
-include Application/Startup/subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
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

OPTIONAL_TOOL_DEPS := \
$(wildcard ../makefile.defs) \
$(wildcard ../makefile.init) \
$(wildcard ../makefile.targets) \


BUILD_ARTIFACT_NAME := XSPI_high_speed_FSBL
BUILD_ARTIFACT_EXTENSION := elf
BUILD_ARTIFACT_PREFIX :=
BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),)

# Add inputs and outputs from these tool invocations to the build variables 
EXECUTABLES += \
XSPI_high_speed_FSBL.elf \

MAP_FILES += \
XSPI_high_speed_FSBL.map \

SIZE_OUTPUT += \
default.size.stdout \

OBJDUMP_LIST += \
XSPI_high_speed_FSBL.list \

OBJCOPY_BIN += \
XSPI_high_speed_FSBL.bin \


# All Target
all:
	+@$(MAKE) --no-print-directory main-build && $(MAKE) --no-print-directory post-build

# Main-build Target
main-build: XSPI_high_speed_FSBL.elf secondary-outputs

# Tool invocations
XSPI_high_speed_FSBL.elf XSPI_high_speed_FSBL.map: $(OBJS) $(USER_OBJS) /mnt/data/work/neAIxt/NUCLEO-N657X0-Q/NUCLEO-N657X0-Q-xspi-high-speed/STM32CubeIDE/FSBL/STM32N657X0HXQ_AXISRAM2_fsbl.ld makefile objects.list $(OPTIONAL_TOOL_DEPS)
	arm-none-eabi-gcc -o "XSPI_high_speed_FSBL.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m55 -T"/mnt/data/work/neAIxt/NUCLEO-N657X0-Q/NUCLEO-N657X0-Q-xspi-high-speed/STM32CubeIDE/FSBL/STM32N657X0HXQ_AXISRAM2_fsbl.ld" --specs=nosys.specs -Wl,-Map="XSPI_high_speed_FSBL.map" -Wl,--gc-sections -static -Wl,--cmse-implib -Wl,--out-implib=./secure_nsclib.o --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
	@echo 'Finished building target: $@'
	@echo ' '

default.size.stdout: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
	arm-none-eabi-size  $(EXECUTABLES)
	@echo 'Finished building: $@'
	@echo ' '

XSPI_high_speed_FSBL.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
	arm-none-eabi-objdump -h -S $(EXECUTABLES) > "XSPI_high_speed_FSBL.list"
	@echo 'Finished building: $@'
	@echo ' '

XSPI_high_speed_FSBL.bin: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
	arm-none-eabi-objcopy  -O binary $(EXECUTABLES) "XSPI_high_speed_FSBL.bin"
	@echo 'Finished building: $@'
	@echo ' '

# Other Targets
clean:
	-$(RM) XSPI_high_speed_FSBL.bin XSPI_high_speed_FSBL.elf XSPI_high_speed_FSBL.list XSPI_high_speed_FSBL.map default.size.stdout
	-@echo ' '

post-build:
	cd "/mnt/data/work/neAIxt/NUCLEO-N657X0-Q/NUCLEO-N657X0-Q-xspi-high-speed/STM32CubeIDE/FSBL/Debug"
	echo y | /opt/st/STM32CubeProgrammer_2.23.0/bin/STM32_SigningTool_CLI -bin "XSPI_high_speed_FSBL.bin" -nk -of 0x80000000 -t ssbl -o "XSPI_high_speed_FSBL-Signed.bin" -hv 2.3 -dump "XSPI_high_speed_FSBL-Signed.bin" -align
	-@echo ' '

secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST) $(OBJCOPY_BIN)

fail-specified-linker-script-missing:
	@echo 'Error: Cannot find the specified linker script. Check the linker settings in the build configuration.'
	@exit 2

warn-no-linker-script-specified:
	@echo 'Warning: No linker script specified. Check the linker settings in the build configuration.'

.PHONY: all clean dependents main-build fail-specified-linker-script-missing warn-no-linker-script-specified post-build

-include ../makefile.targets
