Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 #!/usr/bin/env python
3 """
4 make.py
6 A drop-in or mostly drop-in replacement for GNU make.
7 """
9 import sys, os
10 import pymake.command, pymake.process
12 import gc
14 if __name__ == '__main__':
15 if 'TINDERBOX_OUTPUT' in os.environ:
16 # When building on mozilla build slaves, execute mozmake instead. Until bug
17 # 978211, this is the easiest, albeit hackish, way to do this.
18 import subprocess
19 mozmake = os.path.join(os.path.dirname(__file__), '..', '..',
20 'mozmake.exe')
21 if os.path.exists(mozmake):
22 cmd = [mozmake]
23 cmd.extend(sys.argv[1:])
24 shell = os.environ.get('SHELL')
25 if shell and not shell.lower().endswith('.exe'):
26 cmd += ['SHELL=%s.exe' % shell]
27 sys.exit(subprocess.call(cmd))
29 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
30 sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
32 gc.disable()
34 pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
35 pymake.process.ParallelContext.spin()
36 assert False, "Not reached"