From 1e209f4e383e78f1c06810d95b175c591e40e1e2 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 30 Jan 2009 16:36:22 +0000 Subject: [PATCH] Add a first stub of the makefile generation function git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2246 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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"] -- 2.25.1