mbed-os for GR-LYCHEE

Dependents:   mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more

Embed: (wiki syntax)

« Back to documentation index

tools::build_api Namespace Reference

tools::build_api Namespace Reference

Functions

def prep_report
def prep_properties
def create_result
def add_result_to_report
def get_config
def is_official_target
def transform_release_toolchains
def get_mbed_official_release
def add_regions_to_profile
def prepare_toolchain
def merge_region_list
def scan_resources
def build_project
def build_library
def mbed2_obj_path
 Legacy methods ###.
def build_lib
def build_mbed_libs
def get_unique_supported_toolchains
def mcu_toolchain_matrix
def get_target_supported_toolchains
def print_build_results
def print_build_memory_usage
def write_build_report

Detailed Description

mbed SDK
Copyright (c) 2011-2016 ARM Limited

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Function Documentation

def tools::build_api::add_regions_to_profile (   profile,
  config,
  toolchain_class 
)
Add regions to the build profile, if there are any.

Positional Arguments:
profile - the profile to update
config - the configuration object that owns the region
toolchain_class - the class of the toolchain being used

Definition at line 278 of file build_api.py.

def tools::build_api::add_result_to_report (   report,
  result 
)
Add a single result to a report dictionary

Positional arguments:
report - the report to append to
result - the result to append

Definition at line 98 of file build_api.py.

def tools::build_api::build_lib (   lib_id,
  target,
  toolchain_name,
  verbose = False,
  clean = False,
  macros = None,
  notify = None,
  jobs = 1,
  silent = False,
  report = None,
  properties = None,
  extra_verbose = False,
  build_profile = None 
)
Legacy method for building mbed libraries

Positional arguments:
lib_id - the library's unique identifier
target - the MCU or board that the project will compile for
toolchain_name - the name of the build tools

Keyword arguments:
clean - Rebuild everything if True
verbose - Write the actual tools command lines used if True
macros - additional macros
notify - Notify function for logs
jobs - how many compilers we can run at once
silent - suppress printing of progress indicators
report - a dict where a result may be appended
properties - UUUUHHHHH beats me
extra_verbose - even more output!
build_profile - a dict of flags that will be passed to the compiler

Definition at line 738 of file build_api.py.

def tools::build_api::build_library (   src_paths,
  build_path,
  target,
  toolchain_name,
  dependencies_paths = None,
  name = None,
  clean = False,
  archive = True,
  notify = None,
  verbose = False,
  macros = None,
  inc_dirs = None,
  jobs = 1,
  silent = False,
  report = None,
  properties = None,
  extra_verbose = False,
  project_id = None,
  remove_config_header_file = False,
  app_config = None,
  build_profile = None 
)
Build a library

Positional arguments:
src_paths - a path or list of paths that contain all files needed to build
            the library
build_path - the directory where all of the object files will be placed
target - the MCU or board that the project will compile for
toolchain_name - the name of the build tools

Keyword arguments:
dependencies_paths - The location of libraries to include when linking
name - the name of the library
clean - Rebuild everything if True
archive - whether the library will create an archive file
notify - Notify function for logs
verbose - Write the actual tools command lines used if True
macros - additional macros
inc_dirs - additional directories where include files may be found
jobs - how many compilers we can run at once
silent - suppress printing of progress indicators
report - a dict where a result may be appended
properties - UUUUHHHHH beats me
extra_verbose - even more output!
project_id - the name that goes in the report
remove_config_header_file - delete config header file when done building
app_config - location of a chosen mbed_app.json file
build_profile - a dict of flags that will be passed to the compiler

Definition at line 576 of file build_api.py.

def tools::build_api::build_mbed_libs (   target,
  toolchain_name,
  verbose = False,
  clean = False,
  macros = None,
  notify = None,
  jobs = 1,
  silent = False,
  report = None,
  properties = None,
  extra_verbose = False,
  build_profile = None 
)
Function returns True is library was built and false if building was
skipped

