build.py
author Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 19 Nov 2008 17:46:30 +0000
changeset 0 b3cf4a666ff5
child 6 f5752bee23db
permissions -rwxr-xr-x
initial draft of the 'all-in-one' build system
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     1
#! /usr/bin/env python
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     2
import sys
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     3
from optparse import OptionParser
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     4
import os
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     5
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     6
import constants
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     7
from util import run_command, fatal
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     8
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     9
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    10
def main(argv):
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    11
    parser = OptionParser()
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    12
    (options, args) = parser.parse_args()
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    13
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    14
    # first of all, change to the directory of ns-3
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    15
    d = os.path.join(os.path.dirname(__file__), constants.BRANCH)
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    16
    print "Entering directory `%s'" % d
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    17
    os.chdir(d)
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    18
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    19
    run_command(["./waf", "configure",
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    20
                 "--with-regression-traces", os.path.join("..", constants.BRANCH + constants.REGRESSION_SUFFIX),
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    21
                 "--with-pybindgen", os.path.join("..", constants.LOCAL_PYBINDGEN_PATH),
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    22
                 ])
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    23
    run_command(["./waf"])
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    24
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    25
    return 0
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    26
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    27
if __name__ == '__main__':
b3cf4a666ff5 initial draft of the 'all-in-one' build system
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    28
    sys.exit(main(sys.argv))