examples/wscript_build: compile utils.c only once
[aubio.git] / examples / wscript_build
1 # build examples
2
3 defines = ['AUBIO_PREFIX="' + bld.env['AUBIO_PREFIX'] + '"']
4 defines += ['PACKAGE="' + bld.env['PACKAGE'] + '"']
5
6 bld.new_task_gen(features = 'cc',
7     includes = '../src ../ext',
8     source = 'utils.c',
9     uselib = ['LASH'],
10     defines = defines, 
11     target = 'utils')
12
13 # loop over all *.c filenames in examples to build them all
14 for target_name in bld.path.ant_glob('*.c').split():
15   # ignore utils.c
16   if target_name in ['utils.c']: continue 
17   bld.new_task_gen(features = 'cc cprogram', 
18       add_objects = 'utils',
19       includes = '../src ../ext',
20       defines = defines, 
21       uselib = ['LASH'],
22       uselib_local = ['aubio', 'aubioext'],
23       source = target_name,
24       # program name is filename.c without the .c
25       target = target_name.split('.')[0])