2009-03-19 17:19:38 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
"""
|
|
|
|
make.py
|
|
|
|
|
|
|
|
A drop-in or mostly drop-in replacement for GNU make.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import sys, os
|
|
|
|
import pymake.command, pymake.process
|
|
|
|
|
2009-04-02 00:13:55 +04:00
|
|
|
import gc
|
|
|
|
|
2010-10-18 17:50:27 +04:00
|
|
|
if __name__ == '__main__':
|
2014-03-25 10:51:13 +04:00
|
|
|
if 'TINDERBOX_OUTPUT' in os.environ:
|
|
|
|
# When building on mozilla build slaves, execute mozmake instead. Until bug
|
|
|
|
# 978211, this is the easiest, albeit hackish, way to do this.
|
|
|
|
import subprocess
|
|
|
|
mozmake = os.path.join(os.path.dirname(__file__), '..', '..',
|
|
|
|
'mozmake.exe')
|
|
|
|
if os.path.exists(mozmake):
|
|
|
|
cmd = [mozmake]
|
|
|
|
cmd.extend(sys.argv[1:])
|
|
|
|
shell = os.environ.get('SHELL')
|
|
|
|
if shell and not shell.lower().endswith('.exe'):
|
|
|
|
cmd += ['SHELL=%s.exe' % shell]
|
|
|
|
sys.exit(subprocess.call(cmd))
|
|
|
|
|
2012-10-02 16:17:43 +04:00
|
|
|
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
|
|
|
|
sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
|
|
|
|
|
2010-10-18 17:50:27 +04:00
|
|
|
gc.disable()
|
|
|
|
|
|
|
|
pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
|
|
|
|
pymake.process.ParallelContext.spin()
|
|
|
|
assert False, "Not reached"
|