"""
mk_data = {}
mk_data["$pname"] = os.path.basename(project_info.info("PROJECT_PATH"))
+ mk_data["$cpuflag"] = project_info.info("CPU_INFOS")["CPU_FLAG_NAME"]
mk_data["$cpuname"] = project_info.info("CPU_INFOS")["CORE_CPU"]
mk_data["$cflags"] = " ".join(project_info.info("CPU_INFOS")["C_FLAGS"])
mk_data["$ldflags"] = " ".join(project_info.info("CPU_INFOS")["LD_FLAGS"])
+ mk_data["$cppflags"] = " ".join(project_info.info("CPU_INFOS")["CPP_FLAGS"])
+ mk_data["$cppaflags"] = " ".join(project_info.info("CPU_INFOS")["CPPA_FLAGS"])
+ 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["$prefix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[0]
mk_data["$suffix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[1]
- mk_data["$cross"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[0]
mk_data["$main"] = os.path.basename(project_info.info("PROJECT_PATH")) + "/main.c"
for key in mk_data:
while makefile.find(key) != -1:
asm_files |= set(dependencySFiles)
for file in module_files:
if not harvard or "harvard" not in information or information["harvard"] == "both":
- csrc.append(os.path.normpath(file))
+ csrc.append(file)
if harvard and "harvard" in information:
- pcsrc.append(os.path.normpath(file))
+ pcsrc.append(file)
for file in dependency_files:
- csrc.append(os.path.normpath(file))
+ csrc.append(file)
for file in asm_files:
- asrc.append(os.path.normpath(file))
+ asrc.append(file)
csrc = " \\\n\t".join(csrc) + " \\"
pcsrc = " \\\n\t".join(pcsrc) + " \\"
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
-
+
def findModuleFiles(module, project_info):
# Find the files related to the selected module
cfiles = []
# .c files related to the module and the cpu architecture
for filename, path in findDefinitions(module + ".c", project_info) + \
findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".c", project_info):
- path = path.replace(project_info.info("SOURCES_PATH") + "/", "")
+ path = path.replace(project_info.info("SOURCES_PATH") + os.sep, "")
+ if os.sep != "/":
+ path = replaceSeparators(path)
cfiles.append(path + "/" + filename)
# .s files related to the module and the cpu architecture
for filename, path in findDefinitions(module + ".s", project_info) + \
findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".s", project_info) + \
findDefinitions(module + ".S", project_info) + \
findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".S", project_info):
- path = path.replace(project_info.info("SOURCES_PATH") + "/", "")
+ path = path.replace(project_info.info("SOURCES_PATH") + os.sep, "")
+ if os.sep != "/":
+ path = replaceSeparators(path)
sfiles.append(path + "/" + filename)
# .c and .s files related to the module and the cpu tags
for tag in project_info.info("CPU_INFOS")["CPU_TAGS"]:
for filename, path in findDefinitions(module + "_" + tag + ".c", project_info):
- path = path.replace(project_info.info("SOURCES_PATH") + "/", "")
+ path = path.replace(project_info.info("SOURCES_PATH") + os.sep, "")
+ if os.sep != "/":
+ path = replaceSeparators(path)
cfiles.append(path + "/" + filename)
for filename, path in findDefinitions(module + "_" + tag + ".s", project_info) + \
findDefinitions(module + "_" + tag + ".S", project_info):
- path = path.replace(project_info.info("SOURCES_PATH") + "/", "")
+ path = path.replace(project_info.info("SOURCES_PATH") + os.sep, "")
+ if os.sep != "/":
+ path = replaceSeparators(path)
sfiles.append(path + "/" + filename)
return cfiles, sfiles
+def replaceSeparators(path):
+ """
+ Replace the separators in the given path with unix standard separator.
+ """
+ while path.find(os.sep) != -1:
+ path = path.replace(os.sep, "/")
+ return path
+
def getSystemPath():
path = os.environ["PATH"]
if os.name == "nt":
define_list[key] = (value,)
return define_list
-def getDescriptionInformations(comment):
- """
- Take the doxygen comment and strip the wizard informations, returning the tuple
- (comment, wizard_information)
+def getDescriptionInformations(comment):
+ """
+ Take the doxygen comment and strip the wizard informations, returning the tuple
+ (comment, wizard_information)
"""
brief = ""
description = ""
project.setInfo("LISTS", list_info_dict)
project.setInfo("CONFIGURATIONS", configuration_info_dict)
project.setInfo("FILES", file_dict)
-
+
def formatParamNameValue(text):
"""
Take the given string and return a tuple with the name of the parameter in the first position