You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
waf_old/docs/book/examples/advbuild_testcase/wscript

37 lines
615 B
Python

#! /usr/bin/env python
"""
Commands may aggregate other commands
Try for example
$ waf configure
$ waf test
"""
def options(ctx):
ctx.load('compiler_c')
def configure(ctx):
ctx.load('compiler_c')
def setup(ctx):
n = ctx.path.make_node('main.c')
n.write('#include "foo.h"\nint main() {return 0;}\n')
global v
m = ctx.path.make_node('foo.h')
m.write('int k = %d;\n' % v)
v += 1
def build(ctx):
ctx.program(source='main.c', target='app')
def test(ctx):
global v
v = 12
from waflib import Options
lst = ['configure', 'setup', 'build', 'setup', 'build']
Options.commands = lst + Options.commands