mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
cleanup makefile; make res_collect tool more verbose
This commit is contained in:
parent
34ed2fb86a
commit
d1ff96af04
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
_attic/
|
_attic/
|
||||||
|
vendor/src/
|
||||||
|
31
Makefile
31
Makefile
@ -3,12 +3,12 @@
|
|||||||
STMHAL_BUILD_DIR=vendor/micropython/stmhal/build-TREZORV2
|
STMHAL_BUILD_DIR=vendor/micropython/stmhal/build-TREZORV2
|
||||||
|
|
||||||
help: ## show this help
|
help: ## show this help
|
||||||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36mmake %-18s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36mmake %-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||||
|
|
||||||
vendor: ## update git submodules
|
vendor: ## update git submodules
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
build: build_stmhal build_unix build_cross ## build stmhal, 32-bit unix and mpy-cross micropython ports
|
build: build_stmhal build_unix build_cross ## build stmhal, unix and mpy-cross micropython ports
|
||||||
|
|
||||||
build_stmhal: vendor ## build stmhal port
|
build_stmhal: vendor ## build stmhal port
|
||||||
make -C vendor/micropython/stmhal
|
make -C vendor/micropython/stmhal
|
||||||
@ -16,30 +16,21 @@ build_stmhal: vendor ## build stmhal port
|
|||||||
build_stmhal_debug: vendor ## build stmhal port with debug symbols
|
build_stmhal_debug: vendor ## build stmhal port with debug symbols
|
||||||
make -C vendor/micropython/stmhal
|
make -C vendor/micropython/stmhal
|
||||||
|
|
||||||
build_unix: vendor ## build 32-bit unix port
|
build_stmhal_frozen: vendor build_cross ## build stmhal port with frozen modules (from /src)
|
||||||
|
make -C vendor/micropython/stmhal FROZEN_MPY_DIR=../../../src
|
||||||
|
|
||||||
|
build_unix: vendor ## build unix port
|
||||||
make -C vendor/micropython/unix MICROPY_FORCE_32BIT=1
|
make -C vendor/micropython/unix MICROPY_FORCE_32BIT=1
|
||||||
|
|
||||||
build_unix_debug: vendor ## build 32-bit unix port with debug symbols
|
build_unix_debug: vendor ## build unix port with debug symbols
|
||||||
make -C vendor/micropython/unix MICROPY_FORCE_32BIT=1 DEBUG=1
|
make -C vendor/micropython/unix MICROPY_FORCE_32BIT=1 DEBUG=1
|
||||||
|
|
||||||
build_cross: vendor ## build 32-bit mpy-cross port
|
build_unix_frozen: vendor build_cross ## build unix port with frozen modules (from /src)
|
||||||
|
make -C vendor/micropython/unix MICROPY_FORCE_32BIT=1 FROZEN_MPY_DIR=../../../src
|
||||||
|
|
||||||
|
build_cross: vendor ## build mpy-cross port
|
||||||
make -C vendor/micropython/mpy-cross MICROPY_FORCE_32BIT=1
|
make -C vendor/micropython/mpy-cross MICROPY_FORCE_32BIT=1
|
||||||
|
|
||||||
build_frozen: vendor build_cross ## build 32-bit unix port with frozen modules (from vendor/micropython/unix/frozen)
|
|
||||||
make -C vendor/micropython/unix FROZEN_MPY_DIR=frozen MICROPY_FORCE_32BIT=1
|
|
||||||
|
|
||||||
build_unix64: vendor ## build 64-bit unix port
|
|
||||||
make -C vendor/micropython/unix
|
|
||||||
|
|
||||||
build_unix64_debug: vendor ## build 64-bit unix port with debug symbols
|
|
||||||
make -C vendor/micropython/unix
|
|
||||||
|
|
||||||
build_cross64: vendor ## build 64-bit mpy-cross port
|
|
||||||
make -C vendor/micropython/mpy-cross
|
|
||||||
|
|
||||||
build_frozen64: vendor build_cross ## build 64-bit unix port with frozen modules (from vendor/micropython/unix/frozen)
|
|
||||||
make -C vendor/micropython/unix FROZEN_MPY_DIR=frozen
|
|
||||||
|
|
||||||
run: ## run unix port
|
run: ## run unix port
|
||||||
cd src ; ../vendor/micropython/unix/micropython
|
cd src ; ../vendor/micropython/unix/micropython
|
||||||
|
|
||||||
|
@ -10,8 +10,10 @@ def process_file(name):
|
|||||||
return
|
return
|
||||||
if name.endswith('.py'):
|
if name.endswith('.py'):
|
||||||
return
|
return
|
||||||
|
print('processing file %s' % name)
|
||||||
with open(name, 'rb') as f:
|
with open(name, 'rb') as f:
|
||||||
resources[name] = f.read()
|
k = name[4:] # remove 'src/' at the beginning
|
||||||
|
resources[k] = f.read()
|
||||||
|
|
||||||
# scan common resources
|
# scan common resources
|
||||||
for res in os.scandir('src/trezor/res/'):
|
for res in os.scandir('src/trezor/res/'):
|
||||||
@ -25,8 +27,11 @@ for app in os.scandir('src/apps/'):
|
|||||||
if res.is_file():
|
if res.is_file():
|
||||||
process_file('src/apps/%s/res/%s' % (app.name, res.name))
|
process_file('src/apps/%s/res/%s' % (app.name, res.name))
|
||||||
|
|
||||||
with open('src/trezor/res/resources.py', 'wt') as f:
|
resfile = 'src/trezor/res/resources.py'
|
||||||
|
with open(resfile, 'wt') as f:
|
||||||
f.write('resdata = {\n')
|
f.write('resdata = {\n')
|
||||||
for k in sorted(resources.keys()):
|
for k in sorted(resources.keys()):
|
||||||
f.write(" '%s': %s,\n" % (k, resources[k]))
|
f.write(" '%s': %s,\n" % (k, resources[k]))
|
||||||
f.write('}\n')
|
f.write('}\n')
|
||||||
|
|
||||||
|
print('written %s with %d entries' % (resfile, len(resources)))
|
||||||
|
Loading…
Reference in New Issue
Block a user