def __init__(self, print_build, do_build):
        self.init_only = True if len(print_build) + len(do_build) == 0 else False
        self.print_build = print_build
        self.do_build = do_build
        self.builds = list(set(do_build + print_build))
        ss = Main.config_class_lookup("Software")
        bootloader = Main.get_bootloader_cfg()

        self.code_tasks = [CodeTaskList(s, s.name not in self.do_build)
                           for s in ss
                           if hasattr(s, "build_required")
                           and s.build_required
                           and (s.name in self.builds)]
        # always need the bootloader
        if bootloader.software not in self.builds:
            self.code_tasks.extend(CodeTaskList(s,
                                                s.name not in self.do_build)
                                   for s in ss if s.name == bootloader.software)
        if self.init_only:
            for c in self.code_tasks:
                for t in c.tasks:
                    t.uptodate = [True]
        else:
            for c in self.code_tasks:
                if c.basename in self.do_build:
                    for t in c.tasks:
                        t.uptodate = [False]
    def __init__(self, build, print_only=False):
        self.init_only = True if not build else False
        self.builds = build
        ss = Main.config_class_lookup("Software")
        target_software = Main.target_software

        self.code_tasks = [
            CodeTaskList(s, s.name not in self.builds, print_only) for s in ss
            if (s.name in self.builds)
        ]

        ## always need the target
        if target_software.name not in self.builds:
            self.code_tasks.append(CodeTaskList(Main.target_software, False))