2019-01-27 10:58:30 +00:00
|
|
|
APPVER = 1.8.0
|
2017-06-10 18:42:10 +00:00
|
|
|
|
2014-04-29 12:26:51 +00:00
|
|
|
NAME = trezor
|
|
|
|
|
2021-11-01 13:52:48 +00:00
|
|
|
SECP256K1_ZKP ?= 1
|
|
|
|
|
|
|
|
|
|
|
|
ifeq ($(SECP256K1_ZKP),1)
|
|
|
|
CFLAGS += -DUSE_SECP256K1_ZKP
|
|
|
|
CFLAGS += -DUSE_SECP256K1_ZKP_ECDSA
|
|
|
|
ifeq ($(EMULATOR),1)
|
|
|
|
CFLAGS += -DSECP256K1_CONTEXT_SIZE=208
|
|
|
|
else
|
|
|
|
CFLAGS += -DSECP256K1_CONTEXT_SIZE=184
|
|
|
|
OBJS += field_10x26_arm.o
|
|
|
|
endif
|
|
|
|
ZKP_CFLAGS = \
|
|
|
|
-DUSE_ASM_ARM \
|
|
|
|
-DUSE_NUM_NONE \
|
|
|
|
-DUSE_FIELD_INV_BUILTIN \
|
|
|
|
-DUSE_SCALAR_INV_BUILTIN \
|
|
|
|
-DUSE_EXTERNAL_ASM \
|
|
|
|
-DUSE_FIELD_10X26 \
|
|
|
|
-DUSE_SCALAR_8X32 \
|
|
|
|
-DUSE_ECMULT_STATIC_PRECOMPUTATION \
|
|
|
|
-DUSE_EXTERNAL_DEFAULT_CALLBACKS \
|
|
|
|
-DECMULT_GEN_PREC_BITS=4 \
|
|
|
|
-DECMULT_WINDOW_SIZE=8 \
|
|
|
|
-DENABLE_MODULE_GENERATOR \
|
|
|
|
-DENABLE_MODULE_RECOVERY \
|
|
|
|
-DENABLE_MODULE_SCHNORRSIG \
|
|
|
|
-DENABLE_MODULE_EXTRAKEYS
|
|
|
|
|
|
|
|
OBJS += secp256k1-zkp.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/zkp_bip340.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/zkp_context.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/zkp_ecdsa.o
|
|
|
|
endif
|
|
|
|
|
2017-12-13 18:38:51 +00:00
|
|
|
ifeq ($(EMULATOR),1)
|
|
|
|
OBJS += udp.o
|
|
|
|
else
|
2014-04-29 12:26:51 +00:00
|
|
|
OBJS += usb.o
|
2018-03-26 17:02:50 +00:00
|
|
|
OBJS += bl_check.o
|
2019-02-18 16:57:09 +00:00
|
|
|
OBJS += otp.o
|
2019-01-27 10:58:30 +00:00
|
|
|
OBJS += header.o
|
2017-12-13 18:38:51 +00:00
|
|
|
endif
|
|
|
|
|
2014-04-29 12:26:51 +00:00
|
|
|
OBJS += messages.o
|
2019-01-25 10:58:23 +00:00
|
|
|
OBJS += config.o
|
2014-04-29 12:26:51 +00:00
|
|
|
OBJS += trezor.o
|
|
|
|
OBJS += pinmatrix.o
|
|
|
|
OBJS += fsm.o
|
|
|
|
OBJS += coins.o
|
2017-12-24 13:41:48 +00:00
|
|
|
OBJS += coin_info.o
|
2014-04-29 12:26:51 +00:00
|
|
|
OBJS += transaction.o
|
|
|
|
OBJS += protect.o
|
|
|
|
OBJS += layout2.o
|
|
|
|
OBJS += recovery.o
|
|
|
|
OBJS += reset.o
|
|
|
|
OBJS += signing.o
|
2014-11-15 01:01:21 +00:00
|
|
|
OBJS += crypto.o
|
2019-04-27 14:15:35 +00:00
|
|
|
|
2019-04-27 14:38:08 +00:00
|
|
|
ifneq ($(BITCOIN_ONLY),1)
|
2019-08-21 08:22:41 +00:00
|
|
|
OBJS += u2f.o
|
2016-05-24 21:22:30 +00:00
|
|
|
OBJS += ethereum.o
|
2017-05-16 12:00:55 +00:00
|
|
|
OBJS += ethereum_tokens.o
|
2017-05-30 16:41:02 +00:00
|
|
|
OBJS += nem2.o
|
2017-07-20 21:58:19 +00:00
|
|
|
OBJS += nem_mosaics.o
|
2018-08-27 15:20:29 +00:00
|
|
|
OBJS += stellar.o
|
2019-04-27 14:15:35 +00:00
|
|
|
endif
|
2014-04-29 12:26:51 +00:00
|
|
|
|
|
|
|
OBJS += debug.o
|
|
|
|
|
2016-10-10 09:26:52 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/address.o
|
2015-12-15 22:01:54 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/bignum.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/ecdsa.o
|
2016-04-22 15:49:00 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/curves.o
|
2015-12-15 22:01:54 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/secp256k1.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/nist256p1.o
|
2019-06-09 21:32:19 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/hmac_drbg.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/rfc6979.o
|
2018-01-13 14:20:10 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/rand.o
|
2018-01-18 14:21:48 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/memzero.o
|
2017-08-14 12:59:17 +00:00
|
|
|
|
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/curve25519-donna-32bit.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/curve25519-donna-helpers.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/modm-donna-32bit.o
|
2017-06-25 14:37:45 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/ed25519-donna-basepoint-table.o
|
2017-08-14 12:59:17 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/ed25519-donna-32bit-tables.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/ed25519-donna-impl-base.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/ed25519.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/curve25519-donna-scalarmult-base.o
|
2017-06-12 16:35:27 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/ed25519-sha3.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/ed25519-donna/ed25519-keccak.o
|
2017-08-14 12:59:17 +00:00
|
|
|
|
2015-12-15 22:01:54 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/hmac.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/bip32.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/bip39.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/pbkdf2.o
|
2017-06-12 16:35:27 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/base32.o
|
2015-12-15 22:01:54 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/base58.o
|
2017-09-08 13:29:55 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/segwit_addr.o
|
2015-12-15 22:01:54 +00:00
|
|
|
|
|
|
|
OBJS += ../vendor/trezor-crypto/ripemd160.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/sha2.o
|
2016-05-24 19:31:34 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/sha3.o
|
2017-12-09 16:44:29 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/blake256.o
|
2018-06-12 13:03:17 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/blake2b.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/groestl.o
|
2017-12-09 16:44:29 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/hasher.o
|
2015-12-15 22:01:54 +00:00
|
|
|
|
2017-05-08 15:16:20 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/aes/aescrypt.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/aes/aeskey.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/aes/aestab.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/aes/aes_modes.o
|
2015-12-15 22:01:54 +00:00
|
|
|
|
2019-01-25 10:58:23 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/chacha20poly1305/chacha20poly1305.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/chacha20poly1305/chacha_merged.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/chacha20poly1305/poly1305-donna.o
|
|
|
|
OBJS += ../vendor/trezor-crypto/chacha20poly1305/rfc7539.o
|
|
|
|
|
2017-05-29 14:07:13 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/nem.o
|
|
|
|
|
2019-02-16 16:21:35 +00:00
|
|
|
OBJS += ../vendor/QR-Code-generator/c/qrcodegen.o
|
2014-08-08 17:09:54 +00:00
|
|
|
|
2019-01-25 10:58:23 +00:00
|
|
|
OBJS += ../vendor/trezor-storage/storage.o
|
|
|
|
OBJS += ../vendor/trezor-storage/norcow.o
|
|
|
|
|
2017-12-18 21:33:58 +00:00
|
|
|
OBJS += ../vendor/nanopb/pb_common.o
|
|
|
|
OBJS += ../vendor/nanopb/pb_decode.o
|
2019-10-10 16:07:00 +00:00
|
|
|
OBJS += ../vendor/nanopb/pb_encode.o
|
2017-12-18 21:33:58 +00:00
|
|
|
|
2014-04-29 12:26:51 +00:00
|
|
|
OBJS += protob/messages.pb.o
|
2018-07-10 14:58:00 +00:00
|
|
|
OBJS += protob/messages-bitcoin.pb.o
|
2018-07-16 13:07:42 +00:00
|
|
|
OBJS += protob/messages-common.pb.o
|
2018-07-10 14:58:00 +00:00
|
|
|
OBJS += protob/messages-crypto.pb.o
|
|
|
|
OBJS += protob/messages-debug.pb.o
|
|
|
|
OBJS += protob/messages-management.pb.o
|
2022-02-08 17:57:05 +00:00
|
|
|
|
2019-04-27 14:38:08 +00:00
|
|
|
ifneq ($(BITCOIN_ONLY),1)
|
2022-02-08 17:57:05 +00:00
|
|
|
OBJS += ../vendor/trezor-crypto/cash_addr.o
|
2019-04-27 14:15:35 +00:00
|
|
|
OBJS += protob/messages-ethereum.pb.o
|
2018-07-10 14:58:00 +00:00
|
|
|
OBJS += protob/messages-nem.pb.o
|
2018-08-27 15:20:29 +00:00
|
|
|
OBJS += protob/messages-stellar.pb.o
|
2019-04-27 14:15:35 +00:00
|
|
|
endif
|
2014-04-29 12:26:51 +00:00
|
|
|
|
2018-05-02 12:15:12 +00:00
|
|
|
OPTFLAGS ?= -Os
|
|
|
|
|
2018-06-19 14:00:31 +00:00
|
|
|
../vendor/trezor-crypto/bip32.o: OPTFLAGS = -O3
|
|
|
|
../vendor/trezor-crypto/bip39.o: OPTFLAGS = -O3
|
|
|
|
../vendor/trezor-crypto/ecdsa.o: OPTFLAGS = -O3
|
|
|
|
../vendor/trezor-crypto/sha2.o: OPTFLAGS = -O3
|
|
|
|
../vendor/trezor-crypto/secp256k1.o: OPTFLAGS = -O3
|
2018-05-02 12:15:12 +00:00
|
|
|
|
2014-04-29 12:26:51 +00:00
|
|
|
include ../Makefile.include
|
|
|
|
|
2017-08-14 13:18:36 +00:00
|
|
|
DEBUG_LINK ?= 0
|
|
|
|
DEBUG_LOG ?= 0
|
|
|
|
|
2014-06-07 12:21:59 +00:00
|
|
|
CFLAGS += -Wno-sequence-point
|
2019-12-20 13:21:03 +00:00
|
|
|
CFLAGS += -I../vendor/nanopb -Iprotob -DPB_FIELD_16BIT=1 -DPB_ENCODE_ARRAYS_UNPACKED=1 -DPB_VALIDATE_UTF8=1
|
2017-08-14 13:18:36 +00:00
|
|
|
CFLAGS += -DDEBUG_LINK=$(DEBUG_LINK)
|
|
|
|
CFLAGS += -DDEBUG_LOG=$(DEBUG_LOG)
|
2014-04-29 12:26:51 +00:00
|
|
|
CFLAGS += -DSCM_REVISION='"$(shell git rev-parse HEAD | sed 's:\(..\):\\x\1:g')"'
|
2019-04-27 14:15:35 +00:00
|
|
|
CFLAGS += -DUSE_MONERO=0
|
2019-04-27 14:38:08 +00:00
|
|
|
ifneq ($(BITCOIN_ONLY),1)
|
2016-05-23 20:27:18 +00:00
|
|
|
CFLAGS += -DUSE_ETHEREUM=1
|
2017-05-29 14:07:13 +00:00
|
|
|
CFLAGS += -DUSE_NEM=1
|
2019-04-27 14:15:35 +00:00
|
|
|
MAKO_RENDER_FLAG =
|
|
|
|
else
|
|
|
|
CFLAGS += -DUSE_ETHEREUM=0
|
|
|
|
CFLAGS += -DUSE_NEM=0
|
|
|
|
MAKO_RENDER_FLAG = --bitcoin-only
|
|
|
|
endif
|
2017-06-10 18:41:31 +00:00
|
|
|
|
2018-07-30 15:40:07 +00:00
|
|
|
%:: %.mako defs
|
2018-09-14 13:06:03 +00:00
|
|
|
@printf " MAKO $@\n"
|
2019-04-27 14:15:35 +00:00
|
|
|
$(Q)$(PYTHON) ../vendor/trezor-common/tools/cointool.py render $(MAKO_RENDER_FLAG) $@.mako
|
2017-12-24 12:33:18 +00:00
|
|
|
|
2019-04-23 19:23:52 +00:00
|
|
|
bl_data.h: bl_data.py bootloader.dat
|
2018-07-30 15:40:07 +00:00
|
|
|
@printf " PYTHON bl_data.py\n"
|
|
|
|
$(Q)$(PYTHON) bl_data.py
|
2017-12-24 12:33:18 +00:00
|
|
|
|
2022-04-25 09:42:35 +00:00
|
|
|
header.o: version.h
|
|
|
|
|
2017-12-24 12:33:18 +00:00
|
|
|
clean::
|
2018-07-30 15:40:07 +00:00
|
|
|
rm -f bl_data.h
|
|
|
|
find -maxdepth 1 -name "*.mako" | sed 's/.mako$$//' | xargs rm -f
|