Clone of official tools

Revision:
30:f12ce67666d0
Parent:
29:1210849dba19
Child:
31:8ea194f6145b
--- a/build_api.py	Mon Aug 29 11:18:36 2016 +0100
+++ b/build_api.py	Mon Aug 29 11:56:59 2016 +0100
@@ -17,19 +17,21 @@
 
 import re
 import tempfile
+
 from types import ListType
 from shutil import rmtree
 from os.path import join, exists, basename, abspath, normpath, dirname
-from os import linesep, remove
+from os import linesep
 from time import time
 
 from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException,\
     ToolException, InvalidReleaseTargetException
 from tools.paths import MBED_TARGETS_PATH, MBED_LIBRARIES, MBED_API, MBED_HAL,\
     MBED_COMMON, MBED_CONFIG_FILE
-from tools.targets import TARGET_NAMES, TARGET_MAP, set_targets_json_location
+from tools.targets import TARGET_NAMES, TARGET_MAP
 from tools.libraries import Library
 from tools.toolchains import TOOLCHAIN_CLASSES, mbedToolchain
+from tools.targets import set_targets_json_location
 from tools.build_profiles import find_build_profile, get_toolchain_profile, find_targets_json
 from jinja2 import FileSystemLoader
 from jinja2.environment import Environment
@@ -199,12 +201,12 @@
                     ("following toolchains: %s" %
                      ", ".join(supported_toolchains_sorted))
 
-            elif not target.default_lib == 'std':
+            elif not target.default_build == 'standard':
                 result = False
                 reason = ("Target '%s' must set the " % target.name) + \
-                    ("'default_lib' to 'std' to be included in the ") + \
+                    ("'default_build' to 'standard' to be included in the ") + \
                     ("mbed OS 5.0 official release." + linesep) + \
-                    ("Currently it is set to '%s'" % target.default_lib)
+                    ("Currently it is set to '%s'" % target.default_build)
 
         else:
             result = False
@@ -527,8 +529,7 @@
                   dependencies_paths=None, options=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):
+                  properties=None, extra_verbose=False, project_id=None):
     """ Build a library
 
     Positional arguments:
@@ -554,7 +555,6 @@
     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
     """
 
     # Convert src_path to a list if needed
@@ -622,8 +622,6 @@
         toolchain.copy_files(resources.objects, build_path, resources=resources)
         toolchain.copy_files(resources.libraries, build_path,
                              resources=resources)
-        toolchain.copy_files(resources.json_files, build_path,
-                             resources=resources)
         if resources.linker_script:
             toolchain.copy_files(resources.linker_script, build_path,
                                  resources=resources)
@@ -640,11 +638,6 @@
         if archive:
             toolchain.build_library(objects, build_path, name)
 
-        if remove_config_header_file:
-            config_header_path = toolchain.get_config_header()
-            if config_header_path:
-                remove(config_header_path)
-
         if report != None:
             end = time()
             cur_result["elapsed_time"] = end - start