Add the main file in the makefile
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Mar 2009 15:27:09 +0000 (15:27 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 20 Mar 2009 15:27:09 +0000 (15:27 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2398 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index 7e5642d4c769eea13f5f310da4ec846bda7267a8..6d4e107117f96f5aa2814d5d79f44ada94a3ac4a 100644 (file)
@@ -69,7 +69,7 @@ def createBertosProject(projectInfo):
     makefile = mkGenerator(projectInfo, makefile)
     open(prjdir + "/" + os.path.basename(prjdir) + ".mk", "w").write(makefile)
     ## Destination main.c file
-    main = open("srctemplates/main.c",\10"r").read()
+    main = open("srctemplates/main.c", "r").read()
     open(prjdir + "/main.c", "w").write(main)
     if "codelite" in projectInfo.info("OUTPUT"):
         workspace = codeliteWorkspaceGenerator(projectInfo)
@@ -90,6 +90,7 @@ def mkGenerator(projectInfo, makefile):
     mkData["$prefix"] = projectInfo.info("TOOLCHAIN")["path"].split("gcc")[0]
     mkData["$suffix"] = projectInfo.info("TOOLCHAIN")["path"].split("gcc")[1]
     mkData["$cross"] = projectInfo.info("TOOLCHAIN")["path"].split("gcc")[0]
+    mkData["$main"] = projectInfo.info("PROJECT_PATH") + "/" + os.path.basename(projectInfo.info("PROJECT_PATH")) + "/main.c"
     for key in mkData:
         while makefile.find(key) != -1:
             makefile = makefile.replace(key, mkData[key])