Skip to content

Commit 0379af1

Browse files
authored
Merge pull request #297 from ARMmbed/list-targets
Add -S option to make.py to list all supported platforms
2 parents 170268f + 292fe9c commit 0379af1

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
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/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)