3 # Thomas Nagy, 2008-2018 (ita)
6 Assembly support, used by tools such as gas and nasm
8 To declare targets using assembly::
15 features='c cstlib asm',
20 features='asm asmprogram',
24 Support for pure asm programs and libraries should also work::
28 conf.find_program('ld', 'ASLINK')
32 features='asm asmprogram',
37 from waflib import Task
38 from waflib.Tools.ccroot import link_task, stlink_task
39 from waflib.TaskGen import extension
43 Compiles asm files by gas/nasm/yasm/...
46 run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
48 @extension('.s', '.S', '.asm', '.ASM', '.spp', '.SPP')
49 def asm_hook(self, node):
51 Binds the asm extension to the asm task
53 :param node: input file
54 :type node: :py:class:`waflib.Node.Node`
56 return self.create_compiled_task('asm', node)
58 class asmprogram(link_task):
59 "Links object files into a c program"
60 run_str = '${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'
64 class asmshlib(asmprogram):
65 "Links object files into a c shared library"
68 class asmstlib(stlink_task):
69 "Links object files into a c static library"
73 conf.env.ASMPATH_ST = '-I%s'