build/pymake/make.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build/pymake/make.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +"""
     1.7 +make.py
     1.8 +
     1.9 +A drop-in or mostly drop-in replacement for GNU make.
    1.10 +"""
    1.11 +
    1.12 +import sys, os
    1.13 +import pymake.command, pymake.process
    1.14 +
    1.15 +import gc
    1.16 +
    1.17 +if __name__ == '__main__':
    1.18 +  if 'TINDERBOX_OUTPUT' in os.environ:
    1.19 +    # When building on mozilla build slaves, execute mozmake instead. Until bug
    1.20 +    # 978211, this is the easiest, albeit hackish, way to do this.
    1.21 +    import subprocess
    1.22 +    mozmake = os.path.join(os.path.dirname(__file__), '..', '..',
    1.23 +        'mozmake.exe')
    1.24 +    if os.path.exists(mozmake):
    1.25 +        cmd = [mozmake]
    1.26 +        cmd.extend(sys.argv[1:])
    1.27 +        shell = os.environ.get('SHELL')
    1.28 +        if shell and not shell.lower().endswith('.exe'):
    1.29 +            cmd += ['SHELL=%s.exe' % shell]
    1.30 +        sys.exit(subprocess.call(cmd))
    1.31 +
    1.32 +  sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
    1.33 +  sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
    1.34 +
    1.35 +  gc.disable()
    1.36 +
    1.37 +  pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
    1.38 +  pymake.process.ParallelContext.spin()
    1.39 +  assert False, "Not reached"

mercurial