diff options
author | Thomas Nagy <tnagy2pow10@gmail.com> | 2015-03-04 15:54:42 +0100 |
---|---|---|
committer | Amar Takhar <amar@rtems.org> | 2015-12-11 15:15:57 -0500 |
commit | 7f97ad04c7b3da8d39786adf0a90726a69b374fe (patch) | |
tree | 321bc28e85268b1bc03798af992168bf50da1872 | |
parent | 6d65fedce06823114b290009b6d2c330041a58bc (diff) |
Ensure '--target' works, for example 'waf --target=rtems-bin2c'
-rw-r--r-- | wscript | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -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") |