Positional arguments:
target - the MCU or board that the project will compile for
toolchain_name - the name of the build tools

Keyword arguments:
verbose - Write the actual tools command lines used if True
clean - Rebuild everything if True
macros - additional macros
notify - Notify function for logs
jobs - how many compilers we can run at once
silent - suppress printing of progress indicators
report - a dict where a result may be appended
properties - UUUUHHHHH beats me
extra_verbose - even more output!
build_profile - a dict of flags that will be passed to the compiler

Definition at line 903 of file build_api.py.

def tools::build_api::build_project (   src_paths,
  build_path,
  target,
  toolchain_name,
  libraries_paths = None,
  linker_script = None,
  clean = False,
  notify = None,
  verbose = False,
  name = None,
  macros = None,
  inc_dirs = None,
  jobs = 1,
  silent = False,
  report = None,
  properties = None,
  project_id = None,
  project_description = None,
  extra_verbose = False,
  config = None,
  app_config = None,
  build_profile = None 
)
Build a project. A project may be a test or a user program.

Positional arguments:
src_paths - a path or list of paths that contain all files needed to build
            the project
build_path - the directory where all of the object files will be placed
target - the MCU or board that the project will compile for
toolchain_name - the name of the build tools

Keyword arguments:
libraries_paths - The location of libraries to include when linking
linker_script - the file that drives the linker to do it's job
clean - Rebuild everything if True
notify - Notify function for logs
verbose - Write the actual tools command lines used if True
name - the name of the project
macros - additional macros
inc_dirs - additional directories where include files may be found
jobs - how many compilers we can run at once
silent - suppress printing of progress indicators
report - a dict where a result may be appended
properties - UUUUHHHHH beats me
project_id - the name put in the report
project_description - the human-readable version of what this thing does
extra_verbose - even more output!
config - a Config object to use instead of creating one
app_config - location of a chosen mbed_app.json file
build_profile - a dict of flags that will be passed to the compiler

Definition at line 426 of file build_api.py.

def tools::build_api::create_result (   target_name,
  toolchain_name,
  id_name,
  description 
)
Create a result dictionary

Positional arguments:
target_name - the target being built for
toolchain_name - the toolchain doing the building
id_name - the name of the executable or library being built
description - a human readable description of what's going on

Definition at line 79 of file build_api.py.

def tools::build_api::get_config (   src_paths,
  target,
  toolchain_name 
)
Get the configuration object for a target-toolchain combination

Positional arguments:
src_paths - paths to scan for the configuration files
target - the device we are building for
toolchain_name - the string that identifies the build tools

Definition at line 111 of file build_api.py.

def tools::build_api::get_mbed_official_release (   version )
Given a release version string, return a tuple that contains a target
and the supported toolchains for that release.
Ex. Given '2', return (('LPC1768', ('ARM', 'GCC_ARM')),
                       ('K64F', ('ARM', 'GCC_ARM')), ...)

Positional arguments:
version - The version string. Should be a string contained within
          RELEASE_VERSIONS

Definition at line 245 of file build_api.py.

def tools::build_api::get_target_supported_toolchains (   target )
Returns target supported toolchains list

Positional arguments:
target - the target to get the supported toolchains of

Definition at line 1193 of file build_api.py.

def tools::build_api::get_unique_supported_toolchains (   release_targets = None )
Get list of all unique toolchains supported by targets

Keyword arguments:
release_targets - tuple structure returned from get_mbed_official_release().
                  If release_targets is not specified, then it queries all
                  known targets

Definition at line 1078 of file build_api.py.

def tools::build_api::is_official_target (   target_name,
  version 
)
Returns True, None if a target is part of the official release for the
given version. Return False, 'reason' if a target is not part of the
official release for the given version.

Positional arguments:
target_name - Name if the target (ex. 'K64F')
version - The release version string. Should be a string contained within
          RELEASE_VERSIONS

Definition at line 153 of file build_api.py.

def tools::build_api::mbed2_obj_path (   target_name,
  toolchain_name 
)

