Files
linux-kernel-module-cheat/build-qemu
Ciro Santilli 六四事件 法轮功 3980974e91 common: factor -j --nproc to all builds
2018-10-23 00:00:02 +00:00

54 lines
1.3 KiB
Python
Executable File

#!/usr/bin/env python3
import os
import common
class QemuComponent(common.Component):
def add_parser_arguments(self, parser):
parser.add_argument(
'extra_config_args',
default=[],
metavar='extra-config-args',
nargs='*'
)
def do_build(self, args):
build_dir = self.get_build_dir(args)
os.makedirs(build_dir, exist_ok=True)
if args.verbose:
verbose = ['V=1']
else:
verbose = []
common.run_cmd(
[
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,
extra_paths=[common.ccache_dir],
cwd=build_dir
)
common.run_cmd(
(
[
'make',
'-j', str(args.nproc),
] +
verbose
),
cwd=build_dir,
extra_paths=[common.ccache_dir],
)
def get_build_dir(self, args):
return common.qemu_build_dir
if __name__ == '__main__':
QemuComponent().build()