Update for new SDKs
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -2,7 +2,6 @@ bin
|
|||||||
debug
|
debug
|
||||||
dep
|
dep
|
||||||
obj
|
obj
|
||||||
src/glyph.c
|
src_common/glyphs.c
|
||||||
|
src_common/glyphs.h
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,11 +15,25 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#*******************************************************************************
|
#*******************************************************************************
|
||||||
|
|
||||||
|
#extract TARGET_ID from the SDK to allow for makefile choices
|
||||||
|
TARGET_ID := $(shell cat $(BOLOS_SDK)/include/bolos_target.h | grep 0x | cut -f3 -d' ')
|
||||||
|
$(info TARGET_ID=$(TARGET_ID))
|
||||||
APPNAME = Ethereum
|
APPNAME = Ethereum
|
||||||
TARGET_ID = 0x31100002 #Nano S
|
|
||||||
#TARGET_ID = 0x31000002 #Blue
|
|
||||||
APP_LOAD_PARAMS=--appFlags 0x40 --path "44'/60'" --path "44'/61'" --curve secp256k1
|
APP_LOAD_PARAMS=--appFlags 0x40 --path "44'/60'" --path "44'/61'" --curve secp256k1
|
||||||
|
|
||||||
|
APPVERSION_M=1
|
||||||
|
APPVERSION_N=0
|
||||||
|
APPVERSION_P=4
|
||||||
|
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
|
||||||
|
|
||||||
|
#prepare hsm generation
|
||||||
|
ifeq ($(TARGET_ID),0x31000002)
|
||||||
|
ICONNAME=app_ethereum.gif
|
||||||
|
LOADFLAGS = --params --appVersion $(APPVERSION)
|
||||||
|
else
|
||||||
|
ICONNAME=icon.gif
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
################
|
################
|
||||||
# Default rule #
|
# Default rule #
|
||||||
@@ -46,22 +60,27 @@ PROG := token-genericwallet
|
|||||||
CONFIG_PRODUCTIONS := bin/$(PROG)
|
CONFIG_PRODUCTIONS := bin/$(PROG)
|
||||||
|
|
||||||
GLYPH_FILES := $(addprefix glyphs/,$(sort $(notdir $(shell find glyphs/))))
|
GLYPH_FILES := $(addprefix glyphs/,$(sort $(notdir $(shell find glyphs/))))
|
||||||
GLYPH_DEST := src_common/glyphs.c
|
GLYPH_DESTC := src_common/glyphs.c
|
||||||
$(GLYPH_DEST): $(GLYPH_FILES) $(BOLOS_SDK)/icon.py
|
GLYPH_DESTH := src_common/glyphs.h
|
||||||
|
$(GLYPH_DESTC) $(GLYPH_DESTH): $(GLYPH_FILES) $(BOLOS_SDK)/icon.py
|
||||||
-rm $@
|
-rm $@
|
||||||
if [ ! -z "$(GLYPH_FILES)" ] ; then for gif in $(GLYPH_FILES) ; do python $(BOLOS_SDK)/icon.py $$gif | grep -v "bitmap}," ; done > $(GLYPH_DEST) ; fi
|
if [ ! -z "$(GLYPH_FILES)" ] ; then for gif in $(GLYPH_FILES) ; do python $(BOLOS_SDK)/icon.py $$gif glyphcheader ; done > $(GLYPH_DESTH) ; fi
|
||||||
|
if [ ! -z "$(GLYPH_FILES)" ] ; then for gif in $(GLYPH_FILES) ; do python $(BOLOS_SDK)/icon.py $$gif glyphcfile ; done > $(GLYPH_DESTC) ; fi
|
||||||
|
|
||||||
SOURCE_PATH := src_genericwallet $(BOLOS_SDK)/src $(dir $(shell find $(BOLOS_SDK)/lib_stusb* | grep "\.c$$")) src_common
|
SOURCE_PATH := src_genericwallet $(BOLOS_SDK)/src $(dir $(shell find $(BOLOS_SDK)/lib_stusb* | grep "\.c$$")) src_common
|
||||||
SOURCE_FILES := $(foreach path, $(SOURCE_PATH),$(shell find $(path) | grep "\.c$$") ) $(GLYPH_DEST)
|
SOURCE_FILES := $(foreach path, $(SOURCE_PATH),$(shell find $(path) | grep "\.c$$") ) $(GLYPH_DESTC)
|
||||||
INCLUDES_PATH := $(dir $(shell find $(BOLOS_SDK)/lib_stusb* | grep "\.h$$")) include src_genericwallet $(BOLOS_SDK)/include $(BOLOS_SDK)/include/arm src_common
|
INCLUDES_PATH := $(dir $(shell find $(BOLOS_SDK)/lib_stusb* | grep "\.h$$")) include src_genericwallet $(BOLOS_SDK)/include $(BOLOS_SDK)/include/arm src_common
|
||||||
|
|
||||||
### platform definitions
|
### platform definitions
|
||||||
DEFINES := ST31 gcc __IO=volatile
|
DEFINES := ST31 gcc __IO=volatile
|
||||||
|
|
||||||
DEFINES += OS_IO_SEPROXYHAL IO_SEPROXYHAL_BUFFER_SIZE_B=128
|
DEFINES += OS_IO_SEPROXYHAL IO_SEPROXYHAL_BUFFER_SIZE_B=128
|
||||||
DEFINES += HAVE_BAGL HAVE_PRINTF
|
DEFINES += HAVE_BAGL HAVE_SPRINTF
|
||||||
DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=7 IO_HID_EP_LENGTH=64 HAVE_USB_APDU
|
#DEFINES += HAVE_PRINTF PRINTF=screen_printf
|
||||||
DEFINES += LEDGER_MAJOR_VERSION=1 LEDGER_MINOR_VERSION=0 LEDGER_PATCH_VERSION=3
|
DEFINES += PRINTF\(...\)=
|
||||||
|
DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=6 IO_HID_EP_LENGTH=64 HAVE_USB_APDU
|
||||||
|
DEFINES += LEDGER_MAJOR_VERSION=$(APPVERSION_M) LEDGER_MINOR_VERSION=$(APPVERSION_N) LEDGER_PATCH_VERSION=$(APPVERSION_P)
|
||||||
|
|
||||||
|
|
||||||
# U2F
|
# U2F
|
||||||
DEFINES += HAVE_U2F
|
DEFINES += HAVE_U2F
|
||||||
@@ -69,8 +88,6 @@ DEFINES += USB_SEGMENT_SIZE=64
|
|||||||
DEFINES += BLE_SEGMENT_SIZE=32 #max MTU, min 20
|
DEFINES += BLE_SEGMENT_SIZE=32 #max MTU, min 20
|
||||||
DEFINES += U2F_MAX_MESSAGE_SIZE=264 #257+5+2
|
DEFINES += U2F_MAX_MESSAGE_SIZE=264 #257+5+2
|
||||||
DEFINES += UNUSED\(x\)=\(void\)x
|
DEFINES += UNUSED\(x\)=\(void\)x
|
||||||
DEFINES += PRINTF\(...\)=
|
|
||||||
DEFINES += TARGET_ID=$(TARGET_ID)
|
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Compiler #
|
# Compiler #
|
||||||
@@ -129,9 +146,9 @@ ifeq ($(filter clean,$(MAKECMDGOALS)),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr obj bin debug dep $(GLYPH_DEST)
|
rm -fr obj bin debug dep $(GLYPH_DESTC) $(GLYPH_DESTH)
|
||||||
|
|
||||||
prepare: $(GLYPH_DEST)
|
prepare: $(GLYPH_DESTC)
|
||||||
@mkdir -p bin obj debug dep
|
@mkdir -p bin obj debug dep
|
||||||
|
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
@@ -141,11 +158,10 @@ log = $(if $(strip $(VERBOSE)),$1,@$1)
|
|||||||
|
|
||||||
default: prepare bin/$(PROG)
|
default: prepare bin/$(PROG)
|
||||||
|
|
||||||
load:
|
|
||||||
python -m ledgerblue.loadApp --targetId $(TARGET_ID) --fileName bin/$(PROG).hex --appName $(APPNAME) --icon `python $(BOLOS_SDK)/icon.py 16 16 icon.gif hexbitmaponly` --apdu $(APP_LOAD_PARAMS)
|
|
||||||
|
|
||||||
load_release:
|
|
||||||
python -m ledgerblue.loadApp --targetId $(TARGET_ID) --fileName bin/$(PROG).hex --appName $(APPNAME) --icon `python $(BOLOS_SDK)/icon.py 16 16 icon.gif hexbitmaponly` $(APP_LOAD_PARAMS) --signature 304402205385091595d285e0b06b8f968457d70415140497a0edea385a63b9f526ebd2630220524c832f5f0d5e7ecce56db5839a70e52dc1b79bdda37c3aa08282f28b410082
|
load: all
|
||||||
|
python -m ledgerblue.loadApp --targetId $(TARGET_ID) --fileName bin/$(PROG).hex --delete --appName $(APPNAME) --icon `python $(BOLOS_SDK)/icon.py $(ICONNAME) hexbitmaponly` $(LOADFLAGS) $(APP_LOAD_PARAMS)
|
||||||
|
|
||||||
delete:
|
delete:
|
||||||
python -m ledgerblue.deleteApp --targetId $(TARGET_ID) --appName $(APPNAME)
|
python -m ledgerblue.deleteApp --targetId $(TARGET_ID) --appName $(APPNAME)
|
||||||
|
|||||||
Reference in New Issue
Block a user