Skip to content

Commit 960d69f

Browse files
committed
restructure - Updated tools to point to restructured modules
MBED_HAL /hal/hal x MBED_API /hal/api x MBED_COMMON /hal/common x MBED_TARGETS /hal/targets -> /targets MBED_DRIVERS + /drivers MBED_PLATFORM + /platform MBED_HEADER + /mbed.h
1 parent ba99a1f commit 960d69f

File tree

5 files changed

+24
-16
lines changed

5 files changed

+24
-16
lines changed

tools/build_api.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException,\
2727
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
3030
from tools.targets import TARGET_NAMES, TARGET_MAP
3131
from tools.libraries import Library
3232
from tools.toolchains import TOOLCHAIN_CLASSES
@@ -904,13 +904,16 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
904904
('MBED', target.name, toolchain_name))
905905

906906
# 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,
908911
MBED_LIBRARIES)
909912
toolchain.copy_files(toolchain.scan_resources(MBED_HAL).headers,
910913
MBED_LIBRARIES)
911914

912915
# Target specific sources
913-
hal_src = join(MBED_TARGETS_PATH, "hal")
916+
hal_src = MBED_TARGETS_PATH
914917
hal_implementation = toolchain.scan_resources(hal_src)
915918
toolchain.copy_files(hal_implementation.headers +
916919
hal_implementation.hex_files +
@@ -922,7 +925,9 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
922925
[MBED_LIBRARIES] + incdirs)
923926

924927
# 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)
926931
objects += toolchain.compile_sources(mbed_resources, tmp_path,
927932
[MBED_LIBRARIES] + incdirs)
928933

@@ -1187,7 +1192,10 @@ def static_analysis_scan(target, toolchain_name, cppcheck_cmd,
11871192
('MBED', target.name, toolchain_name))
11881193

11891194
# 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,
11911199
MBED_LIBRARIES)
11921200
toolchain.copy_files(toolchain.scan_resources(MBED_HAL).headers,
11931201
MBED_LIBRARIES)
@@ -1217,8 +1225,8 @@ def static_analysis_scan(target, toolchain_name, cppcheck_cmd,
12171225
# command line
12181226
mbed_includes = ["-I%s" % i for i in mbed_resources.inc_dirs]
12191227
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))
12221230
mbed_includes.append("-I%s"% str(MBED_HAL))
12231231
mbed_c_sources = " ".join(mbed_resources.c_sources)
12241232
mbed_cpp_sources = " ".join(mbed_resources.cpp_sources)

tools/build_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
print str(e)
183183

184184
# copy targets.json file as part of the release
185-
copy(join(dirname(abspath(__file__)), '..', 'hal', 'targets.json'), MBED_LIBRARIES)
185+
copy(join(dirname(abspath(__file__)), '..', 'targets', 'targets.json'), MBED_LIBRARIES)
186186

187187
# Write summary of the builds
188188
if options.report_build_file_name:

tools/paths.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
TOOLS_BOOTLOADERS = join(TOOLS, "bootloaders")
3232

3333
# mbed libraries
34-
MBED_BASE = join(ROOT, "hal")
34+
MBED_HEADER = join(ROOT, "mbed.h")
35+
MBED_DRIVERS = join(ROOT, "drivers")
36+
MBED_PLATFORM = join(ROOT, "platform")
37+
MBED_HAL = join(ROOT, "hal")
3538

36-
MBED_API = join(MBED_BASE, "api")
37-
MBED_COMMON = join(MBED_BASE, "common")
38-
MBED_HAL = join(MBED_BASE, "hal")
39-
MBED_TARGETS_PATH = join(MBED_BASE, "targets")
39+
MBED_TARGETS_PATH = join(ROOT, "targets")
4040

4141
MBED_LIBRARIES = join(BUILD_DIR, "mbed")
4242

tools/synch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# Tuple data: (repo_name, list_of_code_dirs, [team])
4848
# team is optional - if not specified, the code is published under mbed_official
4949
OFFICIAL_CODE = (
50-
("mbed-dev" , MBED_BASE),
50+
("mbed-dev" , [MBED_DRIVERS, MBED_PLATFORM, MBED_HAL]),
5151
("mbed-rtos", RTOS),
5252
("mbed-dsp" , DSP),
5353
("mbed-rpc" , MBED_RPC),

tools/targets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Target(namedtuple("Target", "name json_data resolution_order resolution_or
120120

121121
# Default location of the 'targets.json' file
122122
__targets_json_location_default = os.path.join(
123-
os.path.dirname(os.path.abspath(__file__)), '..', 'hal', 'targets.json')
123+
os.path.dirname(os.path.abspath(__file__)), '..', 'targets', 'targets.json')
124124

125125
# Current/new location of the 'targets.json' file
126126
__targets_json_location = None

0 commit comments

Comments
 (0)