build: various updates and cleanups

Change-Id: Ic01420fc1d2f5b61b1b81c6e1d99c1921395162a
diff --git a/examples/wscript b/examples/wscript
index 03a1b93..6e49f4e 100644
--- a/examples/wscript
+++ b/examples/wscript
@@ -3,12 +3,14 @@
 top = '..'
 
 def build(bld):
-    if bld.env['WITH_EXAMPLES']:
-        for app in bld.path.ant_glob('*.cpp'):
-            bld(features=['cxx', 'cxxprogram'],
-                target='%s' % (str(app.change_ext('', '.cpp'))),
-                source=app,
-                use='NDN_CXX',
-                includes="../src",
-                install_path=None,
-                )
+    if not bld.env['WITH_EXAMPLES']:
+        return
+
+    for ex in bld.path.ant_glob('*.cpp'):
+        name = ex.change_ext('').path_from(bld.path.get_bld())
+        bld.program(name='example-%s' % name,
+                    target=name,
+                    source=[ex],
+                    use='NDN_CXX',
+                    includes='../src',
+                    install_path=None)