|
23 | 23 | from types import ListType
|
24 | 24 | from shutil import rmtree
|
25 | 25 | from os.path import join, exists, basename
|
| 26 | +from os import getcwd |
26 | 27 | from time import time
|
27 | 28 |
|
28 | 29 | 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,
|
91 | 92 | # We need to remove all paths which are repeated to avoid
|
92 | 93 | # multiple compilations and linking with the same objects
|
93 | 94 | src_paths = [src_paths[0]] + list(set(src_paths[1:]))
|
94 |
| - PROJECT_BASENAME = basename(src_paths[0]) |
| 95 | + project_name = basename(src_paths[0] if src_paths[0] != "." and src_paths[0] != "./" else getcwd()) |
95 | 96 |
|
96 | 97 | if name is None:
|
97 | 98 | # We will use default project name based on project folder name
|
98 |
| - name = PROJECT_BASENAME |
99 |
| - toolchain.info("Building project %s (%s, %s)" % (PROJECT_BASENAME.upper(), target.name, toolchain_name)) |
| 99 | + name = project_name |
| 100 | + toolchain.info("Building project %s (%s, %s)" % (project_name, target.name, toolchain_name)) |
100 | 101 | else:
|
101 | 102 | # User used custom global project name to have the same name for the
|
102 |
| - toolchain.info("Building project %s to %s (%s, %s)" % (PROJECT_BASENAME.upper(), name, target.name, toolchain_name)) |
| 103 | + toolchain.info("Building project %s to %s (%s, %s)" % (project_name, name, target.name, toolchain_name)) |
103 | 104 |
|
104 | 105 |
|
105 | 106 | if report != None:
|
|
0 commit comments