mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-13 20:12:26 +00:00
42 lines
984 B
Python
Executable File
42 lines
984 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import multiprocessing
|
|
import os
|
|
import subprocess
|
|
|
|
import common
|
|
|
|
parser = common.get_argparse()
|
|
common.add_build_arguments(parser)
|
|
parser.add_argument(
|
|
'extra_config_args',
|
|
default=[],
|
|
metavar='extra-config-args',
|
|
nargs='*'
|
|
)
|
|
args = common.setup(parser)
|
|
if args.clean:
|
|
common.rmrf(common.qemu_build_dir)
|
|
else:
|
|
os.makedirs(common.qemu_build_dir, exist_ok=True)
|
|
subprocess.check_call(
|
|
[
|
|
os.path.join(common.qemu_src_dir, 'configure'),
|
|
'--enable-debug',
|
|
'--enable-trace-backends=simple',
|
|
'--target-list={}-softmmu'.format(args.arch),
|
|
'--enable-sdl',
|
|
'--with-sdlabi=2.0',
|
|
] +
|
|
args.extra_config_args,
|
|
cwd=common.qemu_build_dir
|
|
)
|
|
subprocess.check_call(
|
|
[
|
|
'make',
|
|
# TODO factor with build.
|
|
'-j', str(multiprocessing.cpu_count()),
|
|
],
|
|
cwd=common.qemu_build_dir
|
|
)
|