X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=27bb57f351f2dee0d5052745056874dea1459aa6;hb=1e209f4e383e78f1c06810d95b175c591e40e1e2;hp=d3e7127eed4dbab8b40feeace72193e83f297630;hpb=695e044f1387440a718abf42a79800e785f71c7f;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index d3e7127e..27bb57f3 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -58,6 +58,22 @@ def createBertosProject(projectInfos): f = open(cfgdir + "/" + os.path.basename(key), "w") f.write(string) f.close() + ## Destinatio mk file + makefile = open(sourcesDir + "/" + "template.mk", "r").read() + makefile = mkGenerator(projectInfos, makefile) + open(prjdir + "/" + "template.km", "w").write(makefile) + +def mkGenerator(projectInfos, makefile): + mkData = {} + mkData["pname"] = os.path.basename(projectInfos.info("PROJECT_PATH")) + mkData["cpuname"] = projectInfos.info("CPU_INFOS")["CPU_NAME"] + mkData["cflags"] = " ".join(projectInfos.info("CPU_INFOS")["C_FLAGS"]) + mkData["ldflags"] = " ".join(projectInfos.info("CPU_INFOS")["LD_FLAGS"]) + for key in mkData: + print key, mkData[key] + while makefile.find(key) != -1: + makefile = makefile.replace(key, mkData[key]) + return makefile def getSystemPath(): path = os.environ["PATH"]