build/pymake/make.py

branch
TOR_BUG_9701
changeset 3
141e0f1194b1
equal deleted inserted replaced
-1:000000000000 0:02f6169a9449
1 #!/usr/bin/env python
2
3 """
4 make.py
5
6 A drop-in or mostly drop-in replacement for GNU make.
7 """
8
9 import sys, os
10 import pymake.command, pymake.process
11
12 import gc
13
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))
28
29 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
30 sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
31
32 gc.disable()
33
34 pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
35 pymake.process.ParallelContext.spin()
36 assert False, "Not reached"

mercurial