Skip to content

Commit 9dbf807

Browse files
committed
Aligned make.py and build.py options
1 parent 36ac663 commit 9dbf807

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

tools/build.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,17 @@
116116
default=False,
117117
help="Displays supported matrix of MCUs and toolchains")
118118

119+
parser.add_option('-f', '--filter',
120+
dest='general_filter_regex',
121+
default=None,
122+
help='For some commands you can use filter to filter out results')
123+
119124
parser.add_option("", "--cppcheck",
120125
action="store_true",
121126
dest="cppcheck_validation",
122127
default=False,
123128
help="Forces 'cppcheck' static code analysis")
124129

125-
parser.add_option('-f', '--filter',
126-
dest='general_filter_regex',
127-
default=None,
128-
help='For some commands you can use filter to filter out results')
129-
130130
parser.add_option("-j", "--jobs", type="int", dest="jobs",
131131
default=0, help="Number of concurrent jobs. Default: 0/auto (based on host machine's number of CPUs)")
132132

tools/build_api.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -668,12 +668,12 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None):
668668
from prettytable import PrettyTable # Only use it in this function so building works without extra modules
669669

670670
# All tests status table print
671-
columns = ["Platform"] + unique_supported_toolchains
672-
pt = PrettyTable(["Platform"] + unique_supported_toolchains)
671+
columns = ["Target"] + unique_supported_toolchains
672+
pt = PrettyTable(["Target"] + unique_supported_toolchains)
673673
# Align table
674674
for col in columns:
675675
pt.align[col] = "c"
676-
pt.align["Platform"] = "l"
676+
pt.align["Target"] = "l"
677677

678678
perm_counter = 0
679679
target_counter = 0
@@ -685,25 +685,21 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None):
685685
target_counter += 1
686686

687687
row = [target] # First column is platform name
688-
default_toolchain = TARGET_MAP[target].default_toolchain
689688
for unique_toolchain in unique_supported_toolchains:
690-
text = "-"
691-
if default_toolchain == unique_toolchain:
692-
text = "Default"
693-
perm_counter += 1
694-
elif unique_toolchain in TARGET_MAP[target].supported_toolchains:
689+
if unique_toolchain in TARGET_MAP[target].supported_toolchains:
695690
text = "Supported"
696691
perm_counter += 1
692+
else:
693+
text = "-"
694+
697695
row.append(text)
698696
pt.add_row(row)
699697

700698
result = pt.get_html_string() if verbose_html else pt.get_string()
701699
result += "\n"
702-
result += "*Default - default on-line compiler\n"
703-
result += "*Supported - supported off-line compiler\n"
704-
result += "\n"
705-
result += "Total platforms: %d\n"% (target_counter)
706-
result += "Total permutations: %d"% (perm_counter)
700+
result += "Supported targets: %d\n"% (target_counter)
701+
if target_counter == 1:
702+
result += "Supported toolchains: %d"% (perm_counter)
707703
return result
708704

709705

tools/make.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from tools.targets import TARGET_MAP
4242
from tools.options import get_default_options_parser
4343
from tools.build_api import build_project
44+
from tools.build_api import mcu_toolchain_matrix
4445
try:
4546
import tools.private_settings as ps
4647
except:
@@ -81,6 +82,17 @@
8182
dest="macros",
8283
help="Add a macro definition")
8384

85+
parser.add_option("-S", "--supported-toolchains",
86+
action="store_true",
87+
dest="supported_toolchains",
88+
default=False,
89+
help="Displays supported matrix of MCUs and toolchains")
90+
91+
parser.add_option('-f', '--filter',
92+
dest='general_filter_regex',
93+
default=None,
94+
help='For some commands you can use filter to filter out results')
95+
8496
# Local run
8597
parser.add_option("--automated", action="store_true", dest="automated",
8698
default=False, help="Automated test")
@@ -166,6 +178,11 @@
166178

167179
(options, args) = parser.parse_args()
168180

181+
# Only prints matrix of supported toolchains
182+
if options.supported_toolchains:
183+
print mcu_toolchain_matrix(platform_filter=options.general_filter_regex)
184+
exit(0)
185+
169186
if options.source_dir:
170187
for path in options.source_dir :
171188
if not isfile(path) and not isdir(path) :

0 commit comments

Comments
 (0)