@@ -717,8 +717,8 @@ class MakefileMaker:
717
717
[sjoin (script_path , '-o $@' , * sources )])
718
718
self .object_target ('LIBRARY' , GeneratedFile (generated ), [])
719
719
720
- def list_source_files (self , root , pattern ):
721
- """List the source files matching the specified pattern .
720
+ def list_source_files (self , root , * patterns ):
721
+ """List the source files matching any of the specified patterns .
722
722
723
723
Look for the specified wildcard pattern under all submodules, including
724
724
the root tree. If a given file name is present in multiple submodules,
@@ -734,8 +734,10 @@ class MakefileMaker:
734
734
start = len (submodule_root )
735
735
if submodule :
736
736
start += 1
737
- abs_pattern = os .path .join (submodule_root , pattern )
738
- sources = [src [start :] for src in glob .glob (abs_pattern )]
737
+ sources = []
738
+ for pattern in patterns :
739
+ abs_pattern = os .path .join (submodule_root , pattern )
740
+ sources += [src [start :] for src in glob .glob (abs_pattern )]
739
741
for source_name in sources :
740
742
src = SourceFile (root , submodule , source_name )
741
743
base = src .base ()
@@ -994,7 +996,8 @@ class MakefileMaker:
994
996
definition must come before both targets for programs and tests.
995
997
"""
996
998
tests_common_sources = self .list_source_files (self .options .source ,
997
- 'tests/src/*.c' )
999
+ 'tests/src/*.c' ,
1000
+ 'tests/src/drivers/*.c' )
998
1001
tests_common_objects = []
999
1002
for src in tests_common_sources :
1000
1003
self .object_target ('TESTS' , src , [])
@@ -1420,7 +1423,7 @@ class BuildTreeMaker:
1420
1423
"""Go ahead and prepate the build tree."""
1421
1424
for subdir in ([['include' , 'mbedtls' ],
1422
1425
['library' ],
1423
- ['tests' , 'src' ]] +
1426
+ ['tests' , 'src' , 'drivers' ]] +
1424
1427
[['programs' , d ] for d in self .programs_subdirs ()]):
1425
1428
self .make_subdir (subdir )
1426
1429
source_link = os .path .join (self .options .dir , 'source' )
0 commit comments