2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00
This commit is contained in:
Thomas Nagy 2012-07-28 10:50:13 +02:00
parent 1946acc1d8
commit 2d4f81b071
2 changed files with 42 additions and 0 deletions

9
playground/nasm/test.s Normal file
View File

@ -0,0 +1,9 @@
section .text
global _start
_start:
int 80h ; Call the kernel
mov eax,1 ; The system call for exit (sys_exit)
mov ebx,0 ; Exit with return code of 0 (no error)
int 80h

33
playground/nasm/wscript Normal file
View File

@ -0,0 +1,33 @@
#! /usr/bin/env python
# encoding: utf-8
import sys
def configure(conf):
conf.load('nasm')
try:
size = sys.maxint
except AttributeError:
size = sys.maxsize # python 3.2
if size < 4**21:
conf.fatal('this example is for 64-bit systems only')
conf.find_program('ld', var='ASLINK')
conf.env.ASLINKFLAGS = ['-s']
conf.env.CPPPATH_ST = '-I%s'
conf.env.ASFLAGS = ['-f', 'elf64']
def build(bld):
bld(
features = 'asm asmprogram',
source = 'test.s',
target = 'asmtest',
asflags = ['-f', 'elf64'],
includes = '.')
def disp(ctx):
node = ctx.bldnode.ant_glob('asmtest*', remove=False)[0]
ctx.exec_command('%s' % node.abspath(), shell=False)
bld.add_post_fun(disp)