26
26
from tools .utils import mkdir , run_cmd , run_cmd_ext , NotSupportedException ,\
27
27
ToolException , InvalidReleaseTargetException
28
28
from tools .paths import MBED_TARGETS_PATH , MBED_LIBRARIES , MBED_HEADER ,\
29
- MBED_DRIVERS , MBED_PLATFORM , MBED_HAL , MBED_CONFIG_FILE
29
+ MBED_DRIVERS , MBED_PLATFORM , MBED_HAL , MBED_CONFIG_FILE ,\
30
+ MBED_LIBRARIES_DRIVERS , MBED_LIBRARIES_PLATFORM , MBED_LIBRARIES_HAL ,\
31
+ BUILD_DIR
30
32
from tools .targets import TARGET_NAMES , TARGET_MAP
31
33
from tools .libraries import Library
32
34
from tools .toolchains import TOOLCHAIN_CLASSES
@@ -772,6 +774,8 @@ def build_lib(lib_id, target, toolchain_name, verbose=False,
772
774
for resource in resources :
773
775
toolchain .copy_files (resource .headers , build_path ,
774
776
resources = resource )
777
+ toolchain .copy_files (resource .headers , join (build_path , name ),
778
+ resources = resource )
775
779
776
780
dependencies_include_dir .extend (
777
781
toolchain .scan_resources (build_path ).inc_dirs )
@@ -905,12 +909,12 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
905
909
906
910
# Common Headers
907
911
toolchain .copy_files ([MBED_HEADER ], MBED_LIBRARIES )
908
- toolchain . copy_files ( toolchain . scan_resources ( MBED_DRIVERS ). headers ,
909
- MBED_LIBRARIES )
910
- toolchain . copy_files ( toolchain . scan_resources ( MBED_PLATFORM ). headers ,
911
- MBED_LIBRARIES )
912
- toolchain .copy_files (toolchain . scan_resources ( MBED_HAL ). headers ,
913
- MBED_LIBRARIES )
912
+ for dir , dest in [( MBED_DRIVERS , MBED_LIBRARIES_DRIVERS ) ,
913
+ ( MBED_PLATFORM , MBED_LIBRARIES_PLATFORM ),
914
+ ( MBED_HAL , MBED_LIBRARIES_HAL )]:
915
+ resources = toolchain . scan_resources ( dir )
916
+ toolchain .copy_files (resources . headers , MBED_LIBRARIES )
917
+ toolchain . copy_files ( resources . headers , dest )
914
918
915
919
# Target specific sources
916
920
hal_src = MBED_TARGETS_PATH
@@ -925,14 +929,14 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
925
929
[MBED_LIBRARIES ] + incdirs )
926
930
927
931
# Common Sources
928
- mbed_resources = toolchain .scan_resources (MBED_DRIVERS )
929
- mbed_resources += toolchain .scan_resources (MBED_PLATFORM )
930
- mbed_resources += toolchain .scan_resources (MBED_HAL )
932
+ mbed_resources = None
933
+ for dir in [MBED_DRIVERS , MBED_PLATFORM , MBED_HAL ]:
934
+ mbed_resources += toolchain .scan_resources (dir )
935
+
931
936
objects += toolchain .compile_sources (mbed_resources , tmp_path ,
932
- [MBED_LIBRARIES ] + incdirs )
937
+ [MBED_LIBRARIES ] + incdirs )
933
938
934
939
# A number of compiled files need to be copied as objects as opposed to
935
- # being part of the mbed library, for reasons that have to do with the
936
940
# way the linker search for symbols in archives. These are:
937
941
# - retarget.o: to make sure that the C standard lib symbols get
938
942
# overridden
0 commit comments