From ab0fc59e52628f32e91b5625c6039f09ff728f5e Mon Sep 17 00:00:00 2001 From: screamer Date: Wed, 6 Apr 2016 03:21:24 +0100 Subject: [PATCH] Add support for project naming based on current directory Cleanup print output --- tools/build_api.py | 9 +++++---- tools/toolchains/__init__.py | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/build_api.py b/tools/build_api.py index 6a19eb0483..76a627c463 100644 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -23,6 +23,7 @@ import colorama from types import ListType from shutil import rmtree from os.path import join, exists, basename +from os import getcwd from time import time from tools.utils import mkdir, run_cmd, run_cmd_ext, NotSupportedException @@ -91,15 +92,15 @@ def build_project(src_path, build_path, target, toolchain_name, # We need to remove all paths which are repeated to avoid # multiple compilations and linking with the same objects src_paths = [src_paths[0]] + list(set(src_paths[1:])) - PROJECT_BASENAME = basename(src_paths[0]) + project_name = basename(src_paths[0] if src_paths[0] != "." and src_paths[0] != "./" else getcwd()) if name is None: # We will use default project name based on project folder name - name = PROJECT_BASENAME - toolchain.info("Building project %s (%s, %s)" % (PROJECT_BASENAME.upper(), target.name, toolchain_name)) + name = project_name + toolchain.info("Building project %s (%s, %s)" % (project_name, target.name, toolchain_name)) else: # User used custom global project name to have the same name for the - toolchain.info("Building project %s to %s (%s, %s)" % (PROJECT_BASENAME.upper(), name, target.name, toolchain_name)) + toolchain.info("Building project %s to %s (%s, %s)" % (project_name, name, target.name, toolchain_name)) if report != None: diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 86b2ddd65b..4dcc59b5c7 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -496,7 +496,6 @@ class mbedToolchain: for source in files_to_compile: _, name, _ = split_path(source) object = self.relative_object_path(build_path, base_path, source) - print object # Queue mode (multiprocessing) commands = self.compile_command(source, object, inc_paths)