2011-09-10 11:13:51 +02:00
|
|
|
#! /usr/bin/env python
|
|
|
|
# encoding: utf-8
|
|
|
|
|
2012-05-06 00:08:50 +02:00
|
|
|
import sys
|
|
|
|
|
2011-09-10 11:13:51 +02:00
|
|
|
def configure(conf):
|
|
|
|
conf.load('gcc gas')
|
2012-05-13 16:13:44 +02:00
|
|
|
try:
|
|
|
|
size = sys.maxint
|
|
|
|
except AttributeError:
|
|
|
|
size = sys.maxsize # python 3.2
|
|
|
|
if size < 4**21:
|
2012-05-06 00:08:50 +02:00
|
|
|
conf.fatal('this example is for 64-bit systems only')
|
2011-09-10 11:13:51 +02:00
|
|
|
|
|
|
|
def build(bld):
|
2011-09-10 21:25:03 +02:00
|
|
|
# http://docs.waf.googlecode.com/git/apidocs_16/tools/asm.html
|
2011-09-10 11:13:51 +02:00
|
|
|
bld.program(
|
2012-05-02 09:23:58 +02:00
|
|
|
source = 'main.c test.S',
|
|
|
|
target = 'asmtest',
|
2014-04-30 22:37:36 +02:00
|
|
|
defines = 'foo=12',
|
2012-05-02 09:23:58 +02:00
|
|
|
includes = '.')
|
2011-09-10 11:13:51 +02:00
|
|
|
|
2012-05-06 00:08:50 +02:00
|
|
|
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)
|
|
|
|
|