Skip to content

Commit d0306ca

Browse files
committed
Added additional command line options for the build
1 parent 43f4e42 commit d0306ca

File tree

2 files changed

+45
-12
lines changed

2 files changed

+45
-12
lines changed

workspace_tools/make.py

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,30 @@
4242
if __name__ == '__main__':
4343
# Parse Options
4444
parser = get_default_options_parser()
45-
parser.add_option("-p", type="int", dest="program",
45+
parser.add_option("-p", type="int", dest="program", default=-1,
4646
help="The index of the desired test program: [0-%d]" % (len(TESTS)-1))
4747
parser.add_option("-n", dest="program_name",
4848
help="The name of the desired test program")
4949
parser.add_option("-v", "--verbose", action="store_true", dest="verbose",
5050
default=False, help="Verbose diagnostic output")
5151

5252
# Local run
53-
parser.add_option("--source", dest="input_dir",
54-
default=None, help="The source input directory")
55-
parser.add_option("--build", dest="output_dir",
56-
default=None, help="The binary output directory")
53+
parser.add_option("--automated", action="store_true", dest="automated",
54+
default=False, help="Automated test")
55+
parser.add_option("--host", dest="host_test",
56+
default=None, help="Host test")
57+
parser.add_option("--extra", dest="extra",
58+
default=None, help="Extra files")
59+
parser.add_option("--peripherals", dest="peripherals",
60+
default=None, help="Required peripherals")
61+
parser.add_option("--dep", dest="dependencies",
62+
default=None, help="Dependencies")
63+
parser.add_option("--source", dest="source_dir",
64+
default=None, help="The source (input) directory")
65+
parser.add_option("--duration", type="int", dest="duration",
66+
default=None, help="Duration of the test")
67+
parser.add_option("--build", dest="build_dir",
68+
default=None, help="The build (output) directory")
5769
parser.add_option("-d", "--disk", dest="disk",
5870
default=None, help="The mbed disk")
5971
parser.add_option("-s", "--serial", dest="serial",
@@ -71,9 +83,15 @@
7183
default=None, help="use the specified linker script")
7284

7385
(options, args) = parser.parse_args()
74-
86+
87+
# force program to "0" if a source dir is specified
88+
if options.source_dir is not None:
89+
p = 0
90+
n = None
91+
else:
7592
# Program Number or name
76-
p, n = options.program, options.program_name
93+
p, n = options.program, options.program_name
94+
7795
if n is not None and p is not None:
7896
args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
7997
if n:
@@ -103,6 +121,19 @@
103121

104122
# Test
105123
test = Test(p)
124+
if options.automated is not None:
125+
test.automated = options.automated
126+
if options.dependencies is not None:
127+
test.dependencies = options.dependencies
128+
if options.host_test is not None:
129+
test.host_test = options.host_test;
130+
if options.peripherals is not None:
131+
test.peripherals = options.peripherals;
132+
if options.duration is not None:
133+
test.duration = options.duration;
134+
if options.extra is not None:
135+
test.extra_files = options.extra
136+
106137
if not test.is_supported(mcu, toolchain):
107138
print 'The selected test is not supported on target %s with toolchain %s' % (mcu, toolchain)
108139
sys.exit()
@@ -112,10 +143,12 @@
112143
test.dependencies.append(RTOS_LIBRARIES)
113144

114145
build_dir = join(BUILD_DIR, "test", mcu, toolchain, test.id)
115-
if options.input_dir is not None:
116-
test.source_dir = options.input_dir
117-
if options.output_dir is not None:
118-
build_dir = options.output_dir
146+
if options.source_dir is not None:
147+
test.source_dir = options.source_dir
148+
build_dir = options.source_dir
149+
150+
if options.build_dir is not None:
151+
build_dir = options.build_dir
119152

120153
target = TARGET_MAP[mcu]
121154
try:

workspace_tools/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
MY_ARM_CLIB = join(ARM_PATH, "lib", "microlib")
5454

5555
# GCC ARM
56-
GCC_ARM_PATH = "C:/arm-none-eabi-gcc-4_7/bin"
56+
GCC_ARM_PATH = "/opt/gcc4mbed/gcc-arm-none-eabi/bin"
5757

5858
# GCC CodeSourcery
5959
GCC_CS_PATH = "C:/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"

0 commit comments

Comments
 (0)