+ tag_list = getTagSet(cpu_info)
+ # Create, fill and store the dict with the tags
+ tag_dict = {}
+ for element in tag_list:
+ tag_dict[element] = False
+ infos = project_info.info("CPU_INFOS")
+ for tag in tag_dict:
+ if tag in infos["CPU_TAGS"] + [infos["CPU_NAME"], infos["TOOLCHAIN"]]:
+ tag_dict[tag] = True
+ else:
+ tag_dict[tag] = False
+ project_info.setInfo("ALL_CPU_TAGS", tag_dict)
+ if "TOOLCHAIN" in info_dict:
+ project_data["TOOLCHAIN"] = info_dict["TOOLCHAIN"]
+ if os.path.exists(project_data["TOOLCHAIN"]["path"]):
+ project_info.setInfo("TOOLCHAIN", project_data["TOOLCHAIN"])
+ else:
+ raise ToolchainException(project_info)
+ project_info.setInfo("SELECTED_FREQ", project_data["SELECTED_FREQ"])
+ project_info.setInfo("OUTPUT", project_data["OUTPUT"])
+ loadModuleData(project_info, True)
+ setEnabledModules(project_info, project_data["ENABLED_MODULES"])
+ return project_info
+
+def setEnabledModules(project_info, enabled_modules):
+ modules = project_info.info("MODULES")
+ files = {}
+ for module, information in modules.items():
+ information["enabled"] = module in enabled_modules
+ for dependency in information["depends"]:
+ if not dependency in modules:
+ if dependency in files:
+ files[dependency] += 1
+ else:
+ files[dependency] = 1
+ project_info.setInfo("MODULES", modules)
+ project_info.setInfo("FILES", files)
+
+def enabledModules(project_info):
+ enabled_modules = []
+ for name, module in project_info.info("MODULES").items():
+ if module["enabled"]:
+ enabled_modules.append(name)
+ return enabled_modules
+
+def mergeSources(srcdir, new_sources, old_sources):
+ # The current mergeSources function provide only a raw copy of the sources in the
+ # created project.
+ #
+ # TODO: implement the three way merge algorithm
+ #
+ shutil.rmtree(srcdir, True)
+ copytree.copytree(os.path.join(new_sources, "bertos"), srcdir, ignore_list=const.IGNORE_LIST)