make.py 967 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. """
  3. make.py
  4. A drop-in or mostly drop-in replacement for GNU make.
  5. """
  6. import sys, os
  7. import pymake.command, pymake.process
  8. import gc
  9. if __name__ == '__main__':
  10. if 'TINDERBOX_OUTPUT' in os.environ:
  11. # When building on mozilla build slaves, execute mozmake instead. Until bug
  12. # 978211, this is the easiest, albeit hackish, way to do this.
  13. import subprocess
  14. mozmake = os.path.join(os.path.dirname(__file__), '..', '..',
  15. 'mozmake.exe')
  16. cmd = [mozmake]
  17. cmd.extend(sys.argv[1:])
  18. shell = os.environ.get('SHELL')
  19. if shell and not shell.lower().endswith('.exe'):
  20. cmd += ['SHELL=%s.exe' % shell]
  21. sys.exit(subprocess.call(cmd))
  22. sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
  23. sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
  24. gc.disable()
  25. pymake.command.main(sys.argv[1:], os.environ, os.getcwd(), cb=sys.exit)
  26. pymake.process.ParallelContext.spin()
  27. assert False, "Not reached"