1 #!/usr/bin/env python 2 3 import os, sys 4 from subprocess import Popen, STDOUT, PIPE 5 6 if 'MAKEFLAGS' in os.environ: 7 del os.environ['MAKEFLAGS'] 8 proc = Popen(['nmake', 'dll_', 'mt'], stdout=PIPE, stderr=STDOUT, 9 cwd=sys.argv[1]) 10 11 while True: 12 line = proc.stdout.readline() 13 if line == '': 14 break 15 line = line.rstrip() 16 # explicitly ignore this fatal-sounding non-fatal error 17 if line == "NMAKE : fatal error U1052: file 'makefile.sub' not found" or line == "Stop.": 18 continue 19 print line 20 sys.exit(proc.wait()) 21