# vim:set syntax=python:
# build examples
-utilsio = ctx.new_task_gen(name = 'utilsio', features = 'c',
- includes = '../src',
- source = ['utils.c', 'jackio.c'],
- uselib = ['LASH', 'JACK'],
- target = 'utilsio')
+utilsio = bld(
+ name = 'utilsio',
+ features = 'c',
+ includes = '../src',
+ source = ['utils.c', 'jackio.c'],
+ uselib = ['LASH', 'JACK'],
+ target = 'utilsio')
# loop over all *.c filenames in examples to build them all
-for target_name in ctx.path.ant_glob('*.c', excl = ['utils.c', 'jackio.c']):
- ctx.new_task_gen(features = 'c cprogram',
- add_objects = 'utilsio',
+for source_file in ctx.path.ant_glob('*.c', excl = ['utils.c', 'jackio.c']):
+ bld.program(features = 'c cprogram',
includes = '../src',
- uselib = ['LASH', 'JACK', 'SNDFILE'],
- use = 'aubio',
- source = target_name,
- # program name is filename.c without the .c
- target = str(target_name).split('.')[0])
+ use = ['aubio', 'LASH', 'JACK', 'SNDFILE', 'utilsio'],
+ source = str(source_file),
+ target = str(source_file).split('.')[0]
+ )
# install headers, except _priv.h ones
ctx.install_files('${PREFIX}/include/aubio/',
- ctx.path.ant_glob('**/*.h',
- exclude = ['_priv.h', 'config.h']),
- relative_trick=True)
+
+ ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']),
+ relative_trick=True)
--- /dev/null
+# vim:set syntax=python:
+
+for target_name in ctx.path.ant_glob('src/**/*.c'):
+ uselib = []
+ includes = ['../src']
+ extra_source = []
+ if str(target_name).endswith('-jack.c') and ctx.env['JACK']:
+ uselib += ['JACK']
+ includes += ['../examples']
+ extra_source += ['../examples/jackio.c']
+
+ bld(features = 'c cprogram test',
+ uselib = uselib,
+ source = [target_name] + extra_source,
+ target = str(target_name).split('.')[0],
+ includes = includes,
+ install_path = None,
+ defines = 'AUBIO_UNSTABLE_API=1',
+ cflags = ['-g'],
+ use = 'aubio')
+
ctx.add_option('--with-target-platform', type='string',
help='set target platform for cross-compilation', dest='target_platform')
ctx.load('compiler_c')
- ctx.load('gnu_dirs')
ctx.load('waf_unit_test')
def configure(ctx):
- import Options
- ctx.check_tool('compiler_c')
- ctx.check_tool('gnu_dirs') # helpful for autotools transition and .pc generation
+ from waflib import Options
+ ctx.load('compiler_c')
ctx.load('waf_unit_test')
ctx.env.CFLAGS = ['-g', '-Wall', '-Wextra']
except ctx.errors.ConfigurationError:
ctx.to_log('docbook-to-man was not found (ignoring)')
-def build(ctx):
- ctx.env['VERSION'] = VERSION
- ctx.env['LIB_VERSION'] = LIB_VERSION
+def build(bld):
+ bld.env['VERSION'] = VERSION
+ bld.env['LIB_VERSION'] = LIB_VERSION
# add sub directories
- ctx.add_subdirs(['src','examples'])
- if ctx.env['SWIG']:
- if ctx.env['PYTHON']:
- ctx.add_subdirs('python')
+ bld.recurse('src examples tests')
+ """
# create the aubio.pc file for pkg-config
if ctx.env['TARGET_PLATFORM'] == 'linux':
aubiopc = ctx.new_task_gen('subst')
ctx.install_files('${MANDIR}/man1', ctx.path.ant_glob('doc/*.1'))
# install woodblock sound
- ctx.install_files('${PREFIX}/share/sounds/aubio/',
+ bld.install_files('${PREFIX}/share/sounds/aubio/',
'sounds/woodblock.aiff')
-
- # build and run the unit tests
- build_tests(ctx)
-
-def shutdown(ctx):
- pass
-
-# loop over all *.c filenames in tests/src to build them all
-# target name is filename.c without the .c
-def build_tests(ctx):
- for target_name in ctx.path.ant_glob('tests/src/**/*.c'):
- uselib = []
- includes = ['src']
- extra_source = []
- if str(target_name).endswith('-jack.c') and ctx.env['JACK']:
- uselib += ['JACK']
- includes += ['examples']
- extra_source += ['examples/jackio.c']
-
- this_target = ctx.new_task_gen(
- features = 'c cprogram test',
- uselib = uselib,
- source = [target_name] + extra_source,
- target = str(target_name).split('.')[0],
- includes = includes,
- defines = 'AUBIO_UNSTABLE_API=1',
- cflags = ['-g'],
- use = 'aubio')
+ """