src/wscript
author Craig Dowell <craigdo@ee.washington.edu>
Wed, 05 Nov 2008 14:08:54 -0800
changeset 3839 c85506878fe5
parent 3830 8862b9be62bb
child 3854 c049b25f2ded
permissions -rw-r--r--
remove tap device and helper
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
     1
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
     2
761
0ffbc9fa8ef0 Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 693
diff changeset
     3
import os, os.path
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
     4
import shutil
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1214
diff changeset
     5
import types
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
     6
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
     7
import Action
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
     8
import Common
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
     9
import Object
600
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    10
import Params
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    11
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
    12
969
3c3ce40492a6 WAF: make list of modules (all_modules) a tuple instead of list, because it is hashable, and this way newer WAF is able to notice changes in it and automatically trigger a reconfiguration.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 968
diff changeset
    13
all_modules = (
600
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    14
    'core',
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    15
    'common',
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    16
    'simulator',
1878
f947cd18f0bb Create a new contrib module; move event-garbage-collector.{h,cc} to the contrib module.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1877
diff changeset
    17
    'contrib',
600
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    18
    'node',
3260
8c0ab08144e6 bug 186: internet-node directory must be renamed to internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3063
diff changeset
    19
    'internet-stack',
972
6946c8237a73 src/devices/p2p -> src/devices/point-to-point
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 969
diff changeset
    20
    'devices/point-to-point',
1272
67a2ba1143e0 rename to csma
Craig Dowell <craigdo@ee.washington.edu>
parents: 1220
diff changeset
    21
    'devices/csma',
3826
40c5841b616d merge in tap device
Craig Dowell <craigdo@ee.washington.edu>
parents: 3581
diff changeset
    22
    'devices/bridge',
3830
8862b9be62bb rework to address suid root issues
Craig Dowell <craigdo@ee.washington.edu>
parents: 3829
diff changeset
    23
    'devices/emu',
1496
0ad4c18b475c start of udp echo applications
Craig Dowell <craigdo@ee.washington.edu>
parents: 1306
diff changeset
    24
    'applications/onoff',
0ad4c18b475c start of udp echo applications
Craig Dowell <craigdo@ee.washington.edu>
parents: 1306
diff changeset
    25
    'applications/packet-sink',
0ad4c18b475c start of udp echo applications
Craig Dowell <craigdo@ee.washington.edu>
parents: 1306
diff changeset
    26
    'applications/udp-echo',
1716
9757633a85da Add OLSR routing support, (loosely) based on Francisco J. Ros's NS-2 code (University of Murcia).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 969
diff changeset
    27
    'routing/olsr',
1120
050454d7d028 interim
Tom Henderson <tomh@tomh.org>
parents: 1119
diff changeset
    28
    'routing/global-routing',
968
70d02500c9d5 mobility models
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 955
diff changeset
    29
    'mobility',
1882
061f7f7f9992 start of work towards port of wifi code
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1272
diff changeset
    30
    'devices/wifi',
2603
1308da4cb3bf move helpers to their own dir.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2178
diff changeset
    31
    'helper',
3570
44b0bc6817c6 Stats module and example merged in.
tjkopena@cs.drexel.edu
parents: 3498
diff changeset
    32
    'contrib/stats',
3821
9ea825f066a2 Apply icmp-application patch frm lacage
Craig Dowell <craigdo@ee.washington.edu>
parents: 3581
diff changeset
    33
    'applications/v4ping',
969
3c3ce40492a6 WAF: make list of modules (all_modules) a tuple instead of list, because it is hashable, and this way newer WAF is able to notice changes in it and automatically trigger a reconfiguration.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 968
diff changeset
    34
    )
600
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    35
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    36
def set_options(opt):
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    37
    opt.sub_options('simulator')
