+ constants = "\n".join([os.path.basename(project_info.info("PROJECT_PATH")) + "_" + key + " = " + str(value) for key, value in constants.items()])
+ return csrc, pcsrc, constants
+
+def findModuleFiles(module, project_info):
+ ## Find the files related to the selected module
+ cfiles = []
+ sfiles = []
+ ## .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") + "/", "")
+ 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") + "/", "")
+ 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") + "/", "")
+ 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") + "/", "")
+ sfiles.append(path + "/" + filename)
+ return cfiles, sfiles