X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=8b6c90724269d4aa77e62b05242cca532c52c9cc;hb=1beddd3524d29623c2cd5aedcb2d7fdaca4c9216;hp=2c84468a9f0aee681a764a227ce45c1a412b8eba;hpb=2fa239467da2f67787ed665050ced418479c3013;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 2c84468a..8b6c9072 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -53,13 +53,21 @@ def createBertosProject(project_info): cfgdir = prjdir + "/cfg" shutil.rmtree(cfgdir, True) os.mkdir(cfgdir) + # Set to 1 the autoenabled for enabled modules + for module, information in project_info.info("MODULES").items(): + if information["enabled"] and "configuration" in information and information["configuration"] != "": + configurations = project_info.info("CONFIGURATIONS") + configuration = configurations[information["configuration"]] + for start, parameter in configuration["paramlist"]: + if "type" in configuration[parameter] and configuration[parameter]["type"] == "autoenabled": + configuration[parameter]["value"] = "1" + project_info.setInfo("CONFIGURATIONS", configurations) + # Copy all the configuration files for configuration, information in project_info.info("CONFIGURATIONS").items(): string = open(sources_dir + "/" + configuration, "r").read() for start, parameter in information["paramlist"]: infos = information[parameter] value = infos["value"] - if "type" in infos["informations"] and infos["informations"]["type"] == "autoenabled": - value = "1" if "unsigned" in infos["informations"].keys() and infos["informations"]["unsigned"]: value += "U" if "long" in infos["informations"].keys() and infos["informations"]["long"]: @@ -94,7 +102,7 @@ def mkGenerator(project_info, makefile): mk_data["$cxxflags"] = " ".join(project_info.info("CPU_INFOS")["CXX_FLAGS"]) mk_data["$asflags"] = " ".join(project_info.info("CPU_INFOS")["AS_FLAGS"]) mk_data["$arflags"] = " ".join(project_info.info("CPU_INFOS")["AR_FLAGS"]) - mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info) + mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$cppasrc"], mk_data["$cxxsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info) mk_data["$prefix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[0] mk_data["$suffix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[1] mk_data["$main"] = os.path.basename(project_info.info("PROJECT_PATH")) + "/main.c" @@ -124,6 +132,10 @@ def csrcGenerator(project_info): # file to be included in PCSRC variable pcsrc = [] # files to be included in CPPASRC variable + cppasrc = [] + # files to be included in CXXSRC variable + cxxsrc = [] + # files to be included in ASRC variable asrc = [] # constants to be included at the beginning of the makefile constants = {} @@ -150,13 +162,25 @@ def csrcGenerator(project_info): pcsrc.append(file) for file in dependency_files: csrc.append(file) + for file in project_info.info("CPU_INFOS")["C_SRC"]: + csrc.append(file) + for file in project_info.info("CPU_INFOS")["PC_SRC"]: + pcsrc.append(file) for file in asm_files: - asrc.append(file) + cppasrc.append(file) + for file in project_info.info("CPU_INFOS")["CPPA_SRC"]: + cppasrc.append(file) + for file in project_info.info("CPU_INFOS")["CXX_SRC"]: + cxxsrc.append(file) + for file in project_info.info("CPU_INFOS")["ASRC"]: + asrc.append(file) csrc = " \\\n\t".join(csrc) + " \\" pcsrc = " \\\n\t".join(pcsrc) + " \\" + cppasrc = " \\\n\t".join(cppasrc) + " \\" + cxxsrc = " \\\n\t".join(cxxsrc) + " \\" asrc = " \\\n\t".join(asrc) + " \\" constants = "\n".join([os.path.basename(project_info.info("PROJECT_PATH")) + "_" + key + " = " + str(value) for key, value in constants.items()]) - return csrc, pcsrc, asrc, constants + return csrc, pcsrc, cppasrc, cxxsrc, asrc, constants def findModuleFiles(module, project_info): # Find the files related to the selected module