compile_test.py #!/usr/bin/env python # $ Id: compile_test.py,v 1.3 2001/10/02 17:40:09 mulix Exp $ import sys, os, string, re def run_command(command): """ run a command in the local directory """ if (command == None): return com = command.split(); rc = os.spawnvp(os.P_WAIT, com[0], com); if (rc != 0): raise SpawnError, command + " failed" def compile(c_compiler, cpp_compiler, kernel_dir): """ run 'make_all' in the current directory, using the given compilers and setting KERNEL_DIR to 'kernel_dir' """ os.system('./clean_all > /dev/null') command = "./make_all GXX=%s CC=%s KERNEL_DIR=%s" % (cpp_compiler, c_compiler, kernel_dir) print '\n\ncompiling with: %s \n\n' % (command) sys.stdout.flush() run_command(command)