mlibc/configure
2015-11-15 19:19:53 +01:00

24 lines
617 B
Python
Executable file

#!/usr/bin/env python
import sys
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--sysroot', required=True)
args = parser.parse_args()
script_dir = os.path.dirname(sys.argv[0])
make_cfg = { "TREE_PATH": os.path.relpath(os.path.realpath(script_dir)),
"BUILD_PATH": os.path.relpath(os.path.realpath(os.getcwd())),
"SYSROOT_PATH": os.path.relpath(os.path.realpath(args.sysroot)) }
make_fd = open('makefile', 'w')
for k, v in make_cfg.iteritems():
make_fd.write("%s = %s\n" % (k, v))
make_fd.write("\n")
make_fd.write("include $(TREE_PATH)/toplevel.makefile\n")
make_fd.close()