File: SConstruct

package info (click to toggle)
scons 4.0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 43,888 kB
  • sloc: xml: 196,470; python: 125,048; javascript: 4,671; sh: 1,007; perl: 493; ruby: 229; java: 139; makefile: 127; ansic: 119; f90: 108; yacc: 34; cpp: 30; lex: 10
file content (32 lines) | stat: -rw-r--r-- 989 bytes parent folder | download | duplicates (2)
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
import SCons.Node

CacheDir('cache')

def b(target, source, env):
	with open(target[0].abspath, 'w') as f:
		pass

def scan(node, env, path):
    # Have the node depend on a directory, which depends on an instance of
    # SCons.Node.Python.Value.
    sample_dir = env.fs.Dir('dir2')
    env.Depends(sample_dir, env.Value('c'))
    return [sample_dir, env.Value('d'), env.Value(b'\x03\x0F', name='name3')]

scanner = Scanner(function=scan, node_class=SCons.Node.Node)
builder = Builder(action=b, source_scanner=scanner)

env = Environment()
env.Append(BUILDERS={'B': builder})

# Create a node and a directory that each depend on an instance of
# SCons.Node.Python.Value.
sample_dir = env.fs.Dir('dir1')
env.Depends(sample_dir,
            [env.Value('a'), env.Value(b'\x01\x0F', name='name1')])

sample_file = env.fs.File('testfile')
env.Depends(sample_file,
            [env.Value('b'), env.Value(b'\x02\x0F', name='name2')])

env.B(target='File1.out', source=[sample_dir, sample_file])