| 1 |
"""Build an experimental just-in-time compiler for CPython.""" |
| 2 |
|
| 3 |
import argparse |
| 4 |
import pathlib |
| 5 |
import shlex |
| 6 |
import sys |
| 7 |
|
| 8 |
import _targets |
| 9 |
|
| 10 |
if __name__ == "__main__": |
| 11 |
comment = f"$ {shlex.join([sys.executable] + sys.argv)}" |
| 12 |
parser = argparse.ArgumentParser(description=__doc__) |
| 13 |
parser.add_argument( |
| 14 |
"target", type=_targets.get_target, help="a PEP 11 target triple to compile for" |
| 15 |
) |
| 16 |
parser.add_argument( |
| 17 |
"-d", "--debug", action="store_true", help="compile for a debug build of Python" |
| 18 |
) |
| 19 |
parser.add_argument( |
| 20 |
"-f", "--force", action="store_true", help="force the entire JIT to be rebuilt" |
| 21 |
) |
| 22 |
parser.add_argument( |
| 23 |
"-v", "--verbose", action="store_true", help="echo commands as they are run" |
| 24 |
) |
| 25 |
args = parser.parse_args() |
| 26 |
args.target.debug = args.debug |
| 27 |
args.target.verbose = args.verbose |
| 28 |
args.target.build(pathlib.Path.cwd(), comment=comment, force=args.force) |