Brian Daniels / mbed-tools

Fork of mbed-tools by Morpheus

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers options.py Source File

options.py

00001 """
00002 mbed SDK
00003 Copyright (c) 2011-2013 ARM Limited
00004 
00005 Licensed under the Apache License, Version 2.0 (the "License");
00006 you may not use this file except in compliance with the License.
00007 You may obtain a copy of the License at
00008 
00009     http://www.apache.org/licenses/LICENSE-2.0
00010 
00011 Unless required by applicable law or agreed to in writing, software
00012 distributed under the License is distributed on an "AS IS" BASIS,
00013 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 See the License for the specific language governing permissions and
00015 limitations under the License.
00016 """
00017 from optparse import OptionParser
00018 from tools.toolchains import TOOLCHAINS
00019 from tools.targets import TARGET_NAMES
00020 
00021 
00022 def get_default_options_parser():
00023     parser = OptionParser()
00024 
00025     targetnames = TARGET_NAMES
00026     targetnames.sort()
00027     toolchainlist = list(TOOLCHAINS)
00028     toolchainlist.sort()
00029 
00030     parser.add_option("-m", "--mcu",
00031                   help="build for the given MCU (%s)" % ', '.join(targetnames),
00032                   metavar="MCU")
00033 
00034     parser.add_option("-t", "--tool",
00035                   help="build using the given TOOLCHAIN (%s)" % ', '.join(toolchainlist),
00036                   metavar="TOOLCHAIN")
00037 
00038     parser.add_option("-c", "--clean", action="store_true", default=False,
00039                   help="clean the build directory")
00040 
00041     parser.add_option("-o", "--options", action="append",
00042                   help='Add a build option ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information, "analyze": run Goanna static code analyzer")')
00043 
00044     return parser