dtoc: Allow providing a directory to write files to

At present dtoc writes only a single file on each invocation. U-Boot
writes the two files it needs by separate invocations of dtoc. Since dtoc
now scans all U-Boot driver source, this is fairly slow (about 1 second
per file).

It would be better if dtoc could write all the files at once.

In preparation for this, add a way to specify an output directory for the
files.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-12-28 20:34:50 -07:00
parent de846cbb30
commit 192c111cfc
3 changed files with 19 additions and 10 deletions

View File

@@ -87,6 +87,10 @@ if __name__ != '__main__':
parser = OptionParser()
parser.add_option('-B', '--build-dir', type='string', default='b',
help='Directory containing the build output')
parser.add_option('-c', '--c-output-dir', action='store',
help='Select output directory for C files')
parser.add_option('-C', '--h-output-dir', action='store',
help='Select output directory for H files (defaults to --c-output-di)')
parser.add_option('-d', '--dtb-file', action='store',
help='Specify the .dtb input file')
parser.add_option('--include-disabled', action='store_true',
@@ -111,4 +115,5 @@ elif options.test_coverage:
else:
dtb_platdata.run_steps(args, options.dtb_file, options.include_disabled,
options.output)
options.output,
[options.c_output_dir, options.h_output_dir])