From 66b85743b453829e76193a22b3081126ac7374af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 18 Nov 2018 00:00:01 +0000 Subject: [PATCH] bak --- build-baremetal | 4 ++-- build-buildroot | 4 ++-- build-crosstool-ng | 4 ++-- build-docker | 4 ++-- build-gem5 | 4 ++-- build-linux | 4 ++-- build-m5 | 4 ++-- build-modules | 4 ++-- build-qemu | 4 ++-- build-userland | 4 ++-- common.py | 4 ++-- copy-overlay | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build-baremetal b/build-baremetal index b8e1294..1e326b7 100755 --- a/build-baremetal +++ b/build-baremetal @@ -4,7 +4,7 @@ import os import common -class BaremetalComponent(common.Component): +class BaremetalComponent(common.BuildComponent): def do_build(self, args): common.assert_crosstool_ng_supports_arch(args.arch) build_dir = self.get_build_dir(args) @@ -171,4 +171,4 @@ Build the baremetal examples with crosstool-NG. ) if __name__ == '__main__': - BaremetalComponent().build() + BaremetalComponent().main() diff --git a/build-buildroot b/build-buildroot index 0d0e9ea..69098e6 100755 --- a/build-buildroot +++ b/build-buildroot @@ -10,7 +10,7 @@ import re import common -class BuildrootComponent(common.Component): +class BuildrootComponent(common.BuildComponent): def add_parser_arguments(self, parser): parser.add_argument( '--build-linux', default=self._defaults['build_linux'], action='store_true', @@ -185,4 +185,4 @@ Run Linux on an emulator return os.path.relpath(abspath, common.buildroot_src_dir) if __name__ == '__main__': - BuildrootComponent().build() + BuildrootComponent().main() diff --git a/build-crosstool-ng b/build-crosstool-ng index 3386ad6..d6171d2 100755 --- a/build-crosstool-ng +++ b/build-crosstool-ng @@ -4,7 +4,7 @@ import os import common -class CrosstoolNgComponent(common.Component): +class CrosstoolNgComponent(common.BuildComponent): def do_build(self, args): common.assert_crosstool_ng_supports_arch(args.arch) build_dir = self.get_build_dir(args) @@ -74,4 +74,4 @@ Build crosstool-NG with Newlib for bare metal compilation' return common.crosstool_ng_build_dir if __name__ == '__main__': - CrosstoolNgComponent().build() + CrosstoolNgComponent().main() diff --git a/build-docker b/build-docker index 1882b56..0a2d552 100755 --- a/build-docker +++ b/build-docker @@ -7,7 +7,7 @@ import tarfile import common -class DockerComponent(common.Component): +class DockerComponent(common.BuildComponent): def get_argparse_args(self): return { 'description': '''\ @@ -76,4 +76,4 @@ See also:https://github.com/cirosantilli/linux-kernel-module-cheat#ubuntu-guest- def get_default_args(self): return {'docker': True} -DockerComponent().build() +DockerComponent().main() diff --git a/build-gem5 b/build-gem5 index 33f7a3e..ad03217 100755 --- a/build-gem5 +++ b/build-gem5 @@ -6,7 +6,7 @@ import subprocess import common -class Gem5Component(common.Component): +class Gem5Component(common.BuildComponent): def add_parser_arguments(self, parser): parser.add_argument( 'extra_scons_args', @@ -110,4 +110,4 @@ class Gem5Component(common.Component): return common.gem5_build_dir if __name__ == '__main__': - Gem5Component().build() + Gem5Component().main() diff --git a/build-linux b/build-linux index 15ac24d..39c7fd6 100755 --- a/build-linux +++ b/build-linux @@ -5,7 +5,7 @@ import shutil import common -class LinuxComponent(common.Component): +class LinuxComponent(common.BuildComponent): def add_parser_arguments(self, parser): parser.add_argument( '--config', default=[], action='append', @@ -146,4 +146,4 @@ Build the Linux kernel. return common.linux_build_dir if __name__ == '__main__': - LinuxComponent().build() + LinuxComponent().main() diff --git a/build-m5 b/build-m5 index 18c7ee2..f5405f3 100755 --- a/build-m5 +++ b/build-m5 @@ -4,7 +4,7 @@ import os import common -class M5Component(common.Component): +class M5Component(common.BuildComponent): def get_make_cmd(self, args): allowed_toolchains = ['buildroot'] cc = common.get_toolchain_tool('gcc', allowed_toolchains=allowed_toolchains) @@ -41,4 +41,4 @@ class M5Component(common.Component): ) if __name__ == '__main__': - M5Component().build() + M5Component().main() diff --git a/build-modules b/build-modules index 73432e5..b827924 100755 --- a/build-modules +++ b/build-modules @@ -7,7 +7,7 @@ import shutil import common -class ModulesComponent(common.Component): +class ModulesComponent(common.BuildComponent): def add_parser_arguments(self, parser): parser.add_argument( '--make-args', @@ -125,4 +125,4 @@ See also: https://github.com/cirosantilli/linux-kernel-module-cheat#host return os.path.join(common.kernel_modules_build_dir) if __name__ == '__main__': - ModulesComponent().build() + ModulesComponent().main() diff --git a/build-qemu b/build-qemu index 5299d07..f31457b 100755 --- a/build-qemu +++ b/build-qemu @@ -4,7 +4,7 @@ import os import common -class QemuComponent(common.Component): +class QemuComponent(common.BuildComponent): def add_parser_arguments(self, parser): parser.add_argument( '--userland', @@ -60,4 +60,4 @@ class QemuComponent(common.Component): return common.qemu_build_dir if __name__ == '__main__': - QemuComponent().build() + QemuComponent().main() diff --git a/build-userland b/build-userland index ca6c012..0fb7579 100755 --- a/build-userland +++ b/build-userland @@ -8,7 +8,7 @@ import subprocess import common -class UserlandComponent(common.Component): +class UserlandComponent(common.BuildComponent): def add_parser_arguments(self, parser): parser.add_argument( '--has-package', @@ -88,4 +88,4 @@ has the OpenBLAS libraries and headers installed. return common.userland_build_dir if __name__ == '__main__': - UserlandComponent().build() + UserlandComponent().main() diff --git a/common.py b/common.py index f6c936b..aa0167b 100644 --- a/common.py +++ b/common.py @@ -84,11 +84,11 @@ if os.path.exists(config_file): config = imp.load_source('config', config_file) configs = {x:getattr(config, x) for x in dir(config) if not x.startswith('__')} -class Component: +class BuildComponent: def __init__(self): pass - def build(self): + def main(self): ''' Parse CLI, and to the build based on it. diff --git a/copy-overlay b/copy-overlay index bbf3470..cb9bf1b 100755 --- a/copy-overlay +++ b/copy-overlay @@ -6,7 +6,7 @@ import shutil import common -class CopyOverlayComponent(common.Component): +class CopyOverlayComponent(common.BuildComponent): def do_build(self, args): distutils.dir_util.copy_tree( common.rootfs_overlay_dir, @@ -26,4 +26,4 @@ over just adding that to BR2_ROOTFS_OVERLAY: } if __name__ == '__main__': - CopyOverlayComponent().build() + CopyOverlayComponent().main()