thirdparty:waf: New files for waf 1.9.10
[Samba.git] / third_party / waf / waflib / Tools / asm.py
blobf14a725fb120d5de7338fa606be911a3e7c5aba2
1 #! /usr/bin/env python
2 # encoding: utf-8
3 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
5 #!/usr/bin/env python
6 # encoding: utf-8
7 # Thomas Nagy, 2008-2016 (ita)
9 """
10 Assembly support, used by tools such as gas and nasm
12 To declare targets using assembly::
14 def configure(conf):
15 conf.load('gcc gas')
17 def build(bld):
18 bld(
19 features='c cstlib asm',
20 source = 'test.S',
21 target = 'asmtest')
23 bld(
24 features='asm asmprogram',
25 source = 'test.S',
26 target = 'asmtest')
28 Support for pure asm programs and libraries should also work::
30 def configure(conf):
31 conf.load('nasm')
32 conf.find_program('ld', 'ASLINK')
34 def build(bld):
35 bld(
36 features='asm asmprogram',
37 source = 'test.S',
38 target = 'asmtest')
39 """
41 from waflib import Task
42 from waflib.Tools.ccroot import link_task, stlink_task
43 from waflib.TaskGen import extension
45 class asm(Task.Task):
46 """
47 Compiles asm files by gas/nasm/yasm/...
48 """
49 color = 'BLUE'
50 run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
52 @extension('.s', '.S', '.asm', '.ASM', '.spp', '.SPP')
53 def asm_hook(self, node):
54 """
55 Binds the asm extension to the asm task
57 :param node: input file
58 :type node: :py:class:`waflib.Node.Node`
59 """
60 return self.create_compiled_task('asm', node)
62 class asmprogram(link_task):
63 "Links object files into a c program"
64 run_str = '${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'
65 ext_out = ['.bin']
66 inst_to = '${BINDIR}'
68 class asmshlib(asmprogram):
69 "Links object files into a c shared library"
70 inst_to = '${LIBDIR}'
72 class asmstlib(stlink_task):
73 "Links object files into a c static library"
74 pass # do not remove
76 def configure(conf):
77 conf.env.ASMPATH_ST = '-I%s'