scripts: add west build, flash, and debug commands

West now supports a mechanism for extension commands. Use it to move
the command implementations that are tightly coupled with boards and
the zephyr build system back into the Zephyr repository.

This patch doesn't include test cases. Those will be moved over in a
subsequent patch.

Signed-off-by: Marti Bolivar <marti@foundries.io>
diff --git a/scripts/west_commands/runners/qemu.py b/scripts/west_commands/runners/qemu.py
new file mode 100644
index 0000000..ea39be8
--- /dev/null
+++ b/scripts/west_commands/runners/qemu.py
@@ -0,0 +1,34 @@
+# Copyright (c) 2017 Linaro Limited.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+'''Runner stub for QEMU.'''
+
+from runners.core import ZephyrBinaryRunner, RunnerCaps
+
+
+class QemuBinaryRunner(ZephyrBinaryRunner):
+    '''Place-holder for QEMU runner customizations.'''
+
+    def __init__(self, cfg):
+        super(QemuBinaryRunner, self).__init__(cfg)
+
+    @classmethod
+    def name(cls):
+        return 'qemu'
+
+    @classmethod
+    def capabilities(cls):
+        # This is a stub.
+        return RunnerCaps(commands=set())
+
+    @classmethod
+    def do_add_parser(cls, parser):
+        pass                    # Nothing to do.
+
+    @classmethod
+    def create(cls, cfg, args):
+        return QemuBinaryRunner(cfg)
+
+    def do_run(self, command, **kwargs):
+        pass