11#*******************************************************************************
22# Ledger App
3- # (c) 2018 - 2023 Zondax AG
3+ # (c) 2018 - 2024 Zondax AG
44#
55# Licensed under the Apache License, Version 2.0 (the "License");
66# you may not use this file except in compliance with the License.
1515# limitations under the License.
1616#*******************************************************************************
1717
18+ # BIN_DIR is defined by the SDK in Makefile.target (included via Makefile.standard_app)
19+ # Path structure: build/<TARGET>/bin (e.g., build/nanox/bin, build/stax/bin)
20+ # This fallback ensures compatibility if BIN_DIR is not yet defined
21+ BIN_DIR ?= $(CURDIR)/build/$(TARGET)/bin
22+
1823all: default
1924 @echo "#!/usr/bin/env bash" > $(OUTPUT_INSTALLER)
2025 @echo "APPNAME=\"${APPNAME}\"" >> $(OUTPUT_INSTALLER)
@@ -23,10 +28,10 @@ all: default
2328 @echo "LOAD_PARAMS=($$(echo "${APP_LOAD_PARAMS}" | sed -e "s|"${APPNAME}"|\""${APPNAME}"\"|"))" >> $(OUTPUT_INSTALLER)
2429 @echo "DELETE_PARAMS=($$(echo "${COMMON_DELETE_PARAMS}" | sed -e "s|"${APPNAME}"|\""${APPNAME}"\"|"))" >> $(OUTPUT_INSTALLER)
2530 @echo "APPHEX=\"" >> $(OUTPUT_INSTALLER)
26- @cat $(CURDIR)/bin /app.hex >> $(OUTPUT_INSTALLER)
31+ @cat $(BIN_DIR) /app.hex >> $(OUTPUT_INSTALLER)
2732 @echo "\"" >> $(OUTPUT_INSTALLER)
2833 @cat $(CURDIR)/../deps/ledger-zxlib/scripts/template.sh >> $(OUTPUT_INSTALLER)
2934 @chmod +x $(OUTPUT_INSTALLER)
30- @cp $(CURDIR)/bin /* $(CURDIR)/output
35+ @cp $(BIN_DIR) /* $(CURDIR)/output
3136 @cp $(CURDIR)/output/app.elf ${OUTPUT_ELF}
3237 @rm $(CURDIR)/output/app.elf
0 commit comments