wscript: always use installed external dependancies, simplify
[aubio.git] / examples / wscript_build
index 7b00b37a52ded290bcbc44526389c2646ba128cf..b89b9fd5fb6f4072ee5684847b868a671f1dd907 100644 (file)
@@ -1,16 +1,18 @@
+# vim:set syntax=python:
+
 # build examples
+utilsio = bld(
+        name = 'utilsio',
+        features = 'c',
+        includes = '../src',
+        source = ['utils.c', 'jackio.c'],
+        target = 'utilsio')
 
 # loop over all *.c filenames in examples to build them all
-for target_name in bld.path.ant_glob('*.c').split():
-  # ignore aubioonset.c and utils.c
-  if target_name in ['utils.c']: continue 
-  this_target = bld.new_task_gen(features = 'cc cprogram')
-  this_target.includes = '. ../src ../ext'
-  this_target.uselib = ['LASH']
-  this_target.uselib_local = ['aubio', 'aubioext']
-  this_target.defines = ['AUBIO_PREFIX="' + bld.env['AUBIO_PREFIX'] + '"']
-  this_target.defines += ['PACKAGE="' + bld.env['PACKAGE'] + '"']
-  # add utils.c as source file
-  this_target.source = [target_name, 'utils.c']
-  # program name is filename.c without the .c
-  this_target.target = target_name.split('.')[0]
+for source_file in ctx.path.ant_glob('*.c', excl = ['utils.c', 'jackio.c']):
+  bld.program(features = 'c cprogram',
+      includes = '../src',
+      use = ['aubio', 'FFTW3F', 'FFTW3', 'SNDFILE', 'JACK', 'LASH', 'SAMPLERATE', 'utilsio'],
+      source = str(source_file),
+      target = str(source_file).split('.')[0]
+    )