2 # Base revision: 64488.
4 # Copyright 2008, 2010 Vladimir Prus
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
8 # Defines main target type 'message', that prints a message when built for the
11 import b2.build.targets as targets
12 import b2.build.property_set as property_set
14 from b2.manager import get_manager
16 class MessageTargetClass(targets.BasicTarget):
18 def __init__(self, name, project, *args):
20 targets.BasicTarget.__init__(self, name, project, [])
24 def construct(self, name, sources, ps):
28 if type(arg) == type([]):
33 return (property_set.empty(), [])
35 def message(name, *args):
37 if type(name) == type([]):
40 t = get_manager().targets()
42 project = get_manager().projects().current()
44 return t.main_target_alternative(MessageTargetClass(*((name, project) + args)))
46 get_manager().projects().add_rule("message", message)