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')
-
class
waflib.Tools.asm.
asm
(*k, **kw)[source]¶ Bases:
waflib.Task.Task
Compile asm files by gas/nasm/yasm/...
-
color
= 'BLUE'¶
-
__doc__
= '\n\tCompile asm files by gas/nasm/yasm/...\n\t'¶
-
__module__
= 'waflib.Tools.asm'¶
-
hcode
= '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'¶
-
orig_run_str
= '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'¶
-
vars
= ['AS', 'ASFLAGS', 'ASMPATH_ST', 'AS_SRC_F', 'AS_TGT_F', 'DEFINES', 'DEFINES_ST', 'INCPATHS']¶
-
-
waflib.Tools.asm.
asm_hook
(self, node)[source]¶ Bind 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
Link object files into a c program
-
ext_out
= ['.bin']¶
-
inst_to
= '${BINDIR}'¶
-
__doc__
= 'Link object files into a c program'¶
-
__module__
= 'waflib.Tools.asm'¶
-
hcode
= '${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'¶
-
orig_run_str
= '${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'¶
-
vars
= ['ASLINK', 'ASLINKFLAGS', 'ASLNK_SRC_F', 'ASLNK_TGT_F']¶
-
-
class
waflib.Tools.asm.
asmshlib
(*k, **kw)[source]¶ Bases:
waflib.Tools.asm.asmprogram
Link object files into a c shared library
-
inst_to
= '${LIBDIR}'¶
-
__doc__
= 'Link object files into a c shared library'¶
-
__module__
= 'waflib.Tools.asm'¶
-
hcode
= 'nocode'¶
-
-
class
waflib.Tools.asm.
asmstlib
(*k, **kw)[source]¶ Bases:
waflib.Tools.ccroot.stlink_task
Link object files into a c static library
-
__doc__
= 'Link object files into a c static library'¶
-
__module__
= 'waflib.Tools.asm'¶
-
hcode
= '\tdef wrap(self):\n\t\ttry: os.remove(self.outputs[0].abspath())\n\t\texcept OSError: pass\n\t\treturn old(self)\n'¶
-
-
class
waflib.Tools.asm.
link_task
(*k, **kw)[source]¶ 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()
.-
__doc__
= '\n\tBase class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute *link_task*. See :py:func:`waflib.Tools.ccroot.apply_link`.\n\n\t.. inheritance-diagram:: 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\n\t'¶
-
__module__
= 'waflib.Tools.ccroot'¶
-
add_target
(target)[source]¶ Process the target attribute to add the platform-specific prefix/suffix such as .so or .exe. The settings are retrieved from
env.clsname_PATTERN
-
chmod
= 493¶
-
color
= 'YELLOW'¶
-
hcode
= '\tdef run(self):\n\t\t"""\n\t\tCalled by threads to execute the tasks. The default is empty and meant to be overridden in subclasses.\n\t\tIt is a bad idea to create nodes in this method (so, no node.ant_glob)\n\n\t\t:rtype: int\n\t\t"""\n\t\tif hasattr(self, \'fun\'):\n\t\t\treturn self.fun(self)\n\t\treturn 0\n'¶
-
-
waflib.Tools.asm.
extension
(*k)¶ Decorator: register 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.
stlink_task
(*k, **kw)[source]¶ 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.
-
__doc__
= '\n\tBase for static link tasks, which use *ar* most of the time.\n\tThe target is always removed before being written.\n\t'¶
-
__module__
= 'waflib.Tools.ccroot'¶
-
chmod
= 420¶
-
hcode
= '${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}'¶
-
orig_run_str
= '${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}'¶
-
vars
= ['AR', 'ARFLAGS', 'AR_SRC_F', 'AR_TGT_F']¶
-