build examples
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 05 May 2011 09:49:28 +0200
changeset 68a384d3f2f086
parent 67 fb900a594421
child 69 19d7af80f47f
build examples
wscript
     1.1 --- a/wscript	Thu May 05 09:49:21 2011 +0200
     1.2 +++ b/wscript	Thu May 05 09:49:28 2011 +0200
     1.3 @@ -142,6 +142,51 @@
     1.4      for name,uselib in tests:
     1.5          new_test(bld, name, uselib)
     1.6  
     1.7 +def build_example(bld, needed, **kw):
     1.8 +    external = [i for i in needed if not i == 'dce' ]
     1.9 +    if not ns3waf.modules_found(bld, external):
    1.10 +        return
    1.11 +    kw['use'] = kw.get('use', []) + ns3waf.modules_uselib(bld, needed)
    1.12 +    bld.program(**kw)
    1.13 +    
    1.14 +
    1.15 +def build_dce_examples(bld):
    1.16 +    create_dce_program(bld, target = 'bin/udp-server', 
    1.17 +                       source = ['example/udp-server.cc'])
    1.18 +    create_dce_program(bld, target = 'bin/udp-client', 
    1.19 +                       source = ['example/udp-client.cc'])
    1.20 +    create_dce_program(bld, target = 'bin/tcp-server', 
    1.21 +                       source = ['example/tcp-server.cc'])
    1.22 +    create_dce_program(bld, target = 'bin/tcp-client', 
    1.23 +                       source = ['example/tcp-client.cc'])
    1.24 +    create_dce_program(bld, target = 'bin/tcp-loopback', 
    1.25 +                       source = ['example/tcp-loopback.cc'])
    1.26 +    create_dce_program(bld, target = 'bin/udp-perf', 
    1.27 +                       source = ['example/udp-perf.cc'],
    1.28 +                       lib='m')
    1.29 +
    1.30 +    build_example(bld, ['core', 'internet', 'dce'], 
    1.31 +                  target='bin/dce-tcp-simple',
    1.32 +                  source=['example/dce-tcp-simple.cc'])
    1.33 +
    1.34 +    build_example(bld, ['core', 'internet', 'dce'], 
    1.35 +                  target='bin/dce-udp-simple',
    1.36 +                  source=['example/dce-udp-simple.cc'])
    1.37 +
    1.38 +    build_example(bld, ['core', 'internet', 'dce', 'point-to-point'], 
    1.39 +                  target='bin/dce-udp-perf',
    1.40 +                  source=['example/dce-udp-perf.cc'])
    1.41 +
    1.42 +
    1.43 +    if bld.env['KERNEL_STACK']:
    1.44 +        build_example(bld, ['core', 'network', 'dce'], 
    1.45 +                      target='bin/dce-linux-simple',
    1.46 +                      source=['example/dce-linux-simple.cc'])
    1.47 +
    1.48 +        build_example(bld, ['core', 'network', 'dce', 'wifi', 'point-to-point', 'csma', 'mobility'],
    1.49 +                      target='bin/dce-linux',
    1.50 +                      source=['example/dce-linux.cc'])
    1.51 +
    1.52  
    1.53  def build(bld):
    1.54      build_netlink(bld)
    1.55 @@ -231,7 +276,8 @@
    1.56          'test/dce-manager-test.cc',
    1.57          ]
    1.58      module.add_tests(source=module_tests, use = uselib)
    1.59 -    build_dce_tests (bld)
    1.60 +    build_dce_tests(bld)
    1.61 +    build_dce_examples(bld)
    1.62  
    1.63      bld.add_group('dce_version_files')
    1.64