Beispiel #1
0
def Sources(*value):
    ctx = bcontext.get_context()
    (names, args) = _parse_name_and_args(*value)
    tag = syntax_tag.TagSources()
    for name in names:
        src = ctx.create_source(name, args)
        tag.add_sv(src)
    return tag
Beispiel #2
0
def handle(mkwr):
    ctx = bcontext.get_context(); 
    ctx.clear()
    targetstring = interpret_configs()
    interpret_targets(targetstring)
    ctx.action_depends() 
    ctx.action()
    mkwr.collect(ctx)
    mkwr.write()
Beispiel #3
0
def _include_paths(tag, value):
    for s in value:
        ps = string.split(s)
        for x in ps:
            if (x[0] == '$'):
                ctx = bcontext.get_context()
                x = '%s%s' % (ctx.workroot(), x[1:])
                x = os.path.normpath(x)
            tag.add_sv(x)
    return tag
Beispiel #4
0
def DEP_CONFIGS(v1, v2, v3):
    ctx = bcontext.get_context()
    group_name = v1
    project_name = v2
    if (ctx.default_git_domain().strip()):
        if (not ctx.default_git_domain().endswith('/')):
            repository = ctx.default_git_domain() + '/' + v3
        else:
            repository = ctx.default_git_domain() + v3
    else:
        repository = v3
    ctx.git().exec_cmd(group_name, project_name, repository)
Beispiel #5
0
def LDFLAGS(*value):
    ctx = bcontext.get_context()
    ctx.link_flags().add_vs(value)
Beispiel #6
0
def LIBS(*value):
    ctx = bcontext.get_context()
    ctx.libraries().add_vs(value)
Beispiel #7
0
def INCPATHS(*value):
    ctx = bcontext.get_context()
    _include_paths(ctx.include_paths(), value)
Beispiel #8
0
def CXXFLAGS(*value):
    ctx = bcontext.get_context()
    ctx.cxx_flags().add_vs(value)
Beispiel #9
0
def USER_SOURCES_EXTRA(*value):
    ctx = bcontext.get_context()
    ctx.user_sources_extra().add_vs(value)
Beispiel #10
0
def BUILDMAKE_BIN_PATH(value):
    ctx = bcontext.get_context()
    ctx.set_buildmake_bin_path(value)
Beispiel #11
0
def WORKROOT(value):
    ctx = bcontext.get_context()
    ctx.set_workroot(value)
Beispiel #12
0
def interpret_configs():
    ctx = bcontext.get_context()
    targetstring = ctx.interpret_configs_from_buildmake('BUILDMAKE')
    return targetstring
Beispiel #13
0
    for (k, v) in opts:
        if k in ('-h', '--help'):
            usage();
            sys.exit(0)
        elif k in ('-G', '--generate'):
            generator.generate()
            sys.exit(0)
        elif k in ('-v', '--version'):
            print 'buildmake version: ' + (VERSION)
            sys.exit(0)
        elif k in ('-U', '--update'):
            UPDATE_ENV = True
        elif k in ('-B', '--build'):
            BUILD_ENV = True
        
        ctx = bcontext.get_context()
        if (UPDATE_ENV and BUILD_ENV):
            ctx.git().set_cmd(bgit.Cmd.UPDATE_AND_BUILD)
        elif (UPDATE_ENV):
            ctx.git().set_cmd(bgit.Cmd.UPDATE)
        elif (BUILD_ENV):
            ctx.git().set_cmd(bgit.Cmd.BUILD)

def interpret_configs():
    ctx = bcontext.get_context()
    targetstring = ctx.interpret_configs_from_buildmake('BUILDMAKE')
    return targetstring

def interpret_targets(targetstring):
    # In case targetstring contains '\r\n'
    targetstring = '\n'.join(targetstring.splitlines()) + '\n'
Beispiel #14
0
def DEFAULT_LIB_INCLUDE_DIR(value):
    ctx = bcontext.get_context()
    ctx.set_default_lib_include_dir(value)
Beispiel #15
0
def COPY_USING_HARD_LINK(value):
    ctx = bcontext.get_context()
    ctx.set_copy_using_hard_link(value)
Beispiel #16
0
def DEFAULT_GIT_DOMAIN(value):
    ctx = bcontext.get_context()
    ctx.set_default_git_domain(value)
Beispiel #17
0
def CPPFLAGS(*value):
    ctx = bcontext.get_context()
    ctx.cpp_flags().add_vs(value)
Beispiel #18
0
def _target(name, type, args):
    ctx = bcontext.get_context()
    ctx.create_target(name, type, args)
Beispiel #19
0
def FLAGS_EXTRA(*value):
    ctx = bcontext.get_context()
    ctx.flags_extra().add_vs(value)