955
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    38
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    39
    opt.add_option('--enable-rpath',
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    40
                   help=("Link programs with rpath"
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    41
                         " (normally not needed, see "
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    42
                         " --run and --shell; moreover, only works in some"
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    43
                         " specific platforms, such as Linux and Solaris)"),
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    44
                   action="store_true", dest='enable_rpath', default=False)
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    45
1858
68e1964c19e8 WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1747
diff changeset
    46
    opt.add_option('--enable-modules',
68e1964c19e8 WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1747
diff changeset
    47
                   help=("Build only these modules (and dependencies)"),
68e1964c19e8 WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1747
diff changeset
    48
                   dest='enable_modules')
68e1964c19e8 WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1747
diff changeset
    49
955
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    50
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    51
def configure(conf):
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    52
    conf.sub_config('core')
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    53
    conf.sub_config('simulator')
3063
a1c532e3bf18 a basic but useful Gtk+-based config-store
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3001
diff changeset
    54
    conf.sub_config('contrib')
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3498
diff changeset
    55
    conf.sub_config('internet-stack')
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    56
761
0ffbc9fa8ef0 Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 693
diff changeset
    57
    blddir = os.path.abspath(os.path.join(conf.m_blddir, conf.env.variant()))
3498
ce35418645e9 bug 266: src/wscript unconditionally sets conf.env['NS3_MODULE_PATH']
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3439
diff changeset
    58
    conf.env.append_value('NS3_MODULE_PATH', blddir)
1306
8834e434187f Build the ns3 library in the build/<variant> root, not in build/<variant>/src.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1272
diff changeset
    59
    if Params.g_options.enable_rpath:
8834e434187f Build the ns3 library in the build/<variant> root, not in build/<variant>/src.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1272
diff changeset
    60
        conf.env.append_value('RPATH', '-Wl,-rpath=%s' % (os.path.join(blddir),))
761
0ffbc9fa8ef0 Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 693
diff changeset
    61
928
218063b19458 WAF: derive the variable NS3_MODULES from the 'all_modules' list in src/wscript, instead of requiring every module to define a configure function to register themselves. This way module registration is done in one place only: src/wscript. Requires module naming conventions, though.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 770
diff changeset
    62
    ## Used to link the 'run-tests' program with all of ns-3 code
218063b19458 WAF: derive the variable NS3_MODULES from the 'all_modules' list in src/wscript, instead of requiring every module to define a configure function to register themselves. This way module registration is done in one place only: src/wscript. Requires module naming conventions, though.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 770
diff changeset
    63
    conf.env['NS3_MODULES'] = ['ns3-' + module.split('/')[-1] for module in all_modules]
218063b19458 WAF: derive the variable NS3_MODULES from the 'all_modules' list in src/wscript, instead of requiring every module to define a configure function to register themselves. This way module registration is done in one place only: src/wscript. Requires module naming conventions, though.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 770
diff changeset
    64
1858
68e1964c19e8 WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1747
diff changeset
    65
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1214
diff changeset
    66
def create_ns3_module(bld, name, dependencies=()):
1220
4933e0890acd Build all modules as a single ns3 shared library.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1217
diff changeset
    67
    module = bld.create_obj('cpp', 'objects')
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1214
diff changeset
    68
    module.name = 'ns3-' + name
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1214
diff changeset
    69
    module.target = module.name
1220
4933e0890acd Build all modules as a single ns3 shared library.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1217
diff changeset
    70
    module.add_objects = ['ns3-' + dep for dep in dependencies]
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
    71
    module.module_deps = list(dependencies)
1220
4933e0890acd Build all modules as a single ns3 shared library.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1217
diff changeset
    72
    module.env.append_value('CXXFLAGS', module.env['shlib_CXXFLAGS'])
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
    73
    module.env.append_value('CXXDEFINES', "NS3_MODULE_COMPILATION")
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1214
diff changeset
    74
    return module
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1214
diff changeset
    75
    
955
c9be0df711d2 WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 954
diff changeset
    76
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    77
def build(bld):
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
    78
    #Object.register('ns3header', Ns3Header)
