diff --git a/Makefile.target b/Makefile.target index ba0708f40..cad9810ad 100644 --- a/Makefile.target +++ b/Makefile.target @@ -34,8 +34,9 @@ $(error TARGET not set to a valid value (possible values: $(TARGETS))) endif TARGET_PATH := $(BOLOS_SDK)/target/$(TARGET) -TARGET_ID := $(shell cat $(TARGET_PATH)/include/bolos_target.h | grep TARGET_ID | cut -f3 -d' ') -TARGET_NAME := $(sort $(shell cat $(TARGET_PATH)/include/bolos_target.h | grep TARGET_ | grep -v TARGET_ID | cut -f2 -d' ')) +BOLOS_TARGET_H := $(TARGET_PATH)/include/bolos_target.h +TARGET_ID := $(shell grep -E "^\#define\s*TARGET_ID" $(BOLOS_TARGET_H) | cut -f3 -d' ') +TARGET_NAME := $(shell grep -E "^\#define\s*TARGET_[^I]" $(BOLOS_TARGET_H) | cut -f2 -d' ') SDK_NAME := "ledger-secure-sdk" SDK_VERSION := $(shell git -C $(BOLOS_SDK) describe --tags --exact-match --match "v[0-9]*" --dirty) SDK_HASH := $(shell git -C $(BOLOS_SDK) describe --always --dirty --exclude '*' --abbrev=40) diff --git a/target/flex/include/bolos_target.h b/target/flex/include/bolos_target.h index db73de293..04216d4cb 100644 --- a/target/flex/include/bolos_target.h +++ b/target/flex/include/bolos_target.h @@ -1,7 +1,11 @@ #ifndef ST33K1M5 #define ST33K1M5 #endif // ST33K1M5 + +#ifndef TARGET_ID #define TARGET_ID 0x33300004 +#endif // TARGET_ID + #ifndef TARGET_FLEX #define TARGET_FLEX #endif // TARGET_FLEX diff --git a/target/nanos/include/bolos_target.h b/target/nanos/include/bolos_target.h index fc8f089e8..a093ba48e 100644 --- a/target/nanos/include/bolos_target.h +++ b/target/nanos/include/bolos_target.h @@ -1,5 +1,11 @@ #ifndef ST31 #define ST31 #endif // ST31 + +#ifndef TARGET_ID #define TARGET_ID 0x31100004 +#endif // TARGET_ID + +#ifndef TARGET_NANOS #define TARGET_NANOS +#endif // TARGET_NANOS diff --git a/target/nanos2/include/bolos_target.h b/target/nanos2/include/bolos_target.h index bc9b1e15d..14f70ef03 100644 --- a/target/nanos2/include/bolos_target.h +++ b/target/nanos2/include/bolos_target.h @@ -1,5 +1,11 @@ #ifndef ST33K1M5 #define ST33K1M5 #endif // ST33K1M5 + +#ifndef TARGET_ID #define TARGET_ID 0x33100004 +#endif // TARGET_ID + +#ifndef TARGET_NANOS2 #define TARGET_NANOS2 +#endif // TARGET_NANOS2 diff --git a/target/nanox/include/bolos_target.h b/target/nanox/include/bolos_target.h index c051bcffc..959da0a16 100644 --- a/target/nanox/include/bolos_target.h +++ b/target/nanox/include/bolos_target.h @@ -1,5 +1,11 @@ #ifndef ST33 #define ST33 #endif // ST33 + +#ifndef TARGET_ID #define TARGET_ID 0x33000004 +#endif // TARGET_ID + +#ifndef TARGET_NANOX #define TARGET_NANOX +#endif // TARGET_NANOX diff --git a/target/stax/include/bolos_target.h b/target/stax/include/bolos_target.h index e6983467e..5888b2430 100644 --- a/target/stax/include/bolos_target.h +++ b/target/stax/include/bolos_target.h @@ -1,7 +1,11 @@ #ifndef ST33K1M5 #define ST33K1M5 #endif // ST33K1M5 + +#ifndef TARGET_ID #define TARGET_ID 0x33200004 +#endif // TARGET_ID + #ifndef TARGET_STAX #define TARGET_STAX #endif // TARGET_STAX