1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-02 09:12:08 +02:00

binman: Use the Makefile to build ELF test files

At present the ELF test files are checked into the U-Boot tree. This is
covenient since the files never change and can be used on non-x86
platforms. However it is not good practice to check in binaries and in
this case it does not seem essential.

Update the binman test-file Makefile to support having source in a
different directory. Adjust binman to run it to build bss_data, as a
start. We can add other files as needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2019-08-24 07:22:53 -06:00
parent 180f556b09
commit 53e22bf38c
4 changed files with 43 additions and 7 deletions

View File

@@ -50,6 +50,29 @@ class FakeSection:
return self.sym_value
def BuildElfTestFiles(target_dir):
"""Build ELF files used for testing in binman
This compiles and links the test files into the specified directory. It the
Makefile and source files in the binman test/ directory.
Args:
target_dir: Directory to put the files into
"""
if not os.path.exists(target_dir):
os.mkdir(target_dir)
testdir = os.path.join(binman_dir, 'test')
# If binman is involved from the main U-Boot Makefile the -r and -R
# flags are set in MAKEFLAGS. This prevents this Makefile from working
# correctly. So drop any make flags here.
if 'MAKEFLAGS' in os.environ:
del os.environ['MAKEFLAGS']
tools.Run('make', '-C', target_dir, '-f',
os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir,
'bss_data', 'u_boot_ucode_ptr')
class TestElf(unittest.TestCase):
@classmethod
def setUpClass(self):