| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import multiprocessing | 7 import multiprocessing |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| 11 import sys | 11 import sys |
| 12 import time | 12 import time |
| 13 import utils | 13 import utils |
| 14 | 14 |
| 15 HOST_OS = utils.GuessOS() | 15 HOST_OS = utils.GuessOS() |
| 16 HOST_CPUS = utils.GuessCpus() | 16 HOST_CPUS = utils.GuessCpus() |
| 17 SCRIPT_DIR = os.path.dirname(sys.argv[0]) | 17 SCRIPT_DIR = os.path.dirname(sys.argv[0]) |
| 18 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..')) | 18 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..')) |
| 19 | 19 |
| 20 usage = """\ | 20 usage = """\ |
| 21 usage: %%prog [options] [targets] | 21 usage: %%prog [options] [targets] |
| 22 | 22 |
| 23 This script runs 'make' in the *current* directory. So, run it from | 23 This script invokes ninja to build Dart. |
| 24 the Dart repo root, | 24 """ |
| 25 | |
| 26 %s , | |
| 27 | |
| 28 unless you really intend to use a non-default Makefile.""" % DART_ROOT | |
| 29 | 25 |
| 30 | 26 |
| 31 def BuildOptions(): | 27 def BuildOptions(): |
| 32 result = optparse.OptionParser(usage=usage) | 28 result = optparse.OptionParser(usage=usage) |
| 33 result.add_option("-m", "--mode", | 29 result.add_option("-m", "--mode", |
| 34 help='Build variants (comma-separated).', | 30 help='Build variants (comma-separated).', |
| 35 metavar='[all,debug,release,product]', | 31 metavar='[all,debug,release,product]', |
| 36 default='debug') | 32 default='debug') |
| 37 result.add_option("-v", "--verbose", | 33 result.add_option("-v", "--verbose", |
| 38 help='Verbose output.', | 34 help='Verbose output.', |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 if r != 0: | 304 if r != 0: |
| 309 return 1 | 305 return 1 |
| 310 | 306 |
| 311 endtime = time.time() | 307 endtime = time.time() |
| 312 print ("The build took %.3f seconds" % (endtime - starttime)) | 308 print ("The build took %.3f seconds" % (endtime - starttime)) |
| 313 return 0 | 309 return 0 |
| 314 | 310 |
| 315 | 311 |
| 316 if __name__ == '__main__': | 312 if __name__ == '__main__': |
| 317 sys.exit(Main()) | 313 sys.exit(Main()) |
| OLD | NEW |