From: duplo Date: Fri, 30 Jan 2009 16:36:22 +0000 (+0000) Subject: Add a first stub of the makefile generation function X-Git-Tag: 2.1.0~436 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=1e209f4e383e78f1c06810d95b175c591e40e1e2;hp=e4faa12ff38fb20e13c34527410cc267a88e16dc;p=bertos.git 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 --- 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"]