From 43f4e42681c4bc170cf36f38e61e1b7f03be1c43 Mon Sep 17 00:00:00 2001 From: pbrier Date: Thu, 17 Oct 2013 23:22:26 +0200 Subject: [PATCH 1/3] Added command line source/build directory option --- workspace_tools/make.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/workspace_tools/make.py b/workspace_tools/make.py index 2abca9a22b3..30ad2fed36f 100644 --- a/workspace_tools/make.py +++ b/workspace_tools/make.py @@ -50,6 +50,10 @@ default=False, help="Verbose diagnostic output") # Local run + parser.add_option("--source", dest="input_dir", + default=None, help="The source input directory") + parser.add_option("--build", dest="output_dir", + default=None, help="The binary output directory") parser.add_option("-d", "--disk", dest="disk", default=None, help="The mbed disk") parser.add_option("-s", "--serial", dest="serial", @@ -108,6 +112,10 @@ test.dependencies.append(RTOS_LIBRARIES) build_dir = join(BUILD_DIR, "test", mcu, toolchain, test.id) + if options.input_dir is not None: + test.source_dir = options.input_dir + if options.output_dir is not None: + build_dir = options.output_dir target = TARGET_MAP[mcu] try: From d0306ca254ff2d96185b1ab4b75f61e86f1793df Mon Sep 17 00:00:00 2001 From: pbrier Date: Sun, 20 Oct 2013 17:17:10 +0200 Subject: [PATCH 2/3] Added additional command line options for the build --- workspace_tools/make.py | 55 +++++++++++++++++++++++++++++-------- workspace_tools/settings.py | 2 +- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/workspace_tools/make.py b/workspace_tools/make.py index 30ad2fed36f..030c345ebed 100644 --- a/workspace_tools/make.py +++ b/workspace_tools/make.py @@ -42,7 +42,7 @@ if __name__ == '__main__': # Parse Options parser = get_default_options_parser() - parser.add_option("-p", type="int", dest="program", + parser.add_option("-p", type="int", dest="program", default=-1, help="The index of the desired test program: [0-%d]" % (len(TESTS)-1)) parser.add_option("-n", dest="program_name", help="The name of the desired test program") @@ -50,10 +50,22 @@ default=False, help="Verbose diagnostic output") # Local run - parser.add_option("--source", dest="input_dir", - default=None, help="The source input directory") - parser.add_option("--build", dest="output_dir", - default=None, help="The binary output directory") + parser.add_option("--automated", action="store_true", dest="automated", + default=False, help="Automated test") + parser.add_option("--host", dest="host_test", + default=None, help="Host test") + parser.add_option("--extra", dest="extra", + default=None, help="Extra files") + parser.add_option("--peripherals", dest="peripherals", + default=None, help="Required peripherals") + parser.add_option("--dep", dest="dependencies", + default=None, help="Dependencies") + parser.add_option("--source", dest="source_dir", + default=None, help="The source (input) directory") + parser.add_option("--duration", type="int", dest="duration", + default=None, help="Duration of the test") + parser.add_option("--build", dest="build_dir", + default=None, help="The build (output) directory") parser.add_option("-d", "--disk", dest="disk", default=None, help="The mbed disk") parser.add_option("-s", "--serial", dest="serial", @@ -71,9 +83,15 @@ default=None, help="use the specified linker script") (options, args) = parser.parse_args() - + + # force program to "0" if a source dir is specified + if options.source_dir is not None: + p = 0 + n = None + else: # Program Number or name - p, n = options.program, options.program_name + p, n = options.program, options.program_name + if n is not None and p is not None: args_error(parser, "[ERROR] specify either '-n' or '-p', not both") if n: @@ -103,6 +121,19 @@ # Test test = Test(p) + if options.automated is not None: + test.automated = options.automated + if options.dependencies is not None: + test.dependencies = options.dependencies + if options.host_test is not None: + test.host_test = options.host_test; + if options.peripherals is not None: + test.peripherals = options.peripherals; + if options.duration is not None: + test.duration = options.duration; + if options.extra is not None: + test.extra_files = options.extra + if not test.is_supported(mcu, toolchain): print 'The selected test is not supported on target %s with toolchain %s' % (mcu, toolchain) sys.exit() @@ -112,10 +143,12 @@ test.dependencies.append(RTOS_LIBRARIES) build_dir = join(BUILD_DIR, "test", mcu, toolchain, test.id) - if options.input_dir is not None: - test.source_dir = options.input_dir - if options.output_dir is not None: - build_dir = options.output_dir + if options.source_dir is not None: + test.source_dir = options.source_dir + build_dir = options.source_dir + + if options.build_dir is not None: + build_dir = options.build_dir target = TARGET_MAP[mcu] try: diff --git a/workspace_tools/settings.py b/workspace_tools/settings.py index 9b6d3e9ce8a..5158ace2e8b 100644 --- a/workspace_tools/settings.py +++ b/workspace_tools/settings.py @@ -53,7 +53,7 @@ MY_ARM_CLIB = join(ARM_PATH, "lib", "microlib") # GCC ARM -GCC_ARM_PATH = "C:/arm-none-eabi-gcc-4_7/bin" +GCC_ARM_PATH = "/opt/gcc4mbed/gcc-arm-none-eabi/bin" # GCC CodeSourcery GCC_CS_PATH = "C:/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin" From 8fd42e5edae7bd7b2b948f0cbbc56b8f653e01fc Mon Sep 17 00:00:00 2001 From: pbrier Date: Sun, 20 Oct 2013 17:25:58 +0200 Subject: [PATCH 3/3] reset to original settings --- workspace_tools/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace_tools/settings.py b/workspace_tools/settings.py index 5158ace2e8b..9b6d3e9ce8a 100644 --- a/workspace_tools/settings.py +++ b/workspace_tools/settings.py @@ -53,7 +53,7 @@ MY_ARM_CLIB = join(ARM_PATH, "lib", "microlib") # GCC ARM -GCC_ARM_PATH = "/opt/gcc4mbed/gcc-arm-none-eabi/bin" +GCC_ARM_PATH = "C:/arm-none-eabi-gcc-4_7/bin" # GCC CodeSourcery GCC_CS_PATH = "C:/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"