25
25
26
26
from tools .utils import mkdir , run_cmd , run_cmd_ext , NotSupportedException ,\
27
27
ToolException , InvalidReleaseTargetException
28
- from tools .paths import MBED_TARGETS_PATH , MBED_LIBRARIES , MBED_API , MBED_HAL ,\
29
- MBED_COMMON , MBED_CONFIG_FILE
28
+ from tools .paths import MBED_TARGETS_PATH , MBED_LIBRARIES , MBED_HEADER ,\
29
+ MBED_DRIVERS , MBED_PLATFORM , MBED_HAL , MBED_CONFIG_FILE
30
30
from tools .targets import TARGET_NAMES , TARGET_MAP
31
31
from tools .libraries import Library
32
32
from tools .toolchains import TOOLCHAIN_CLASSES
@@ -904,13 +904,16 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
904
904
('MBED' , target .name , toolchain_name ))
905
905
906
906
# Common Headers
907
- toolchain .copy_files (toolchain .scan_resources (MBED_API ).headers ,
907
+ 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 ,
908
911
MBED_LIBRARIES )
909
912
toolchain .copy_files (toolchain .scan_resources (MBED_HAL ).headers ,
910
913
MBED_LIBRARIES )
911
914
912
915
# Target specific sources
913
- hal_src = join ( MBED_TARGETS_PATH , "hal" )
916
+ hal_src = MBED_TARGETS_PATH
914
917
hal_implementation = toolchain .scan_resources (hal_src )
915
918
toolchain .copy_files (hal_implementation .headers +
916
919
hal_implementation .hex_files +
@@ -922,7 +925,9 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
922
925
[MBED_LIBRARIES ] + incdirs )
923
926
924
927
# Common Sources
925
- mbed_resources = toolchain .scan_resources (MBED_COMMON )
928
+ mbed_resources = toolchain .scan_resources (MBED_DRIVERS )
929
+ mbed_resources += toolchain .scan_resources (MBED_PLATFORM )
930
+ mbed_resources += toolchain .scan_resources (MBED_HAL )
926
931
objects += toolchain .compile_sources (mbed_resources , tmp_path ,
927
932
[MBED_LIBRARIES ] + incdirs )
928
933
@@ -1187,7 +1192,10 @@ def static_analysis_scan(target, toolchain_name, cppcheck_cmd,
1187
1192
('MBED' , target .name , toolchain_name ))
1188
1193
1189
1194
# Common Headers
1190
- toolchain .copy_files (toolchain .scan_resources (MBED_API ).headers ,
1195
+ toolchain .copy_files ([MBED_HEADER ], MBED_LIBRARIES )
1196
+ toolchain .copy_files (toolchain .scan_resources (MBED_DRIVERS ).headers ,
1197
+ MBED_LIBRARIES )
1198
+ toolchain .copy_files (toolchain .scan_resources (MBED_PLATFORM ).headers ,
1191
1199
MBED_LIBRARIES )
1192
1200
toolchain .copy_files (toolchain .scan_resources (MBED_HAL ).headers ,
1193
1201
MBED_LIBRARIES )
@@ -1217,8 +1225,8 @@ def static_analysis_scan(target, toolchain_name, cppcheck_cmd,
1217
1225
# command line
1218
1226
mbed_includes = ["-I%s" % i for i in mbed_resources .inc_dirs ]
1219
1227
mbed_includes .append ("-I%s" % str (build_target ))
1220
- mbed_includes .append ("-I%s" % str (MBED_COMMON ))
1221
- mbed_includes .append ("-I%s" % str (MBED_API ))
1228
+ mbed_includes .append ("-I%s" % str (MBED_DRIVERS ))
1229
+ mbed_includes .append ("-I%s" % str (MBED_PLATFORM ))
1222
1230
mbed_includes .append ("-I%s" % str (MBED_HAL ))
1223
1231
mbed_c_sources = " " .join (mbed_resources .c_sources )
1224
1232
mbed_cpp_sources = " " .join (mbed_resources .cpp_sources )
0 commit comments