Legacy methods ###.

Definition at line 734 of file build_api.py.

def tools::build_api::mcu_toolchain_matrix (   verbose_html = False,
  platform_filter = None,
  release_version = '5' 
)
Shows target map using prettytable

Keyword arguments:
verbose_html - emit html instead of a simple table
platform_filter - remove results that match the string
release_version - get the matrix for this major version number

Definition at line 1102 of file build_api.py.

def tools::build_api::merge_region_list (   region_list,
  destination,
  padding = b'\xFF' 
)
Merege the region_list into a single image

Positional Arguments:
region_list - list of regions, which should contain filenames
destination - file name to write all regions to
padding - bytes to fill gapps with

Definition at line 352 of file build_api.py.

def tools::build_api::prep_properties (   properties,
  target_name,
  toolchain_name,
  vendor_label 
)
Setup test properties

Positional arguments:
properties - the dict to fill
target_name - the target the test is targeting
toolchain_name - the toolchain that will compile the test
vendor_label - the vendor

Definition at line 60 of file build_api.py.

def tools::build_api::prep_report (   report,
  target_name,
  toolchain_name,
  id_name 
)
Setup report keys

Positional arguments:
report - the report to fill
target_name - the target being used
toolchain_name - the toolchain being used
id_name - the name of the executable or library being built

Definition at line 42 of file build_api.py.

def tools::build_api::prepare_toolchain (   src_paths,
  build_dir,
  target,
  toolchain_name,
  macros = None,
  clean = False,
  jobs = 1,
  notify = None,
  silent = False,
  verbose = False,
  extra_verbose = False,
  config = None,
  app_config = None,
  build_profile = None 
)
Prepares resource related objects - toolchain, target, config

Positional arguments:
src_paths - the paths to source directories
target - ['LPC1768', 'LPC11U24', 'LPC2368', etc.]
toolchain_name - ['ARM', 'uARM', 'GCC_ARM', 'GCC_CR']

Keyword arguments:
macros - additional macros
clean - Rebuild everything if True
jobs - how many compilers we can run at once
notify - Notify function for logs
silent - suppress printing of progress indicators
verbose - Write the actual tools command lines used if True
extra_verbose - even more output!
config - a Config object to use instead of creating one
app_config - location of a chosen mbed_app.json file
build_profile - a dict of flags that will be passed to the compiler

Definition at line 302 of file build_api.py.

def tools::build_api::print_build_memory_usage (   report )
Generate result table with memory usage values for build results
Aggregates (puts together) reports obtained from self.get_memory_summary()

Positional arguments:
report - Report generated during build procedure.

Definition at line 1217 of file build_api.py.

def tools::build_api::print_build_results (   result_list,
  build_name 
)
Generate result string for build results

Positional arguments:
result_list - the list of results to print
build_name - the name of the build we are printing result for

Definition at line 1203 of file build_api.py.

def tools::build_api::scan_resources (   src_paths,
  toolchain,
  dependencies_paths = None,
  inc_dirs = None,
  base_path = None 
)
Scan resources using initialized toolcain

Positional arguments
src_paths - the paths to source directories
toolchain - valid toolchain object
dependencies_paths - dependency paths that we should scan for include dirs
inc_dirs - additional include directories which should be added to
           the scanner resources

Definition at line 387 of file build_api.py.

def tools::build_api::transform_release_toolchains (   toolchains,
  version 
)
Given a list of toolchains and a release version, return a list of
only the supported toolchains for that release

Positional arguments:
toolchains - The list of toolchains
version - The release version string. Should be a string contained within
          RELEASE_VERSIONS

Definition at line 230 of file build_api.py.

def tools::build_api::write_build_report (   build_report,
  template_filename,
  filename 
)
Write a build report to disk using a template file

Positional arguments:
build_report - a report generated by the build system
template_filename - a file that contains the template for the style of build
                    report
filename - the location on disk to write the file to

Definition at line 1266 of file build_api.py.