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):
                features='c cstlib asm',
                source = 'test.S',
                target = 'asmtest')

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

Support for pure asm programs and libraries should also work:

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

def build(bld):
                features='asm asmprogram',
                source = 'test.S',
                target = 'asmtest')
class waflib.Tools.asm.asm_parser(nodepaths=None, defines=None)[source]

Bases: waflib.Tools.c_preproc.c_parser


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
class waflib.Tools.asm.asm(*k, **kw)[source]

Bases: waflib.Task.Task

Compiles asm files by gas/nasm/yasm/…

color = 'BLUE'
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]

Bases: waflib.Tools.ccroot.link_task

Links object files into a c program

ext_out = ['.bin']
inst_to = '${BINDIR}'
orig_run_str = '${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'
class waflib.Tools.asm.asmshlib(*k, **kw)[source]

Bases: waflib.Tools.asm.asmprogram

Links object files into a c shared library

inst_to = '${LIBDIR}'
hcode = b'nocode'
class waflib.Tools.asm.asmstlib(*k, **kw)[source]

Bases: waflib.Tools.ccroot.stlink_task

Links object files into a c static library

hcode = b'\tdef wrap(self):\n\t\ttry:\n\t\t\tos.remove(self.outputs[0].abspath())\n\t\texcept OSError:\n\t\t\tpass\n\t\treturn old(self)\n'

Bases: waflib.Task.Task

Base class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute link_task. See waflib.Tools.ccroot.apply_link().

Inheritance diagram of waflib.Tools.ccroot.stlink_task, waflib.Tools.c.cprogram, waflib.Tools.c.cshlib, waflib.Tools.cxx.cxxstlib, waflib.Tools.cxx.cxxprogram, waflib.Tools.cxx.cxxshlib, waflib.Tools.d.dprogram, waflib.Tools.d.dshlib, waflib.Tools.d.dstlib, waflib.Tools.ccroot.fake_shlib, waflib.Tools.ccroot.fake_stlib, waflib.Tools.asm.asmprogram, waflib.Tools.asm.asmshlib, waflib.Tools.asm.asmstlib

Try to process link tasks as early as possible

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

Default installation mode for the link task outputs

Process the target attribute to add the platform-specific prefix/suffix such as .so or .exe. The settings are retrieved from env.clsname_PATTERN

Wrapper for waflib.Context.Context.exec_command(). This version set the current working directory (build.variant_dir), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary @argfile.

Parameters:cmd (list of string (best) or string (process will use a shell)) – process command to execute
Returns:the return code
Return type:int

Optional parameters:

  1. cwd: current working directory (Node or string)
  2. stdout: set to None to prevent waf from capturing the process standard output
  3. stderr: set to None to prevent waf from capturing the process standard error
  4. timeout: timeout value (Python 3)

Create manifest files for VS-like compilers (msvc, ifort, …)

Bases: waflib.Tools.ccroot.link_task

Base for static link tasks, which use ar most of the time. The target is always removed before being written.

Default installation mode for the static libraries


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}'
def create_maa_file(self, node):
        self.create_task('mytask', node, node.change_ext('.maa'))
def build(bld):