# build examples
-defines = ['AUBIO_PREFIX="' + bld.env['AUBIO_PREFIX'] + '"']
-defines += ['PACKAGE="' + bld.env['PACKAGE'] + '"']
-
-extra_source = ['utils.c', 'sndfileio.c', 'jackio.c']
-
-bld.new_task_gen(features = 'cc',
- includes = '../src',
- source = extra_source,
- uselib = ['LASH'],
- defines = defines,
- target = 'utils_io')
-
# loop over all *.c filenames in examples to build them all
for target_name in bld.path.ant_glob('*.c').split():
# ignore utils.c
- if target_name in extra_source: continue
+ if target_name in ['utils.c', 'jackio.c', 'sndfileio.c']: continue
bld.new_task_gen(features = 'cc cprogram',
- add_objects = 'utils_io',
+ add_objects = 'utilsio',
includes = '../src',
- defines = defines,
uselib = ['LASH', 'JACK', 'SNDFILE'],
uselib_local = ['aubio'],
source = target_name,
-bld.new_task_gen(features = 'cc',
- includes = '../../examples ../../src',
- source = ['../../examples/sndfileio.c'],
- uselib = ['JACK'],
- target = 'sndfileio')
-
pyaubio = bld.new_task_gen(name = 'python-aubio',
features = 'cc cshlib pyext',
source = '../../swig/aubio.i',
bld.env['VERSION'] = VERSION
bld.env['LIB_VERSION'] = LIB_VERSION
+ build_extras(bld)
+
# add sub directories
bld.add_subdirs('src examples')
if bld.env['SWIG']:
this_target.uselib_local = ['aubio']
this_target.uselib = ['JACK']
this_target.source += ' examples/jackio.c'
+
+def build_extras(bld):
+ # corner cases to build these ones only once
+ sndfileio = bld.new_task_gen(features = 'cc',
+ includes = 'examples src',
+ source = ['examples/sndfileio.c'],
+ target = 'sndfileio')
+
+ defines = ['AUBIO_PREFIX="' + bld.env['AUBIO_PREFIX'] + '"']
+ defines += ['PACKAGE="' + bld.env['PACKAGE'] + '"']
+
+ utilsio = bld.new_task_gen(features = 'cc',
+ includes = 'examples src',
+ add_objects = 'sndfileio',
+ source = ['examples/utils.c', 'examples/jackio.c'],
+ defines = defines,
+ target = 'utilsio')