From d1669ee8d379d0d94217b32c17c394a9b1a8edcd Mon Sep 17 00:00:00 2001 From: shufps Date: Tue, 25 Oct 2022 14:38:12 +0200 Subject: [PATCH] moved app version from variant specific makefiles to main makefile; added variant switch to build.sh script --- Makefile | 8 ++++++++ build.sh | 10 ++++++++++ makefile_conf/chain/iota.mk | 9 ++------- makefile_conf/chain/shimmer.mk | 10 +++------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 657bc0d..bfd57b1 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,14 @@ endif include $(BOLOS_SDK)/Makefile.defines +APPVERSION_M = 0 +APPVERSION_N = 8 +APPVERSION_P = 3 +APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" + +APP_LOAD_PARAMS = --path "44'/1'" --curve ed25519 --appFlags 0x240 $(COMMON_LOAD_PARAMS) + + ifeq ($(CHAIN),) CHAIN=iota endif diff --git a/build.sh b/build.sh index a7d4ba5..04063a8 100755 --- a/build.sh +++ b/build.sh @@ -36,6 +36,7 @@ function usage { echo "-c|--cxlib: don't autodetect cx-lib version (for speculos)" echo "-g|--gdb: start speculos with -d (waiting for gdb debugger)" echo "-a|--analyze run static code analysis" + echo "-v|--variant build for 'iota' or 'shimmer'" exit 1 } @@ -77,6 +78,7 @@ debug=0 gdb=0 analysis=0 cxlib="" +variant="" while (( $# )) do case "$1" in @@ -106,6 +108,10 @@ do "-a" | "--analyze") analysis=1 ;; + "-v" | "--variant") + shift + variant="$1" + ;; *) error "unknown parameter: $1" ;; @@ -188,6 +194,10 @@ build_flags="" build_flags+="DEBUG=1 " } +[ ! -z "$variant" ] && { + build_flags+="CHAIN=$variant " +} + extra_args="" (( analysis )) && { diff --git a/makefile_conf/chain/iota.mk b/makefile_conf/chain/iota.mk index a884dfd..1622807 100644 --- a/makefile_conf/chain/iota.mk +++ b/makefile_conf/chain/iota.mk @@ -1,12 +1,7 @@ -APPNAME = "IOTA" -APPVERSION_M = 0 -APPVERSION_N = 8 -APPVERSION_P = 0 -APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" - -APP_LOAD_PARAMS = --path "44'/1'" --curve ed25519 --appFlags 0x240 $(COMMON_LOAD_PARAMS) +APPNAME = "IOTA" DEFINES += APP_IOTA + # IOTA BIP-path APP_LOAD_PARAMS += --path "44'/4218'" diff --git a/makefile_conf/chain/shimmer.mk b/makefile_conf/chain/shimmer.mk index a8ac5f5..db2f7ec 100644 --- a/makefile_conf/chain/shimmer.mk +++ b/makefile_conf/chain/shimmer.mk @@ -1,14 +1,10 @@ -APPNAME = "Shimmer" -APPVERSION_M = 0 -APPVERSION_N = 8 -APPVERSION_P = 2 -APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" - -APP_LOAD_PARAMS = --path "44'/1'" --curve ed25519 --appFlags 0x240 $(COMMON_LOAD_PARAMS) +APPNAME = "Shimmer" DEFINES += APP_SHIMMER + # IOTA BIP-path for claiming Shimmer from IOTA addresses APP_LOAD_PARAMS += --path "44'/4218'" + # Shimmer BIP-path APP_LOAD_PARAMS += --path "44'/4219'"