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