mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-28 18:38:39 +00:00
scons: fix frozen module names
This commit is contained in:
parent
d431e0b983
commit
2d69930317
@ -455,6 +455,7 @@ SOURCE_PY = [
|
||||
'src/trezor/wire/codec_v2.py',
|
||||
'src/trezor/workflow.py',
|
||||
]
|
||||
SOURCE_PY_DIR = 'src/'
|
||||
|
||||
env = Environment()
|
||||
|
||||
@ -543,7 +544,7 @@ env.Ignore(qstr_collected, qstr_generated)
|
||||
# Frozen modules
|
||||
#
|
||||
|
||||
source_mpy = env.FrozenModule(source=SOURCE_PY)
|
||||
source_mpy = env.FrozenModule(source=SOURCE_PY, source_dir=SOURCE_PY_DIR)
|
||||
|
||||
source_mpyc = env.FrozenCFile(
|
||||
target='frozen_mpy.c', source=source_mpy, qstr_header=qstr_preprocessed)
|
||||
@ -555,19 +556,20 @@ env.Depends(source_mpyc, qstr_generated)
|
||||
#
|
||||
|
||||
obj_program = []
|
||||
obj_program += env.Object(source=SOURCE_MOD)
|
||||
obj_program += env.Object(source=SOURCE_FIRMWARE)
|
||||
obj_program += env.Object(source=SOURCE_MICROPYTHON)
|
||||
obj_program += env.Object(source=SOURCE_STMHAL)
|
||||
obj_program += env.Object(source=SOURCE_TREZORHAL)
|
||||
obj_program += env.Object(source=source_mpyc)
|
||||
obj_program.extend(env.Object(source=SOURCE_MOD))
|
||||
obj_program.extend(env.Object(source=SOURCE_FIRMWARE))
|
||||
obj_program.extend(env.Object(source=SOURCE_MICROPYTHON))
|
||||
obj_program.extend(env.Object(source=SOURCE_STMHAL))
|
||||
obj_program.extend(env.Object(source=SOURCE_TREZORHAL))
|
||||
obj_program.extend(env.Object(source=source_mpyc))
|
||||
|
||||
obj_program += env.Command(
|
||||
obj_program.extend(
|
||||
env.Command(
|
||||
target='embed/firmware/vendorheader.o',
|
||||
source='embed/firmware/vendorheader.bin',
|
||||
action='$OBJCOPY -I binary -O elf32-littlearm -B arm'
|
||||
' --rename-section .data=.vendorheader,alloc,load,readonly,contents'
|
||||
' $SOURCE $TARGET', )
|
||||
' $SOURCE $TARGET', ))
|
||||
|
||||
env.Depends(obj_program, qstr_generated)
|
||||
|
||||
|
@ -19,8 +19,15 @@ def generate(env):
|
||||
env['BUILDERS']['GenerateQstrDefs'] = SCons.Builder.Builder(
|
||||
action='$MAKEQSTRDATA $SOURCE > $TARGET', )
|
||||
|
||||
def generate_frozen_module(source, target, env, for_signature):
|
||||
target = str(target[0])
|
||||
source = str(source[0])
|
||||
source_name = source.replace(env['source_dir'], '')
|
||||
return '$MPY_CROSS -o %s -s %s %s' % (target, source_name, source)
|
||||
|
||||
env['BUILDERS']['FrozenModule'] = SCons.Builder.Builder(
|
||||
action='$MPY_CROSS -o $TARGET $SOURCE',
|
||||
# action='$MPY_CROSS -o $TARGET -s $SOURCE $SOURCE',
|
||||
generator=generate_frozen_module,
|
||||
suffix='.mpy',
|
||||
single_source=True, )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user