asm

Assembly support, used by tools such as gas and nasm

To declare targets using assembly:

def configure(conf):
        conf.load('gcc gas')

def build(bld):
        bld(
                features='c cstlib asm',
                source = 'test.S',
                target = 'asmtest')

        bld(
                features='asm asmprogram',
                source = 'test.S',
                target = 'asmtest')

Support for pure asm programs and libraries should also work:

def configure(conf):
        conf.load('nasm')
        conf.find_program('ld', 'ASLINK')

def build(bld):
        bld(
                features='asm asmprogram',
                source = 'test.S',
                target = 'asmtest')
waflib.Tools.asm.extension(*k)

Decorator that registers a task generator method which will be invoked during the processing of source files for the extension given:

from waflib import Task
class mytask(Task):
        run_str = 'cp ${SRC} ${TGT}'
@extension('.moo')
def create_maa_file(self, node):
        self.create_task('mytask', node, node.change_ext('.maa'))
def build(bld):
        bld(source='foo.moo')
class waflib.Tools.asm.asm_parser(nodepaths=None, defines=None)[source]
filter_comments(node)[source]

Filter the comments from a c/h file, and return the preprocessor lines. The regexps waflib.Tools.c_preproc.re_cpp, waflib.Tools.c_preproc.re_nl and waflib.Tools.c_preproc.re_lines are used internally.

Returns:

the preprocessor directives as a list of (keyword, line)

Return type:

a list of string pairs

__firstlineno__ = 47
__static_attributes__ = ()
class waflib.Tools.asm.asm(*k, **kw)[source]

Compiles asm files by gas/nasm/yasm/…

color = 'BLUE'

Color for the console display, see waflib.Logs.colors_lst

run_str = None
scan()[source]

The type of the None singleton.

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

__dict__ = mappingproxy({'__module__': 'waflib.Tools.asm', '__firstlineno__': 54, '__doc__': '\nCompiles asm files by gas/nasm/yasm/...\n', 'color': 'BLUE', 'run_str': None, 'scan': <function asm.scan>, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'asm' objects>, '__weakref__': <attribute '__weakref__' of 'asm' objects>, 'hcode': b'${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${ASMDEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}', 'orig_run_str': '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${ASMDEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}', 'run': <function f>, 'vars': ['AS', 'ASFLAGS', 'ASMDEFINES_ST', 'ASMPATH_ST', 'AS_SRC_F', 'AS_TGT_F', 'DEFINES', 'INCPATHS'], '__annotations__': {}})
__firstlineno__ = 54
__static_attributes__ = ()
hcode = b'${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${ASMDEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'

String representing an additional hash for the class representation

orig_run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${ASMDEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
vars = ['AS', 'ASFLAGS', 'ASMDEFINES_ST', 'ASMPATH_ST', 'AS_SRC_F', 'AS_TGT_F', 'DEFINES', 'INCPATHS']

ConfigSet variables that should trigger a rebuild (class attribute used for waflib.Task.Task.sig_vars())

waflib.Tools.asm.asm_hook(self, node)[source]

Binds the asm extension to the asm task

Parameters:

node (waflib.Node.Node) – input file

class waflib.Tools.asm.asmprogram(*k, **kw)[source]

Links object files into a c program

run_str = None
ext_out = ['.bin']

File extensions that objects of this task class may create

inst_to = '${BINDIR}'

Default installation path for the link task outputs, or None to disable

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

__firstlineno__ = 91
__static_attributes__ = ()
hcode = b'${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'

String representing an additional hash for the class representation

orig_run_str = '${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'
vars = ['ASLINK', 'ASLINKFLAGS', 'ASLNK_SRC_F', 'ASLNK_TGT_F']

ConfigSet variables that should trigger a rebuild (class attribute used for waflib.Task.Task.sig_vars())

class waflib.Tools.asm.asmshlib(*k, **kw)[source]

Links object files into a c shared library

inst_to = '${LIBDIR}'

Default installation path for the link task outputs, or None to disable

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

__firstlineno__ = 97
__static_attributes__ = ()
hcode = b'nocode'

String representing an additional hash for the class representation

class waflib.Tools.asm.asmstlib(*k, **kw)[source]

Links object files into a c static library

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

__firstlineno__ = 101
__static_attributes__ = ()
hcode = b'\t\tdef composed_fun(task):\n\t\t\tfor x in funs_lst:\n\t\t\t\tret = x(task)\n\t\t\t\tif ret:\n\t\t\t\t\treturn ret\n\t\t\treturn None\n'

String representing an additional hash for the class representation