mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
make: adapt to micropython -> embed rename
This commit is contained in:
parent
55bd4a0806
commit
803e39c2a8
14
Makefile
14
Makefile
@ -3,9 +3,9 @@
|
|||||||
JOBS = 4
|
JOBS = 4
|
||||||
MAKE = make -j $(JOBS)
|
MAKE = make -j $(JOBS)
|
||||||
|
|
||||||
BOARDLOADER_BUILD_DIR = micropython/boardloader/build
|
BOARDLOADER_BUILD_DIR = embed/boardloader/build
|
||||||
BOOTLOADER_BUILD_DIR = micropython/bootloader/build
|
BOOTLOADER_BUILD_DIR = embed/bootloader/build
|
||||||
FIRMWARE_BUILD_DIR = micropython/firmware/build
|
FIRMWARE_BUILD_DIR = embed/firmware/build
|
||||||
|
|
||||||
TREZORHAL_PORT_OPTS = FROZEN_MPY_DIR=src DEBUG=1
|
TREZORHAL_PORT_OPTS = FROZEN_MPY_DIR=src DEBUG=1
|
||||||
CROSS_PORT_OPTS = MICROPY_FORCE_32BIT=1
|
CROSS_PORT_OPTS = MICROPY_FORCE_32BIT=1
|
||||||
@ -69,7 +69,7 @@ build_firmware: res build_cross ## build firmware with frozen modules
|
|||||||
./tools/binctl $(FIRMWARE_BUILD_DIR)/firmware.bin -s 1 4141414141414141414141414141414141414141414141414141414141414141
|
./tools/binctl $(FIRMWARE_BUILD_DIR)/firmware.bin -s 1 4141414141414141414141414141414141414141414141414141414141414141
|
||||||
|
|
||||||
build_unix: ## build unix port
|
build_unix: ## build unix port
|
||||||
$(MAKE) -f ../../../micropython/unix/Makefile -C vendor/micropython/unix $(UNIX_PORT_OPTS)
|
$(MAKE) -f ../../../embed/unix/Makefile -C vendor/micropython/unix $(UNIX_PORT_OPTS)
|
||||||
|
|
||||||
build_cross: ## build mpy-cross port
|
build_cross: ## build mpy-cross port
|
||||||
$(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS)
|
$(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS)
|
||||||
@ -88,7 +88,7 @@ clean_firmware: ## clean firmware build
|
|||||||
$(MAKE) -f Makefile.firmware clean $(TREZORHAL_PORT_OPTS)
|
$(MAKE) -f Makefile.firmware clean $(TREZORHAL_PORT_OPTS)
|
||||||
|
|
||||||
clean_unix: ## clean unix build
|
clean_unix: ## clean unix build
|
||||||
$(MAKE) -f ../../../micropython/unix/Makefile -C vendor/micropython/unix clean $(UNIX_PORT_OPTS)
|
$(MAKE) -f ../../../embed/unix/Makefile -C vendor/micropython/unix clean $(UNIX_PORT_OPTS)
|
||||||
# workaround for relative paths containing ../.. in unix Makefile
|
# workaround for relative paths containing ../.. in unix Makefile
|
||||||
rm -rf vendor/micropython/micropython
|
rm -rf vendor/micropython/micropython
|
||||||
|
|
||||||
@ -123,11 +123,11 @@ gdb: ## start remote gdb session which connects to the openocd
|
|||||||
|
|
||||||
vendorheader: ## construct default vendor header
|
vendorheader: ## construct default vendor header
|
||||||
./tools/build_vendorheader 'db995fe25169d141cab9bbba92baa01f9f2e1ece7df4cb2ac05190f37fcc1f9d:2152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db12:22fc297792f0b6ffc0bfcfdb7edb0c0aa14e025a365ec0e342e86e3829cb74b6' 1 0.0 SatoshiLabs assets/satoshilabs_120.toif micropython/firmware/vendorheader.bin
|
./tools/build_vendorheader 'db995fe25169d141cab9bbba92baa01f9f2e1ece7df4cb2ac05190f37fcc1f9d:2152f8d19b791d24453242e15f2eab6cb7cffa7b6a5ed30097960e069881db12:22fc297792f0b6ffc0bfcfdb7edb0c0aa14e025a365ec0e342e86e3829cb74b6' 1 0.0 SatoshiLabs assets/satoshilabs_120.toif micropython/firmware/vendorheader.bin
|
||||||
./tools/binctl micropython/firmware/vendorheader.bin -s 1 4141414141414141414141414141414141414141414141414141414141414141
|
./tools/binctl embed/firmware/vendorheader.bin -s 1 4141414141414141414141414141414141414141414141414141414141414141
|
||||||
|
|
||||||
binctl: ## print info about binary files
|
binctl: ## print info about binary files
|
||||||
./tools/binctl $(BOOTLOADER_BUILD_DIR)/bootloader.bin
|
./tools/binctl $(BOOTLOADER_BUILD_DIR)/bootloader.bin
|
||||||
./tools/binctl micropython/firmware/vendorheader.bin
|
./tools/binctl embed/firmware/vendorheader.bin
|
||||||
./tools/binctl $(FIRMWARE_BUILD_DIR)/firmware.bin
|
./tools/binctl $(FIRMWARE_BUILD_DIR)/firmware.bin
|
||||||
|
|
||||||
bloaty: ## run bloaty size profiler
|
bloaty: ## run bloaty size profiler
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# source directories
|
# source directories
|
||||||
SRCDIR_MP = vendor/micropython
|
SRCDIR_MP = vendor/micropython
|
||||||
SRCDIR_FW = micropython
|
SRCDIR_FW = embed
|
||||||
|
|
||||||
# target directory
|
# target directory
|
||||||
PROJECT ?= boardloader
|
PROJECT ?= boardloader
|
||||||
BUILD ?= micropython/$(PROJECT)/build
|
BUILD ?= embed/$(PROJECT)/build
|
||||||
|
|
||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include $(SRCDIR_MP)/py/mkenv.mk
|
include $(SRCDIR_MP)/py/mkenv.mk
|
||||||
@ -63,7 +63,7 @@ OBJ_STMHAL += $(addprefix $(BUILD_MP)/,\
|
|||||||
stmhal/hal/f4/src/stm32f4xx_ll_usb.o \
|
stmhal/hal/f4/src/stm32f4xx_ll_usb.o \
|
||||||
)
|
)
|
||||||
|
|
||||||
# OBJ micropython/
|
# OBJ embed/
|
||||||
OBJ_BOARDLOADER += $(addprefix $(BUILD_FW)/, \
|
OBJ_BOARDLOADER += $(addprefix $(BUILD_FW)/, \
|
||||||
boardloader/main.o \
|
boardloader/main.o \
|
||||||
extmod/modtrezorcrypto/trezor-crypto/ed25519-donna/ed25519.o \
|
extmod/modtrezorcrypto/trezor-crypto/ed25519-donna/ed25519.o \
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# source directories
|
# source directories
|
||||||
SRCDIR_MP = vendor/micropython
|
SRCDIR_MP = vendor/micropython
|
||||||
SRCDIR_FW = micropython
|
SRCDIR_FW = embed
|
||||||
|
|
||||||
# target directory
|
# target directory
|
||||||
PROJECT ?= bootloader
|
PROJECT ?= bootloader
|
||||||
BUILD ?= micropython/$(PROJECT)/build
|
BUILD ?= embed/$(PROJECT)/build
|
||||||
|
|
||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include $(SRCDIR_MP)/py/mkenv.mk
|
include $(SRCDIR_MP)/py/mkenv.mk
|
||||||
@ -63,7 +63,7 @@ OBJ_STMHAL += $(addprefix $(BUILD_MP)/,\
|
|||||||
stmhal/hal/f4/src/stm32f4xx_ll_usb.o \
|
stmhal/hal/f4/src/stm32f4xx_ll_usb.o \
|
||||||
)
|
)
|
||||||
|
|
||||||
# OBJ micropython/
|
# OBJ embed/
|
||||||
OBJ_BOOTLOADER += $(addprefix $(BUILD_FW)/, \
|
OBJ_BOOTLOADER += $(addprefix $(BUILD_FW)/, \
|
||||||
bootloader/header.o \
|
bootloader/header.o \
|
||||||
bootloader/main.o \
|
bootloader/main.o \
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
# source directories
|
# source directories
|
||||||
SRCDIR_MP = vendor/micropython
|
SRCDIR_MP = vendor/micropython
|
||||||
SRCDIR_FW = micropython
|
SRCDIR_FW = embed
|
||||||
|
|
||||||
# directory containing scripts to be frozen as bytecode
|
# directory containing scripts to be frozen as bytecode
|
||||||
FROZEN_MPY_DIR ?= src
|
FROZEN_MPY_DIR ?= src
|
||||||
|
|
||||||
# target directory
|
# target directory
|
||||||
PROJECT ?= firmware
|
PROJECT ?= firmware
|
||||||
BUILD ?= micropython/$(PROJECT)/build
|
BUILD ?= embed/$(PROJECT)/build
|
||||||
|
|
||||||
# include py core make definitions
|
# include py core make definitions
|
||||||
include $(SRCDIR_MP)/py/mkenv.mk
|
include $(SRCDIR_MP)/py/mkenv.mk
|
||||||
@ -31,7 +31,7 @@ MICROPY_PY_TREZORUI = 1
|
|||||||
MICROPY_PY_TREZORUTILS = 1
|
MICROPY_PY_TREZORUTILS = 1
|
||||||
MICROPY_PY_UTIME = 1
|
MICROPY_PY_UTIME = 1
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorconfig
|
# OBJ embed/extmod/modtrezorconfig
|
||||||
ifeq ($(MICROPY_PY_TREZORCONFIG),1)
|
ifeq ($(MICROPY_PY_TREZORCONFIG),1)
|
||||||
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
||||||
extmod/modtrezorconfig/modtrezorconfig.o \
|
extmod/modtrezorconfig/modtrezorconfig.o \
|
||||||
@ -39,7 +39,7 @@ OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorcrypto
|
# OBJ embed/extmod/modtrezorcrypto
|
||||||
ifeq ($(MICROPY_PY_TREZORCRYPTO),1)
|
ifeq ($(MICROPY_PY_TREZORCRYPTO),1)
|
||||||
CFLAGS_MOD += \
|
CFLAGS_MOD += \
|
||||||
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto \
|
-I$(SRCDIR_FW)/extmod/modtrezorcrypto/trezor-crypto \
|
||||||
@ -77,21 +77,21 @@ OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorio
|
# OBJ embed/extmod/modtrezorio
|
||||||
ifeq ($(MICROPY_PY_TREZORIO),1)
|
ifeq ($(MICROPY_PY_TREZORIO),1)
|
||||||
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
||||||
extmod/modtrezorio/modtrezorio.o \
|
extmod/modtrezorio/modtrezorio.o \
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezormsg
|
# OBJ embed/extmod/modtrezormsg
|
||||||
ifeq ($(MICROPY_PY_TREZORMSG),1)
|
ifeq ($(MICROPY_PY_TREZORMSG),1)
|
||||||
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
||||||
extmod/modtrezormsg/modtrezormsg.o \
|
extmod/modtrezormsg/modtrezormsg.o \
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorui
|
# OBJ embed/extmod/modtrezorui
|
||||||
ifeq ($(MICROPY_PY_TREZORUI),1)
|
ifeq ($(MICROPY_PY_TREZORUI),1)
|
||||||
CFLAGS_MOD += -DQR_MAX_VERSION=0
|
CFLAGS_MOD += -DQR_MAX_VERSION=0
|
||||||
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
||||||
@ -106,14 +106,14 @@ OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
|||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorutils
|
# OBJ embed/extmod/modtrezorutils
|
||||||
ifeq ($(MICROPY_PY_TREZORUTILS),1)
|
ifeq ($(MICROPY_PY_TREZORUTILS),1)
|
||||||
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
||||||
extmod/modtrezorutils/modtrezorutils.o \
|
extmod/modtrezorutils/modtrezorutils.o \
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modutime
|
# OBJ embed/extmod/modutime
|
||||||
ifeq ($(MICROPY_PY_UTIME),1)
|
ifeq ($(MICROPY_PY_UTIME),1)
|
||||||
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
OBJ_MOD += $(addprefix $(BUILD_FW)/,\
|
||||||
firmware/modutime.o \
|
firmware/modutime.o \
|
||||||
@ -308,7 +308,7 @@ OBJ_STMHAL += $(addprefix $(BUILD_MP)/,\
|
|||||||
stmhal/hal/f4/src/stm32f4xx_ll_usb.o \
|
stmhal/hal/f4/src/stm32f4xx_ll_usb.o \
|
||||||
)
|
)
|
||||||
|
|
||||||
# OBJ micropython/
|
# OBJ embed/
|
||||||
OBJ_FIRMWARE += $(addprefix $(BUILD_FW)/, \
|
OBJ_FIRMWARE += $(addprefix $(BUILD_FW)/, \
|
||||||
firmware/vendorheader.o \
|
firmware/vendorheader.o \
|
||||||
firmware/header.o \
|
firmware/header.o \
|
||||||
|
@ -12,17 +12,17 @@ MICROPY_PY_TREZORUTILS = 1
|
|||||||
|
|
||||||
TREZOR_NOUI = 0
|
TREZOR_NOUI = 0
|
||||||
|
|
||||||
EXTMOD_DIR = ../../micropython/extmod
|
EXTMOD_DIR = ../../embed/extmod
|
||||||
|
|
||||||
CFLAGS_EXTRA='-DMP_CONFIGFILE="../../../micropython/unix/mpconfigport.h"'
|
CFLAGS_EXTRA='-DMP_CONFIGFILE="../../../embed/unix/mpconfigport.h"'
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorconfig
|
# OBJ embed/extmod/modtrezorconfig
|
||||||
ifeq ($(MICROPY_PY_TREZORCONFIG),1)
|
ifeq ($(MICROPY_PY_TREZORCONFIG),1)
|
||||||
SRC_MOD += $(EXTMOD_DIR)/modtrezorconfig/modtrezorconfig.c
|
SRC_MOD += $(EXTMOD_DIR)/modtrezorconfig/modtrezorconfig.c
|
||||||
SRC_MOD += $(EXTMOD_DIR)/modtrezorconfig/norcow.c
|
SRC_MOD += $(EXTMOD_DIR)/modtrezorconfig/norcow.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorcrypto
|
# OBJ embed/extmod/modtrezorcrypto
|
||||||
ifeq ($(MICROPY_PY_TREZORCRYPTO),1)
|
ifeq ($(MICROPY_PY_TREZORCRYPTO),1)
|
||||||
CFLAGS_MOD += -I../$(EXTMOD_DIR)/modtrezorcrypto/trezor-crypto
|
CFLAGS_MOD += -I../$(EXTMOD_DIR)/modtrezorcrypto/trezor-crypto
|
||||||
CFLAGS_MOD += -I../$(EXTMOD_DIR)/modtrezorcrypto/trezor-crypto/aes
|
CFLAGS_MOD += -I../$(EXTMOD_DIR)/modtrezorcrypto/trezor-crypto/aes
|
||||||
@ -58,18 +58,18 @@ SRC_MOD += \
|
|||||||
$(EXTMOD_DIR)/modtrezorcrypto/trezor-crypto/sha3.c
|
$(EXTMOD_DIR)/modtrezorcrypto/trezor-crypto/sha3.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorio
|
# OBJ embed/extmod/modtrezorio
|
||||||
ifeq ($(MICROPY_PY_TREZORIO),1)
|
ifeq ($(MICROPY_PY_TREZORIO),1)
|
||||||
SRC_MOD += $(EXTMOD_DIR)/modtrezorio/modtrezorio.c
|
SRC_MOD += $(EXTMOD_DIR)/modtrezorio/modtrezorio.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezormsg
|
# OBJ embed/extmod/modtrezormsg
|
||||||
ifeq ($(MICROPY_PY_TREZORMSG),1)
|
ifeq ($(MICROPY_PY_TREZORMSG),1)
|
||||||
SRC_MOD += $(EXTMOD_DIR)/../unix/touch.c
|
SRC_MOD += $(EXTMOD_DIR)/../unix/touch.c
|
||||||
SRC_MOD += $(EXTMOD_DIR)/modtrezormsg/modtrezormsg.c
|
SRC_MOD += $(EXTMOD_DIR)/modtrezormsg/modtrezormsg.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorui
|
# OBJ embed/extmod/modtrezorui
|
||||||
ifeq ($(MICROPY_PY_TREZORUI),1)
|
ifeq ($(MICROPY_PY_TREZORUI),1)
|
||||||
CFLAGS_MOD += -DQR_MAX_VERSION=0
|
CFLAGS_MOD += -DQR_MAX_VERSION=0
|
||||||
SRC_MOD += \
|
SRC_MOD += \
|
||||||
@ -88,7 +88,7 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# OBJ micropython/extmod/modtrezorutils
|
# OBJ embed/extmod/modtrezorutils
|
||||||
ifeq ($(MICROPY_PY_TREZORUTILS),1)
|
ifeq ($(MICROPY_PY_TREZORUTILS),1)
|
||||||
SRC_MOD += $(EXTMOD_DIR)/modtrezorutils/modtrezorutils.c
|
SRC_MOD += $(EXTMOD_DIR)/modtrezorutils/modtrezorutils.c
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user