wscript: always use installed external dependancies, simplify
[aubio.git] / examples / wscript_build
index 5215672f3f3a5734fe81938e7930cccfe8d2c9c9..b89b9fd5fb6f4072ee5684847b868a671f1dd907 100644 (file)
@@ -1,14 +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 utils.c
-  if target_name in ['utils.c', 'jackio.c', 'sndfileio.c']: continue 
-  bld.new_task_gen(features = 'cc 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'],
-      uselib_local = ['aubio'],
-      source = target_name,
-      # program name is filename.c without the .c
-      target = target_name.split('.')[0])
+      use = ['aubio', 'FFTW3F', 'FFTW3', 'SNDFILE', 'JACK', 'LASH', 'SAMPLERATE', 'utilsio'],
+      source = str(source_file),
+      target = str(source_file).split('.')[0]
+    )