From 4ef2f41eb7a6b0fd84791eafff9062da1a9d94c4 Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Fri, 6 Apr 2018 08:54:34 +0200 Subject: Add bsp_init hook. --- rtems.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rtems.py b/rtems.py index be44edc..713066d 100644 --- a/rtems.py +++ b/rtems.py @@ -69,7 +69,7 @@ def options(opt): dest = 'show_commands', help = 'Print the commands as strings.') -def init(ctx, filters = None, version = None, long_commands = False): +def init(ctx, filters = None, version = None, long_commands = False, bsp_init = None): global rtems_filters global rtems_default_version global rtems_long_commands @@ -112,16 +112,18 @@ def init(ctx, filters = None, version = None, long_commands = False): env.options['rtems_bsps']) # - # Update the contextes for all the bsps. + # Update the contexts for all the bsps. # from waflib.Build import BuildContext, CleanContext, \ InstallContext, UninstallContext + contexts = [] for x in arch_bsps: for y in (BuildContext, CleanContext, InstallContext, UninstallContext): name = y.__name__.replace('Context','').lower() class context(y): cmd = name + '-' + x variant = x + contexts += [context] # # Transform the command to per BSP commands. @@ -137,6 +139,9 @@ def init(ctx, filters = None, version = None, long_commands = False): except: pass + if bsp_init: + bsp_init(ctx, env, contexts) + def configure(conf, bsp_configure = None): # # Check the environment for any flags. -- cgit v1.2.3