self.infos["PROJECT_SRC_PATH"] = os.path.join(self.infos["PROJECT_PATH"], self.infos["PROJECT_NAME"])
self.infos["PROJECT_HW_PATH"] = os.path.join(self.infos["PROJECT_PATH"], project_data.get("PROJECT_HW_PATH", self.infos["PROJECT_PATH"]))
+ self.infos["PROJECT_SRC_PATH_FROM_MAKEFILE"] = project_data.get("PROJECT_SRC_PATH_FROM_MAKEFILE")
+ self.infos["PROJECT_HW_PATH_FROM_MAKEFILE"] = project_data.get("PROJECT_HW_PATH_FROM_MAKEFILE")
+
linked_sources_path = project_data["BERTOS_PATH"]
sources_abspath = os.path.abspath(os.path.join(project_dir, linked_sources_path))
project_data["BERTOS_PATH"] = sources_abspath
project_data["PROJECT_NAME"] = project_info.info("PROJECT_NAME", os.path.basename(directory))
project_src_relpath = relpath.relpath(project_info.info("PROJECT_SRC_PATH"), directory)
project_data["PROJECT_SRC_PATH"] = project_src_relpath
+ project_data["PROJECT_SRC_PATH_FROM_MAKEFILE"] = project_info.info("PROJECT_SRC_PATH_FROM_MAKEFILE")
project_data["TOOLCHAIN"] = project_info.info("TOOLCHAIN")
project_data["CPU_NAME"] = project_info.info("CPU_NAME")
project_data["SELECTED_FREQ"] = project_info.info("SELECTED_FREQ")
project_data["WIZARD_VERSION"] = WIZARD_VERSION
project_data["PRESET"] = project_info.info("PRESET")
project_data["PROJECT_HW_PATH"] = relpath.relpath(project_info.info("PROJECT_HW_PATH"), directory)
+ project_data["PROJECT_HW_PATH_FROM_MAKEFILE"] = project_info.info("PROJECT_HW_PATH_FROM_MAKEFILE")
return pickle.dumps(project_data)
def loadPlugin(plugin):
# Deadly performances loss was here :(
mk_data = {}
mk_data["$pname"] = os.path.basename(project_info.info("PROJECT_PATH"))
- mk_data["$ppath"] = relpath.relpath(project_info.info("PROJECT_SRC_PATH"), project_info.info("PROJECT_PATH"))
+ mk_data["$ppath"] = project_info.info("PROJECT_SRC_PATH_FROM_MAKEFILE")
mk_data["$main"] = "/".join(["$(%s_SRC_PATH)" %project_info.info("PROJECT_NAME"), "main.c"])
for key in mk_data:
makefile = makefile.replace(key, mk_data[key])
destination = os.path.join(prjdir, os.path.basename(prjdir) + ".mk")
mk_data = {}
mk_data["$pname"] = project_info.info("PROJECT_NAME")
- mk_data["$ppath"] = relpath.relpath(project_info.info("PROJECT_SRC_PATH"), project_info.info("PROJECT_PATH"))
+ mk_data["$ppath"] = project_info.info("PROJECT_SRC_PATH_FROM_MAKEFILE")
mk_data["$cpuclockfreq"] = project_info.info("SELECTED_FREQ")
cpu_mk_parameters = []
for key, value in project_info.info("CPU_INFOS").items():
mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$cppasrc"], mk_data["$cxxsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info)
mk_data["$prefix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].rsplit("gcc", 1)[0])
mk_data["$suffix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].rsplit("gcc", 1)[1])
- mk_data["$hwpath"] = relpath.relpath(project_info.info("PROJECT_HW_PATH"), project_info.info("PROJECT_PATH"))
+ mk_data["$hwpath"] = project_info.info("PROJECT_HW_PATH_FROM_MAKEFILE")
for key in mk_data:
makefile = makefile.replace(key, mk_data[key])
open(destination, "w").write(makefile)
# TODO write a general function that works for both the mk file and the Makefile
mk_data = {}
mk_data["$pname"] = project_info.info("PROJECT_NAME")
- mk_data["$ppath"] = relpath.relpath(project_info.info("PROJECT_SRC_PATH"), project_info.info("PROJECT_PATH"))
+ mk_data["$ppath"] = project_info.info("PROJECT_SRC_PATH_FROM_MAKEFILE")
for key in mk_data:
makefile = makefile.replace(key, mk_data[key])
open(destination, "w").write(makefile)