mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 01:18:28 +00:00
scons: fix FrozenModule, simplify usage
This commit is contained in:
parent
684892f1ed
commit
9b03a16b43
19
SConscript
19
SConscript
@ -456,7 +456,6 @@ SOURCE_PY = [
|
||||
]
|
||||
|
||||
env = Environment(
|
||||
VARIANT_DIR='build',
|
||||
SED='sed',
|
||||
AS='arm-none-eabi-as',
|
||||
AR='arm-none-eabi-ar',
|
||||
@ -518,15 +517,19 @@ hdr_version = env.Command(
|
||||
# Qstrings
|
||||
#
|
||||
|
||||
qstr_micropython = 'vendor/micropython/py/qstrdefs.h'
|
||||
|
||||
qstr_collected = env.CollectQstr(
|
||||
target='genhdr/qstrdefs.collected.h', source=SOURCE_QSTR)
|
||||
target='genhdr/qstrdefs.collected.h',
|
||||
source=SOURCE_QSTR)
|
||||
|
||||
qstr_preprocessed = env.PreprocessQstr(
|
||||
target='genhdr/qstrdefs.preprocessed.h',
|
||||
source=['vendor/micropython/py/qstrdefs.h', qstr_collected])
|
||||
source=[qstr_micropython, qstr_collected])
|
||||
|
||||
qstr_generated = env.GenerateQstrDefs(
|
||||
target='genhdr/qstrdefs.generated.h', source=qstr_preprocessed)
|
||||
target='genhdr/qstrdefs.generated.h',
|
||||
source=qstr_preprocessed)
|
||||
|
||||
env.Ignore(qstr_collected, qstr_generated)
|
||||
|
||||
@ -534,10 +537,12 @@ env.Ignore(qstr_collected, qstr_generated)
|
||||
# Frozen modules
|
||||
#
|
||||
|
||||
source_mpy = env.FrozenModule(source=SOURCE_PY, suffix='.mpy')
|
||||
source_mpy = env.FrozenModule(source=SOURCE_PY)
|
||||
|
||||
source_mpyc = env.FrozenSource(
|
||||
target='frozen_mpy.c', source=source_mpy, qstr_header=qstr_preprocessed)
|
||||
source_mpyc = env.FrozenCFile(
|
||||
target='frozen_mpy.c',
|
||||
source=source_mpy,
|
||||
qstr_header=qstr_preprocessed)
|
||||
|
||||
env.Depends(source_mpyc, qstr_generated)
|
||||
|
||||
|
@ -20,10 +20,12 @@ def generate(env):
|
||||
action='$MAKEQSTRDATA $SOURCE > $TARGET', )
|
||||
|
||||
env['BUILDERS']['FrozenModule'] = SCons.Builder.Builder(
|
||||
action='$MPY_CROSS -o $TARGET -s $SOURCE $SOURCE', suffix='.mpy')
|
||||
action='$MPY_CROSS -o $TARGET -s $SOURCE $SOURCE',
|
||||
suffix='.mpy',
|
||||
single_source=True, )
|
||||
|
||||
env['BUILDERS']['FrozenSource'] = SCons.Builder.Builder(
|
||||
action='$MPY_TOOL -f -q $qstr_header $SOURCES > $TARGET')
|
||||
env['BUILDERS']['FrozenCFile'] = SCons.Builder.Builder(
|
||||
action='$MPY_TOOL -f -q $qstr_header $SOURCES > $TARGET', )
|
||||
|
||||
|
||||
def exists(env):
|
||||
|
Loading…
Reference in New Issue
Block a user