954
a54d59850d03 WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 928
diff changeset
    79
    Action.Action('ns3header', func=_ns3_headers_inst, color='BLUE')
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
    80
    #Object.register('ns3-module-header', Ns3ModuleHeader)
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
    81
    Action.Action('gen-ns3-module-header', func=gen_ns3_module_header, color='BLUE')
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1214
diff changeset
    82
    bld.create_ns3_module = types.MethodType(create_ns3_module, bld)
600
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    83
    
969
3c3ce40492a6 WAF: make list of modules (all_modules) a tuple instead of list, because it is hashable, and this way newer WAF is able to notice changes in it and automatically trigger a reconfiguration.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 968
diff changeset
    84
    bld.add_subdirs(list(all_modules))
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
    85
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
    86
    for module in all_modules:
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
    87
        modheader = bld.create_obj('ns3moduleheader')
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
    88
        modheader.module = module.split('/')[-1]
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
    89
1220
4933e0890acd Build all modules as a single ns3 shared library.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1217
diff changeset
    90
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
    91
class ns3header_taskgen(Object.task_gen):
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
    92
    """A set of NS-3 header files"""
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
    93
    def __init__(self, *features):
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
    94
        Object.task_gen.__init__(self, *features)
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
    95
        self.inst_var = 'INCLUDEDIR'
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
    96
        self.inst_dir = 'ns3'
1877
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
    97
        self.sub_dir = None # if not None, header files will be published as ns3/sub_dir/file.h
2609
931d59bb1303 Add a 'module' attribute to the ns3header object specifying which module each set of headers belongs to.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2603
diff changeset
    98
        self.module = None # module name
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
    99
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   100
    def apply(self):
2609
931d59bb1303 Add a 'module' attribute to the ns3header object specifying which module each set of headers belongs to.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2603
diff changeset
   101
        if self.module is None:
931d59bb1303 Add a 'module' attribute to the ns3header object specifying which module each set of headers belongs to.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2603
diff changeset
   102
            Params.fatal("'module' missing on ns3headers object %s" % self)
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   103
        ns3_dir_node = Params.g_build.m_srcnode.find_dir("ns3")
1877
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
   104
        if self.sub_dir is not None:
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
   105
            ns3_dir_node = ns3_dir_node.find_dir(self.sub_dir)
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   106
        for filename in self.to_list(self.source):
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   107
            src_node = self.path.find_source(filename)
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   108
            if src_node is None:
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   109
                Params.fatal("source ns3 header file %s not found" % (filename,))
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   110
            dst_node = ns3_dir_node.find_build(os.path.basename(filename))
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   111
            assert dst_node is not None
954
a54d59850d03 WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 928
diff changeset
   112
            task = self.create_task('ns3header', self.env, 1)
a54d59850d03 WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 928
diff changeset
   113
            task.set_inputs([src_node])
a54d59850d03 WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 928
diff changeset
   114
            task.set_outputs([dst_node])
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   115
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   116
    def install(self):
1877
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
   117
        if self.sub_dir is None:
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
   118
            inst_dir = self.inst_dir
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
   119
        else:
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
   120
            inst_dir = os.path.join(self.inst_dir, self.sub_dir)
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   121
        for i in self.m_tasks:
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   122
            current = Params.g_build.m_curdirnode
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   123
            lst = map(lambda a: a.relpath_gen(current), i.m_outputs)
