How to use the mk.setVar function in mk

To help you get started, we’ve selected a few mk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vslavik / bakefile / src / reader.py View on Github external
def setStdVars(filename):
    mk.setVar('LF', '\n')
    mk.setVar('TAB', '\t')
    mk.setVar('SPACE', '$(" ")', eval=0)
    mk.setVar('DOLLAR', '$')
    
    mk.setVar('INPUT_FILE', os.path.abspath(filename))
    mk.setVar('INPUT_FILE_ARG', filename)
    mk.setVar('OUTPUT_FILE', config.output_file)
    mk.setVar('FORMAT', config.format)
github vslavik / bakefile / src / reader.py View on Github external
def loadModule(m):
    if m in loadedModules:
        return
    if config.verbose: print "loading module '%s'..." % m
    loadedModules.append(m)

    # set USING_ variable:
    mk.setVar('USING_%s' % m.upper(), '1')

    # import module's py utilities:
    imported = mk.importPyModule(m)

    # include module-specific makefiles:
    global availableFiles
    for f in availableFiles:
        if m in f.modules:
            f.modules.remove(m)
            if len(f.modules) == 0:
                processFile(f.file)
                imported = True
    availableFiles = [f for f in availableFiles if len(f.modules)>0]

    if not imported:
        raise ReaderError(None, "unknown module '%s'" % m)
github vslavik / bakefile / src / reader.py View on Github external
def setStdVars(filename):
    mk.setVar('LF', '\n')
    mk.setVar('TAB', '\t')
    mk.setVar('SPACE', '$(" ")', eval=0)
    mk.setVar('DOLLAR', '$')
    
    mk.setVar('INPUT_FILE', os.path.abspath(filename))
    mk.setVar('INPUT_FILE_ARG', filename)
    mk.setVar('OUTPUT_FILE', config.output_file)
    mk.setVar('FORMAT', config.format)
github vslavik / bakefile / src / utils.py View on Github external
def createMakeVar(target, var, makevar, hints=''):
    """Creates make variable called 'makevar' with same value as 'var' and
       returns reference to it in the form of $(makevar)."""
    tg = mk.targets[target]
    mk.setVar('%s_%s' % (safeMakefileValue(target.upper()), makevar),
              "$(ref('%s','%s'))" % (var, target),
              target=tg, makevar=1, hints=hints)
    return '$(%s_%s)' % (safeMakefileValue(target.upper()), makevar)
github vslavik / bakefile / src / reader.py View on Github external
def setStdVars(filename):
    mk.setVar('LF', '\n')
    mk.setVar('TAB', '\t')
    mk.setVar('SPACE', '$(" ")', eval=0)
    mk.setVar('DOLLAR', '$')
    
    mk.setVar('INPUT_FILE', os.path.abspath(filename))
    mk.setVar('INPUT_FILE_ARG', filename)
    mk.setVar('OUTPUT_FILE', config.output_file)
    mk.setVar('FORMAT', config.format)
github vslavik / bakefile / src / reader.py View on Github external
def setStdVars(filename):
    mk.setVar('LF', '\n')
    mk.setVar('TAB', '\t')
    mk.setVar('SPACE', '$(" ")', eval=0)
    mk.setVar('DOLLAR', '$')
    
    mk.setVar('INPUT_FILE', os.path.abspath(filename))
    mk.setVar('INPUT_FILE_ARG', filename)
    mk.setVar('OUTPUT_FILE', config.output_file)
    mk.setVar('FORMAT', config.format)
github vslavik / bakefile / src / finalize.py View on Github external
else:
            val = cv.values[0].value
            if val != '': continue
            purge = 1
            for v in cv.values[1:]:
                if v.value != val:
                    purge = 0
                    break
            if purge: toDel.append((c,val))
    
    if config.verbose:
        sys.stdout.write(': %i of %i\n' % (len(toDel), len(mk.cond_vars)))    
    for c, val in toDel:
        t = mk.cond_vars[c].target
        del mk.cond_vars[c]
        mk.setVar(c, val, target=t)
    return len(toDel) > 0
github vslavik / bakefile / src / reader.py View on Github external
def setStdVars(filename):
    mk.setVar('LF', '\n')
    mk.setVar('TAB', '\t')
    mk.setVar('SPACE', '$(" ")', eval=0)
    mk.setVar('DOLLAR', '$')
    
    mk.setVar('INPUT_FILE', os.path.abspath(filename))
    mk.setVar('INPUT_FILE_ARG', filename)
    mk.setVar('OUTPUT_FILE', config.output_file)
    mk.setVar('FORMAT', config.format)