forked from cirosantilli/python-cheat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
51 lines (42 loc) · 1.03 KB
/
wscript
File metadata and controls
51 lines (42 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /usr/bin/env python
# encoding: utf-8
top = '.'
out = 'build'
def a(ctx):
print('a')
def b(ctx):
print('b')
def ctx(ctx):
"""
properties of ctx
"""
print('ctx')
print( 'ctx.path.abspath() ==' + ctx.path.abspath() )
print( 'id(ctx) == %d' % id(ctx) )
def subwaf(ctx):
"""
call another wscript
by default searchs for target named `subwaf`
"""
print('subwaf')
ctx.recurse('d')
def options(ctx):
ctx.add_option(
'--aa',
action='store',
default=False,
help='help'
)
def configure(ctx):
print('configure')
ctx.env.AA = ctx.options.aa
#check if program exists:
#- if not say it
#- if yes, assign it to a variable containing its path
ctx.find_program('touch', var='TOUCH')
#ctx.find_program('idontexist', var='IDONTEXIST')
def build(bld):
print('build')
print(ctx.env.TOUCH)
print(ctx.env.FOO)
bld(rule='${TOUCH} ${TGT}', target='foo.txt')