summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Nagy <tnagy2pow10@gmail.com>2015-03-04 15:54:42 +0100
committerThomas Nagy <tnagy2pow10@gmail.com>2015-03-04 15:54:42 +0100
commitdac540299ca8cb243a8ed83d04713c161d9fdd2c (patch)
treea4bb20b9f3f476c23bea4d239b0ba11b98436997
parent62e4055070b4bd2215a82976ac13e33247ca228b (diff)
Ensure '--target' works, for example 'waf --target=rtems-bin2c'
-rw-r--r--wscript24
1 files changed, 20 insertions, 4 deletions
diff --git a/wscript b/wscript
index c78948a031..852e8413b0 100644
--- a/wscript
+++ b/wscript
@@ -14,7 +14,7 @@ config["rtems_tool_version"] = "4.11"
from sys import argv
from waflib import Task, Scripting, Configure, Utils
from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext, StepContext, ListContext
-from waflib import Context
+from waflib import Context, Errors
from waflib.Tools import c_preproc
from waflib.Logs import pprint
from rtems_waf.builder import libcpu, libbsp
@@ -69,8 +69,6 @@ def init_handler(ctx):
for v in ["host"] + config["variants"]:
obj = make_context(cmd)
obj.variant = v
- if hasattr(ctx, 'targets'):
- obj.targets = ctx.targets
pprint("YELLOW", "--- %sing %s ---" % (cmd, v))
obj.execute()
@@ -97,6 +95,24 @@ for variant in ["host"] + config["variants"]:
cmd = "%s_%s" % (cmd, v)
variant = variant
+def get_targets(self):
+ # targets in host and bsp variants differ, do not raise an exception
+ to_post = []
+ min_grp = 0
+ for name in self.targets.split(','):
+ try:
+ tg = self.get_tgen_by_name(name)
+ except Errors.WafError:
+ continue
+ m = self.get_group_idx(tg)
+ if m > min_grp:
+ min_grp = m
+ to_post = [tg]
+ elif m == min_grp:
+ to_post.append(tg)
+ return (min_grp, to_post)
+BuildContext.get_targets = get_targets
+
# These will stay local functions to avoid importing the subcommands
# upon every invocation which will happen during regular development.
def cmd_config(ctx):
@@ -206,7 +222,7 @@ def build(ctx):
# Host is only meant for building host utilities.
- if ctx.variant == "host" and ctx.targets is "":
+ if ctx.variant == "host":
ctx.recurse("tools/build")
ctx.recurse("c")