1877
b2ebc493cd58 Add support for publishing ns3 headers in a subdir of ns3/ (we probably won't be needing this, but since it was implemented it might as well be commited, in case we ever need it)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1858
diff changeset
   124
            Common.install_files(self.inst_var, inst_dir, lst)
693
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   125
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   126
def _ns3_headers_inst(task):
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   127
    assert len(task.m_inputs) == len(task.m_outputs)
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   128
    inputs = [node.srcpath(task.m_env) for node in task.m_inputs]
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   129
    outputs = [node.bldpath(task.m_env) for node in task.m_outputs]
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   130
    for src, dst in zip(inputs, outputs):
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   131
        try:
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   132
            os.chmod(dst, 0600)
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   133
        except OSError:
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   134
            pass
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   135
        shutil.copy2(src, dst)
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   136
        ## make the headers in builddir read-only, to prevent
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   137
        ## accidental modification
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   138
        os.chmod(dst, 0400)
c8fc89076aa2 WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 672
diff changeset
   139
    return 0
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   140
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   141
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   142
def gen_ns3_module_header(task):
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   143
    assert len(task.m_outputs) == 1
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   144
    header_files = [os.path.basename(node.abspath(task.m_env)) for node in task.m_inputs]
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   145
    outfile = file(task.m_outputs[0].bldpath(task.m_env), "w")
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   146
    header_files.sort()
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   147
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   148
    print >> outfile, """
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   149
#ifdef NS3_MODULE_COMPILATION
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   150
# error "Do not include ns3 module aggregator headers from other modules; these are meant only for end user scripts."
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   151
#endif
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   152
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   153
#ifndef NS3_MODULE_%s
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   154
""" % (task.module.upper().replace('-', '_'),)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   155
2750
87cebcbeb380 Don't generate module dependencies includes in module headers.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2611
diff changeset
   156
#     if task.module_deps:
87cebcbeb380 Don't generate module dependencies includes in module headers.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2611
diff changeset
   157
#         print >> outfile, "// Module dependencies:"
87cebcbeb380 Don't generate module dependencies includes in module headers.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2611
diff changeset
   158
#     for dep in task.module_deps:
87cebcbeb380 Don't generate module dependencies includes in module headers.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2611
diff changeset
   159
#         print >> outfile, "#include \"%s-module.h\"" % dep
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   160
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   161
    print >> outfile
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   162
    print >> outfile, "// Module headers:"
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   163
    for header in header_files:
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   164
        print >> outfile, "#include \"%s\"" % (header,)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   165
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   166
    print >> outfile, "#endif"
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   167
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   168
    outfile.close()
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   169
    return 0
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   170
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   171
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
   172
class ns3moduleheader_taskgen(Object.task_gen):
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   173
    """
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   174
    Generates a 'ns3/foo-module.h' header file that includes all
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   175
    public ns3 headers of a certain module.
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   176
    """
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
   177
    def __init__(self, *features):
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
   178
        Object.task_gen.__init__(self, *features)
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   179
        self.module_name = None
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   180
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   181
    def apply(self):
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   182
        ## get all of the ns3 headers
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   183
        ns3_dir_node = Params.g_build.m_srcnode.find_dir("ns3")
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   184
        all_headers_inputs = []
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   185
        for ns3headers in Object.g_allobjs:
3001
f7aa2796627f WAF: convert code to WAF 1.4 API; the 'waf' script bundle will be updated later, for now has been disabled.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2750
diff changeset
   186
            if isinstance(ns3headers, ns3header_taskgen):
2611
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   187
                if ns3headers.module != self.module:
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   188
                    continue
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   189
                for source in ns3headers.to_list(ns3headers.source):
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   190
                    source = os.path.basename(source)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   191
                    node = ns3_dir_node.find_build(os.path.basename(source))
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   192
                    if node is None:
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   193
                        fatal("missing header file %s" % (source,))
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   194
                    all_headers_inputs.append(node)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   195
        assert all_headers_inputs
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   196
        module_obj = Object.name_to_obj("ns3-" + self.module)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   197
        assert module_obj is not None
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   198
        all_headers_outputs = [ns3_dir_node.find_build("%s-module.h" % self.module)]
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   199
        task = self.create_task('gen-ns3-module-header', self.env, 4)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   200
        task.set_inputs(all_headers_inputs)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   201
        task.set_outputs(all_headers_outputs)
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   202
        task.module = self.module
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   203
        task.module_deps = module_obj.module_deps
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   204
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   205
    def install(self):
79b1c42fef3e Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2609
diff changeset
   206
        pass